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
r2089 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . script
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
08 Apr '09
Author: chatellier
Date: 2009-04-08 12:43:46 +0000 (Wed, 08 Apr 2009)
New Revision: 2089
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx
Log:
Remove unused code (swixat specific)
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2009-04-08 10:24:31 UTC (rev 2088)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2009-04-08 12:43:46 UTC (rev 2089)
@@ -1,228 +0,0 @@
-/* *##%
- * Copyright (C) 2006 - 2009
- * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-/* *
- * UIHelper.java
- *
- * Created: 10 août 2006 12:08:13
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.ui;
-
-import fr.ifremer.isisfish.ui.util.IDialog;
-
-
-import org.codelutin.topia.TopiaContext;
-import org.codelutin.util.FileUtil;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import static javax.swing.Action.NAME;
-import javax.swing.table.TableColumn;
-import java.io.File;
-
-
-/**
- * Set of usefull method for all swixat UI
- *
- * @author poussin
- */
-public class UIHelper {
-
- /**
- * to use log facility, just put in your code: log.info(\"...\");
- */
- static private Log log = LogFactory.getLog(UIHelper.class);
-
- /**
- * only used to debug action in XML
- *
- * @param o object
- */
- static public void print(Object o) {
- System.out.println("++++++++++ print: '" + o + "'(" + (o != null ? o.getClass().getName() : "null") + ")");
- }
-
- static public void closeContext(TopiaContext context) {
- try {
- log.debug("clause TopiaContext: " + context);
- if (context != null) {
- context.closeContext();
- }
- } catch (Exception eee) {
- log.warn("Can't close context: " + context, eee);
- }
- }
-
-// /**
-// * Permet de modifier l'element selection dans l'arbre
-// *
-// * @param tree l'arbre ou doit se faire la selection
-// * @param jmodel le JTreeModel de l'arbre
-// * @param o l'objet a selectionner dans l'arbre
-// */
-// static public void setTreeSelection(JTree tree, JTreeModel jmodel, Object o) {
-// try {
-// log.debug("try to select objet in tree: " + o);
-// DefaultMutableTreeNode node = jmodel.getNode(o);
-// TreeNode[] path = node.getPath();
-// if (log.isDebugEnabled()) {
-// log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
-// }
-// TreePath newSelectionPath = new TreePath(path);
-// tree.setSelectionPath(newSelectionPath);
-// tree.scrollPathToVisible(newSelectionPath);
-// tree.revalidate();
-// tree.repaint();
-// } catch (Exception eee) {
-// log.warn("Can't select object in tree: " + o, eee);
-// }
-// }
-
-// static public void setTreeSelectionFirstChild(JTree tree, JTreeModel jmodel, Object o) {
-// try {
-// log.debug("try to select first child of objet in tree: " + o);
-// DefaultMutableTreeNode node = jmodel.getNode(o);
-// TreeNode[] path = ((DefaultMutableTreeNode) node.getFirstChild()).getPath();
-// if (log.isDebugEnabled()) {
-// log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
-// }
-// TreePath newSelectionPath = new TreePath(path);
-// tree.setSelectionPath(newSelectionPath);
-// tree.scrollPathToVisible(newSelectionPath);
-// tree.revalidate();
-// tree.repaint();
-// } catch (Exception eee) {
-// log.warn("Can't select child of object in tree: " + o, eee);
-// }
-// }
-
-
- public static void setColumnsWidth(JTable table, int... widths) {
- for (int i = 0; i < widths.length; i++) {
- String colName;
- colName = table.getColumnName(i);
- TableColumn column;
- column = table.getColumn(colName);
- column.setPreferredWidth(widths[i]);
- }
- table.repaint();
- }
-
- /**
- * Init a dialog
- *
- * @param dial the dialog to prepare
- * @param okAction action to be process by {@link fr.ifremer.isisfish.ui.util.IDialog#getOk()} button
- * @param cancelAction action to be process by {@link fr.ifremer.isisfish.ui.util.IDialog#getCancel()}} button
- * @param show flag to set visible dialog after init
- * @param maxWidth maximum width authorized
- * @param minHeight minimum height
- * @param maxHeight maximum height authorized
- */
- public static void prepareDialog(JDialog dial, AbstractAction okAction,
- AbstractAction cancelAction, boolean show,
- int maxWidth, int minHeight, int maxHeight) {
- if (!IDialog.class.isAssignableFrom(dial.getClass())) {
- return;
- }
-
- IDialog dialog = (IDialog) dial;
- //dialog.frame = frame;
- if (okAction != null) {
- okAction.putValue(NAME, dialog.getOk().getText());
- dialog.setOkAction(okAction);
- dialog.getOk().setAction(okAction);
- }
- if (cancelAction != null) {
- cancelAction.putValue(NAME, dialog.getCancel().getText());
- dialog.setCancelAction(cancelAction);
- dialog.getCancel().setAction(cancelAction);
- }
-
- dialog.setMaxWidth(maxWidth);
- dialog.setMinHeight(minHeight);
- dialog.setMaxHeight(maxHeight);
- dialog.setMaximumSize(new java.awt.Dimension(maxWidth, maxHeight));
-
- int width = dialog.computeWidth();
- int height = dialog.computeHeight();
-
- if (width > maxWidth) {
- width = maxWidth;
- }
- if (height > maxHeight) {
- height = maxHeight;
- }
- dialog.setSize(width, height);
- dialog.doRefresh();
- if (show) {
- dialog.setVisible(true);
- }
- }
-
- /**
- * Open a directory and push it back in the field given.
- * it field given was previously containing the absolute path of a file
- * then it will use the same file name for push back.
- *
- * @param field the JTextField containing the path where to put new dir
- * @param ok the ok button to activate if everything is allwright
- */
- public static void openDirChooser(JTextField field, JButton ok) {
- // assumer field contain path to a filename
- File dir = new File(field.getText());
- String name = "";
- File oldDir = dir;
- if (dir.isFile() || !dir.exists()) {
- name = dir.getName();
- oldDir = dir.getParentFile();
- }
-
- String newDir = FileUtil.getDirectory();
-
- if (newDir != null) {
- File newFile = new File(newDir);
- String path;
-
- path = newFile.getAbsolutePath();
- if (!"".equals(name)) {
- path += File.separator + name;
- }
-
- field.setText(path);
- }
- ok.setEnabled(newDir != null || oldDir.exists());
- }
-
-}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx 2009-04-08 10:24:31 UTC (rev 2088)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx 2009-04-08 12:43:46 UTC (rev 2089)
@@ -41,7 +41,8 @@
text='isisfish.script.export.chooseDir'
toolTipText='isisfish.script.export.tooltip.chooseDir'
enabled='{!isEmpty()}'
- onActionPerformed="fr.ifremer.isisfish.ui.UIHelper.openDirChooser(archivePath,ok)"/>
+ />
+ <!-- onActionPerformed="fr.ifremer.isisfish.ui.UIHelper.openDirChooser(archivePath,ok)" -->
</cell>
</row>
<row fill='horizontal'>
1
0
r2088 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish java/fr/ifremer/isisfish/actions java/fr/ifremer/isisfish/aspect java/fr/ifremer/isisfish/datastore java/fr/ifremer/isisfish/datastore/migration java/fr/ifremer/isisfish/datastore/update java/fr/ifremer/isisfish/simulator java/fr/ifremer/isisfish/simulator/launcher java/fr/ifremer/isisfish/ui java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/input/check java/fr/ifremer/isisfish/ui/simulator java/fr/ifremer/isisfish
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
08 Apr '09
Author: chatellier
Date: 2009-04-08 10:24:31 +0000 (Wed, 08 Apr 2009)
New Revision: 2088
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.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
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Doc.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Docable.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Various modification, add doc, improve UI, improve tooltip
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -157,8 +157,11 @@
}
/**
- * retourne le repertoire ou sont stockes les scripts compiles
- * @return
+ * Retourne le repertoire ou sont stockes les scripts compiles.
+ *
+ * Create directory if not exists.
+ *
+ * @return compilation directory
*/
public File getCompileDirectory() {
File result = getOptionAsFile(Option.COMPILATION_DIRECTORY.key);
@@ -169,9 +172,25 @@
}
/**
- * Retourne l'objet Local a utilise pour la langue
- * @return
+ * Get javadoc directory.
+ *
+ * Create directory if not exists.
+ *
+ * @return javadoc directory
*/
+ public File getJavadocDirectory() {
+ File result = getOptionAsFile(Option.COMPILATION_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
+
+ /**
+ * Retourne l'objet {@link Locale} a utilise pour la langue.
+ *
+ * @return application {@link Locale}
+ */
public Locale getLocale() {
String value = getOption(Option.LOCALE.key);
Locale result = (Locale)ConvertUtils.convert(value, Locale.class);
@@ -652,6 +671,7 @@
protected static enum Option {
COMPILATION_DIRECTORY("compilation.directory", _("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-build"),
+ JAVADOC_DIRECTORY("javadoc.directory", _("isisfish.config.main.javadocDirectory.description"), getUserHome() + File.separator + "isis-docs"),
CONFIG_FILE(CONFIG_FILE_NAME, _("isisfish.config.main.configFileName.description"), CONFIG_FILENAME),
BACKUP_DIRECTORY("backup.directory", _("isisfish.config.main.defaultBackupDirectory.description"), getUserHome() + File.separator + "isis-backup"),
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/package-info.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/package-info.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -0,0 +1,5 @@
+/**
+ * Command line action classes implementation.
+ */
+package fr.ifremer.isisfish.actions;
+
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/package-info.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/package-info.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -0,0 +1,11 @@
+/**
+ * Aspect definition classes.
+ *
+ * Contains two aspects :
+ * <ul>
+ * <li>{@link Cache} : cache aspect</li>
+ * <li>{@link Trace} : trace expect</li>
+ * </ul>
+ */
+package fr.ifremer.isisfish.aspect;
+
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -133,8 +133,8 @@
* @throws IsisFishException s'il est impossible de retourner une map
* convenable
*/
- public Map<String, Class> getParameterNames() throws IsisFishException {
- Map<String, Class> result = null;
+ public Map<String, Class<?>> getParameterNames() throws IsisFishException {
+ Map<String, Class<?>> result = null;
// On essai de recuperer les paramètres depuis la classe compilé
// si c possible
try {
@@ -173,8 +173,8 @@
* @param plan le plan dont on souhaite les infos de parametre
* @return retourne le nom et le type des parametres du plan
*/
- static public Map<String, Class> getParameterNames(AnalysePlan plan) {
- Map<String, Class> result = new LinkedHashMap<String, Class>();
+ public static Map<String, Class<?>> getParameterNames(AnalysePlan plan) {
+ Map<String, Class<?>> result = new LinkedHashMap<String, Class<?>>();
for (Field field : plan.getClass().getFields()) {
if (field.getName().startsWith(PARAM_PREFIX)) {
result.put(field.getName().substring(PARAM_PREFIX.length()),
@@ -293,7 +293,7 @@
}
/**
- * @return the @Doc of the underlied AnalysePlan class
+ * @return the @Doc of the underlied AnalysePlan class
* @see DocHelper
* @see Doc
* @see Docable
@@ -346,7 +346,6 @@
* @see Doc
* @see Docable
*/
-
public String getDescription() {
String result = null;
try {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -34,9 +34,7 @@
import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.export.Export;
-import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.util.Doc;
import fr.ifremer.isisfish.util.DocHelper;
import fr.ifremer.isisfish.util.Docable;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -103,6 +103,21 @@
}
/**
+ * Build class javadoc.
+ *
+ * Ouput javadoc will be stored in default javadoc directory :
+ * {@link fr.ifremer.isisfish.IsisConfig#getJavadocDirectory()}
+ *
+ * @param force force javadoc build even if destination file is never
+ * @param out output print stream. if <tt>null</tt standart output will be used
+ * @return
+ */
+ public int doJavadoc(boolean force, PrintWriter out) {
+ int result = 0; //JavadocHelper.javadoc(this, IsisFish.config.getJavadocDirectory(), force, out);
+ return result;
+ }
+
+ /**
* Retourne la classe compilée. Compile le fichier si besoin.
*
* @return la class
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -46,8 +46,8 @@
* Created: 17 août 2005 11:11:51 CEST
*
* @author chatellier <chatellier at codelutin.com>
- * @version $Revision: 1628 $
- * Last update: $Date: 2008-11-28 10:25:59 +0100 (ven 28 nov 2008) $ by : $Author: chatellier $
+ * @version $Revision$
+ * Last update: $Date$ by : $Author$
*/
public class SensitivityStorage extends JavaSourceStorage implements Docable { // SensitivityStorage
@@ -156,8 +156,7 @@
if (result == null) {
try {
//String code = getContent();
- log
- .fatal("FIXME a faire recherche des parametre dans le source");
+ log.fatal("FIXME a faire recherche des parametres dans le source");
throw new IsisFishException(
_("isisfish.error.source.parameter"));
// TODO implanter la recherche des parametres.
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java
___________________________________________________________________
Name: svn:keywords
+ Author Revision Date
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -0,0 +1,5 @@
+/**
+ * IsisFish V2 import.
+ */
+package fr.ifremer.isisfish.datastore.migration;
+
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/package-info.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/package-info.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -0,0 +1,14 @@
+/**
+ * Data storage.
+ *
+ * Contains all classes used to store isis fish data.
+ *
+ * Cant be :
+ * <ul>
+ * <li>H2 database storage
+ * <li>H2 memory storage
+ * <li>Java source storage
+ * </ul>
+ */
+package fr.ifremer.isisfish.datastore;
+
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -0,0 +1,5 @@
+/**
+ * Database storage migration.
+ */
+package fr.ifremer.isisfish.datastore.update;
+
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -662,9 +662,9 @@
String planName = AnalysePlanStorage.getName(plan);
String paramTag = "plan." + planIndex + ".parameter.";
- for (Map.Entry<String, Class> entry : AnalysePlanStorage.getParameterNames(plan).entrySet()) {
+ for (Map.Entry<String, Class<?>> entry : AnalysePlanStorage.getParameterNames(plan).entrySet()) {
String propName = entry.getKey();
- Class type = entry.getValue();
+ Class<?> type = entry.getValue();
if (TopiaEntity.class.isAssignableFrom(type)) {
type = TopiaEntity.class;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -392,7 +392,7 @@
* @param param les parametres de la simulation
* @param launcher le launcher a utiliser pour lancer la simulation
* @param priority la priorite de la simulation
- * @param sensitivitycalculator l'implementation du calculateur de sensibiilite
+ * @param sensitivitycalculator l'implementation du calculateur de sensibilite
* @param designPlan le design plan qui contient les facteurs
*/
public void submit(String id, SimulationParameter param,
@@ -400,7 +400,6 @@
SensitivityCalculator sensitivitycalculator, DesignPlan designPlan) {
try {
-
// build master sensitivity export directory
File masterExportDirectory = new File(IsisFish.config.getDefaultExportDirectory(), id);
if (!masterExportDirectory.isDirectory()) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,5 +1,6 @@
/**
- * <h1>Launcher</h1>
+ * <h1>Isis fish simulation launchers.</h1>
+ *
* <h2>To do</h2>
* <li> voir pourquoi l'interface de visu des simulations en cours ne se
* rafraichi pas
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,53 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-/* *
- * IsisFish.java
- *
- * Created: 1 aout 2005 18:37:25 CEST
- *
- * @author Benjamin POUSSIN <poussin at codelutin.com>
- * @version $Revision: 1312 $
- *
- * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
- * by : $Author: sletellier $
- */
- -->
-<JFrame id="exitComment" name="isisfish.exit.title" visible="true" size='{new Dimension(400,100)}' title="isisfish.exit.title"
- layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/Exit.xgl")}'>
-<!--
- Resizable="true"
- bundle="org.codelutin.i18n.I18nBundleBridge"
--->
- <script>
- import org.codelutin.widget.XMLGridLayout;
- </script>
-
- <JLabel constraints='"labelExitComment"' text="isisfish.exit.text"/>
-
- <JTextArea constraints='"fieldExitComment"' id="fieldExitComment" />
-
- <JButton constraints='"buttonExitOK"' id="buttonExitOK" text="isisfish.common.ok"/>
-
-<!--
-actionCommand="Saisie.saveCommentAndExit($fieldExitComment/text)"
--->
-
-</JFrame>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,61 +17,62 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * Help.java
- *
- * Created: 2 août 2006 10:53:43
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.ui;
+import java.awt.Desktop;
+import java.net.URL;
import java.util.HashMap;
+import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-//import org.swixat.framework.OutputView;
-
/**
+ * Help.
+ *
+ * Created: 2 août 2006 10:53:43
+ *
* @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class Help {
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(Help.class);
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(Help.class);
// URL alias
- static public HashMap<String, String> urlAlias = new HashMap<String, String>();
+ public static Map<String, String> URLSALIAS = new HashMap<String, String>();
static {
- urlAlias.put("JAVA_API", "http://java.sun.com/j2se/1.5.0/api/index.html");
- urlAlias.put("ISIS_API", "http://isisfish.labs.libre-entreprise.org/apidocs/index.html");
- urlAlias.put("MATRIX_API", "http://lutinmath.labs.libre-entreprise.org/apidocs/index.html");
+ URLSALIAS.put("ISISFISH", "http://isis-fish.labs.libre-entreprise.org/");
+ URLSALIAS.put("JAVA_API", "http://java.sun.com/javase/6/docs/api/index.html");
+ URLSALIAS.put("ISIS_API", "http://isis-fish.labs.libre-entreprise.org/isis-fish/apidocs/index.html");
+ URLSALIAS.put("MATRIX_API", "http://lutinmatrix.labs.libre-entreprise.org/lutinmatrix/apidocs/index.html");
+ URLSALIAS.put("TOPIA_API", "http://topia.labs.libre-entreprise.org/topia/topia-persistence/apidocs/inde…");
}
- static public Object showURL(String urlOrAlias) {
+ /**
+ * Open url using default system browser.
+ *
+ * @param urlOrAlias url alias, or full url
+ */
+ public static void showURL(String urlOrAlias) {
try {
- String url = urlAlias.get(urlOrAlias);
+ String url = URLSALIAS.get(urlOrAlias);
+
if (url == null) {
url = urlOrAlias;
}
-
- // FIXME jdk1.6 recupere le navigateur souhaité par l'utilisateur dans
- // IsisConfig et le lancer en ouvrant la page url
- // avec jdk1.6
- // Desktop.getDesktop().browse(new URL(url));
-// return new OutputView("Error.xml", "error", "Not implemented: " + url);
- } catch(Exception eee){
- log.error("Can't show help", eee);
-// return new OutputView("Error.xml", "error", eee.getMessage());
- }
- return null;
+
+ Desktop.getDesktop().browse(new URL(url).toURI());
+ } catch(Exception e){
+ if (log.isErrorEnabled()) {
+ log.error("Can't show help", e);
+ }
+ }
}
}
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,28 +0,0 @@
-/* *##%
- * Copyright (C) 2006 - 2009
- * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-package fr.ifremer.isisfish.ui;
-
-/**
- *
- * @author letellier
- */
-public interface SaveVerfier {
- public int checkEdit();
-}
Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java (from rev 2073, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java)
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -0,0 +1,28 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui;
+
+/**
+ *
+ * @author letellier
+ */
+public interface SaveVerifier {
+ public int checkEdit();
+}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -45,14 +45,9 @@
import javax.swing.JDialog;
import javax.swing.JTable;
import javax.swing.JTextField;
-import javax.swing.JTree;
import static javax.swing.Action.NAME;
import javax.swing.table.TableColumn;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
import java.io.File;
-import java.util.Arrays;
/**
@@ -87,13 +82,13 @@
}
}
- /**
- * Permet de modifier l'element selection dans l'arbre
- *
- * @param tree l'arbre ou doit se faire la selection
- * @param jmodel le JTreeModel de l'arbre
- * @param o l'objet a selectionner dans l'arbre
- */
+// /**
+// * Permet de modifier l'element selection dans l'arbre
+// *
+// * @param tree l'arbre ou doit se faire la selection
+// * @param jmodel le JTreeModel de l'arbre
+// * @param o l'objet a selectionner dans l'arbre
+// */
// static public void setTreeSelection(JTree tree, JTreeModel jmodel, Object o) {
// try {
// log.debug("try to select objet in tree: " + o);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -14,7 +14,7 @@
* @author letellier
*/
public class WelcomeSaveVerifier {
- protected List<fr.ifremer.isisfish.ui.SaveVerfier> verifiers = new ArrayList<fr.ifremer.isisfish.ui.SaveVerfier>();
+ protected List<fr.ifremer.isisfish.ui.SaveVerifier> verifiers = new ArrayList<fr.ifremer.isisfish.ui.SaveVerifier>();
public void addSaveVerifier(InputSaveVerifier inputVerifier) {
verifiers.add(inputVerifier);
@@ -23,7 +23,7 @@
public boolean allIsSaved(){
boolean exit = true;
int responce = JOptionPane.CANCEL_OPTION;
- for (fr.ifremer.isisfish.ui.SaveVerfier s : verifiers){
+ for (fr.ifremer.isisfish.ui.SaveVerifier s : verifiers){
responce = s.checkEdit();
}
//boolean exit = checkEdit(event, component);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,6 +1,6 @@
<!--
/* *##%
- * Copyright (C) 2005
+ * Copyright (C) 2005 - 2009
* Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -18,8 +18,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * IsisFish.java
+/**
+ * WelcomeUI.
*
* Created: 1 aout 2005 18:37:25 CEST
*
@@ -50,12 +50,13 @@
import jaxx.runtime.JAXXInitialContext;
import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
- java.util.Map <JFrame, WelcomePanelUI> allFrameOpened;
+ Map<JFrame, WelcomePanelUI> allFrameOpened;
WelcomeSaveVerifier verifier = new WelcomeSaveVerifier();
setContextValue(verifier);
- allFrameOpened = new java.util.HashMap <JFrame, WelcomePanelUI> ();
+ allFrameOpened = new java.util.HashMap<JFrame, WelcomePanelUI>();
welcomePanelUI.setContent(new WelcomeTabUI(new JAXXInitialContext().add(getVerifier())));
- protected void openFrame(Container c, String title){
+
+ protected void openFrame(Container c, String title) {
JFrame f = new JFrame();
f.setLayout(new BorderLayout());
WelcomePanelUI welcome = new WelcomePanelUI(new JAXXInitialContext().add(verifier).add(this));
@@ -100,58 +101,55 @@
f.setVisible(true);
}
public void close() {
- if (verifier.allIsSaved()){
+ if (verifier.allIsSaved()) {
exit();
}
}
- protected void exit(){
+ protected void exit() {
this.dispose();
IsisFish.quit();
}
- protected WelcomeSaveVerifier getVerifier(){
+ protected WelcomeSaveVerifier getVerifier() {
return getContextValue(WelcomeSaveVerifier.class);
}
protected void monitorUI() {
new ApplicationMonitorUI();
}
- protected void updateVCS(){
+ protected void updateVCS() {
// FIXME a reimplanter
// thread:Welcome.updateVCS()
}
- protected void config(){
+ protected void config() {
// FIXME a reimplanter
// Welcome.showConfig()
}
- protected void configVCS(){
+ protected void configVCS() {
// FIXME a reimplanter
// fr.ifremer.isisfish.versionning.ui.VCSConfigUI.doLaunch()
}
- protected void help(){
-// FIXME a reimplanter
+ protected void help(String urlAlias) {
+ Help.showURL(urlAlias);
}
- protected void about(){
- org.codelutin.widget.AboutFrame about = new org.codelutin.widget.AboutFrame();
-// about.setAboutHtmlText($jaxxObjectDescriptor)
-// AboutFrame about = new AboutFrame();
- about.setTitle(_("isisfish.about.title"));
- about.setIconPath("images/strategy.jpg");
- about.setAboutHtmlText(_("isisfish.about.abouthtmltext", IsisConfig.getVersion()));
- about.setLicenseText(_("isisfish.about.licensetext"));
- about.setBackgroundColor(Color.WHITE);
- // center frame
- Dimension dim = getToolkit().getScreenSize();
- about.setSize(640, 520);
- about.setLocation((dim.width - about.getSize().width) / 2,
- (dim.height - about.getSize().height) / 2);
-// about.pack();
- about.setVisible(true);
+
+ protected void about() {
+ AboutFrame about = new AboutFrame();
+ // about.setAboutHtmlText($jaxxObjectDescriptor)
+ // AboutFrame about = new AboutFrame();
+ about.setTitle(_("isisfish.about.title"));
+ about.setIconPath("images/strategy.jpg");
+ about.setAboutHtmlText(_("isisfish.about.abouthtmltext", IsisConfig.getVersion()));
+ about.setLicenseText(_("isisfish.about.licensetext"));
+ about.setBackgroundColor(Color.WHITE);
+ // center frame
+ Dimension dim = getToolkit().getScreenSize();
+ about.setSize(640, 520);
+ about.setLocation((dim.width - about.getSize().width) / 2,
+ (dim.height - about.getSize().height) / 2);
+ about.setVisible(true);
}
]]>
</script>
<JMenuBar>
-<!--
- id="menuBar"
--->
<JMenu text='isisfish.welcome.menu.file'>
<JMenuItem text="isisfish.welcome.menu.synchro" enabled='false' onActionPerformed='updateVCS()'/>
<JSeparator/>
@@ -172,7 +170,14 @@
</JMenu>
</JMenu>
<JMenu text="isisfish.welcome.menu.help">
- <JMenuItem text="isisfish.welcome.menu.help" onActionPerformed='help()'/>
+ <JMenu text="isisfish.welcome.menu.help">
+ <JMenuItem text="isisfish.welcome.menu.help.isisfish" onActionPerformed='help("ISISFISH")'/>
+ <JSeparator/>
+ <JMenuItem text="isisfish.welcome.menu.help.javaapi" onActionPerformed='help("JAVA_API")'/>
+ <JMenuItem text="isisfish.welcome.menu.help.isisfishapi" onActionPerformed='help("ISIS_API")'/>
+ <JMenuItem text="isisfish.welcome.menu.help.lutinmatrixapi" onActionPerformed='help("MATRIX_API")'/>
+ <JMenuItem text="isisfish.welcome.menu.help.topiaapi" onActionPerformed='help("TOPIA_API")'/>
+ </JMenu>
<JSeparator/>
<JMenuItem text="isisfish.welcome.menu.monitor" onActionPerformed='monitorUI()'/>
<JSeparator/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -35,7 +35,7 @@
*
* @author letellier
*/
-public class InputSaveVerifier implements JAXXAction, fr.ifremer.isisfish.ui.SaveVerfier {
+public class InputSaveVerifier implements JAXXAction, fr.ifremer.isisfish.ui.SaveVerifier {
protected JButton currentNewButton = null;
protected JButton currentDeleteButton = null;
protected JButton currentSaveButton = null;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -197,14 +197,14 @@
if (isEmptyMatrix(infoSaisonPop.getMigrationMatrix())) {
result.addInfo(infoSaisonPop, _("isisfish.error.empty.migration"));
} else if(isNullMatrix(infoSaisonPop.getMigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.emty.migration"));
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.migration"));
} else if(isNegativeMatrix(infoSaisonPop.getMigrationMatrix())) {
result.addError(infoSaisonPop, _("isisfish.error.migration.negative"));
}
if (isEmptyMatrix(infoSaisonPop.getEmigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.emty.emigration"));
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.emigration"));
} else if(isNullMatrix(infoSaisonPop.getEmigrationMatrix())) {
result.addInfo(infoSaisonPop, _("isisfish.error.empty.emigration"));
} else if(isNegativeMatrix(infoSaisonPop.getEmigrationMatrix())) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-08 10:24:31 UTC (rev 2088)
@@ -94,7 +94,7 @@
protected void setSimulParamsAnalysePlans() {
if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1) {
AnalysePlan analysePlan = (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue();
- Map<String, Class> values = getContextValue(SimulAction.class).getAnalysePlanParameterName(analysePlan);
+ Map<String, Class<?>> values = getContextValue(SimulAction.class).getAnalysePlanParameterName(analysePlan);
int row = 0;
if (values != null) {
DefaultTableModel model = new DefaultTableModel() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -670,8 +670,8 @@
getSimulationParameter().clearPlans();
}
- public Map<String, Class> getAnalysePlanParameterName(AnalysePlan ap) {
- Map<String, Class> result = null;
+ public Map<String, Class<?>> getAnalysePlanParameterName(AnalysePlan ap) {
+ Map<String, Class<?>> result = null;
if (ap != null) {
result = AnalysePlanStorage.getParameterNames(ap);
}
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 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2009-04-08 10:24:31 UTC (rev 2088)
@@ -86,7 +86,7 @@
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
//This is where a real application would open the file.
- getContextValue(SimulAction.class).saveSimulation(file);
+ getContextValue(SimulAction.class).saveSimulation(file);
}
}
]]>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -23,6 +23,7 @@
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -30,6 +31,8 @@
import javax.swing.JButton;
import javax.swing.JList;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,7 +47,6 @@
import fr.ifremer.isisfish.simulator.AnalysePlan;
import fr.ifremer.isisfish.ui.widget.renderer.ToolTipListModel;
import fr.ifremer.isisfish.util.Doc;
-import fr.ifremer.isisfish.util.DocHelper;
/**
* This is a factory of {@link ToolTipListModel} used in simulator ui
@@ -56,8 +58,8 @@
*/
public class ToolTipListModelFactory {
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulAction.class);
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(ToolTipListModelFactory.class);
/**
* Build a new {@link ToolTipListModel} for for @Doc'field of all given
@@ -78,8 +80,8 @@
if (!names.isEmpty()) {
try {
- ScriptStorage storage =
- ScriptStorage.getScript("ResultName.java");
+ ScriptStorage storage = ScriptStorage
+ .getScript("ResultName.java");
Class resultNameClass = storage.getCodeClass();
// TODO: if we can't find class, perhaps try to parser Java source ?
Field[] fields = resultNameClass.getFields();
@@ -95,7 +97,7 @@
String fieldName = map.get(name);
texts.add(name);
Doc fieldDoc = storage.getFieldDoc(fieldName);
- toolTips.add(DocHelper.asString(fieldDoc));
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -126,10 +128,12 @@
try {
for (String name : names) {
ExportStorage storage = ExportStorage.getExport(name);
- Doc fieldDoc = storage.getClassDoc();
- // suppress .java extension ?
+ Doc classDoc = storage.getClassDoc();
+ String description = storage.getDescription();
+ // suppress .java extension
texts.add(name.substring(0, name.length() - 5));
- toolTips.add(DocHelper.asString(fieldDoc));
+ toolTips.add(ToolTipListModelFactory.asString(classDoc,
+ description));
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -150,7 +154,8 @@
* @param names Rule names
* @return the model builded
*/
- public static ToolTipListModel createRuleDescriptionsModel(List<String> names) {
+ public static ToolTipListModel createRuleDescriptionsModel(
+ List<String> names) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
@@ -159,10 +164,12 @@
try {
for (String name : names) {
RuleStorage storage = RuleStorage.getRule(name);
+ Doc classDoc = storage.getClassDoc();
String description = storage.getDescription();
// suppress .java extension ?
texts.add(name.substring(0, name.length() - 5));
- toolTips.add(description);
+ toolTips.add(ToolTipListModelFactory.asString(classDoc,
+ description));
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -189,7 +196,8 @@
* @param list the list containing the renderer
* @return the model builded
*/
- public static ToolTipListModel createRuleDescriptionsModel2(List<Rule> rules, JButton clearButton, JList list) {
+ public static ToolTipListModel createRuleDescriptionsModel2(
+ List<Rule> rules, JButton clearButton, JList list) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
@@ -212,7 +220,8 @@
}
ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
// should check if there is an already listener ?
- SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list
+ .getModel());
return listModel;
}
@@ -228,9 +237,9 @@
* @return the model builded
*/
public static ToolTipListModel createRuleParamsModel(String ruleName) {
-
+
if (log.isDebugEnabled()) {
- log.debug("createRuleParamsModel for rules : " + ruleName);
+ log.debug("createRuleParamsModel for rules : " + ruleName);
}
List<String> texts = new ArrayList<String>();
@@ -248,7 +257,7 @@
for (String paramName : mapParams.keySet()) {
Doc fieldDoc = storage.getParamDoc(paramName);
texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
}
}
} catch (Exception eee) {
@@ -282,12 +291,13 @@
try {
for (String name : names) {
- AnalysePlanStorage storage =
- AnalysePlanStorage.getAnalysePlan(name);
+ AnalysePlanStorage storage = AnalysePlanStorage
+ .getAnalysePlan(name);
+ Doc classDoc = storage.getClassDoc();
String description = storage.getDescription();
// suppress .java extension ?
texts.add(name.substring(0, name.length() - 5));
- toolTips.add(description);
+ toolTips.add(ToolTipListModelFactory.asString(classDoc, description));
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -325,11 +335,13 @@
// we are dealing with AnalysePlan objects
for (AnalysePlan analysePlan : plans) {
String name = AnalysePlanStorage.getName(analysePlan);
- AnalysePlanStorage storage = AnalysePlanStorage.getAnalysePlan(name);
+ AnalysePlanStorage storage = AnalysePlanStorage
+ .getAnalysePlan(name);
+ Doc classDoc = storage.getClassDoc();
String description = storage.getDescription();
// suppress .java extension ?
texts.add(name);
- toolTips.add(description);
+ toolTips.add(ToolTipListModelFactory.asString(classDoc, description));
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -339,7 +351,8 @@
}
ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
// should check if there is an already listener ?
- SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list
+ .getModel());
return listModel;
}
@@ -360,26 +373,27 @@
List<String> toolTips = new ArrayList<String>();
if (name != null && !name.equals("")) {
try {
- AnalysePlanStorage storage =
- AnalysePlanStorage.getAnalysePlan(name);
- Map<String, Class> mapParams = storage.getParameterNames();
+ AnalysePlanStorage storage = AnalysePlanStorage
+ .getAnalysePlan(name);
+ Map<String, Class<?>> mapParams = storage.getParameterNames();
if (!mapParams.isEmpty()) {
for (String paramName : mapParams.keySet()) {
Doc fieldDoc = storage.getParamDoc(paramName);
texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
}
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field.analyseplan", name), eee);
+ log.warn(_("isisfish.error.obtain.field.analyseplan", name),
+ eee);
}
}
}
return new ToolTipListModel(texts, toolTips);
}
-
+
/**
* Build a new {@link ToolTipListModel} for params of a given {link SensitivityCalculator} :
* <ul>
@@ -391,32 +405,34 @@
* @param sensitivityName the sensitivity calculator name
* @return the model builded
*/
- public static ToolTipListModel createSensitivityParamsModel(String sensitivityName) {
+ public static ToolTipListModel createSensitivityParamsModel(
+ String sensitivityName) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
if (!StringUtils.isEmpty(sensitivityName)) {
try {
- SensitivityStorage storage =
- SensitivityStorage.getSensitivity(sensitivityName);
+ SensitivityStorage storage = SensitivityStorage
+ .getSensitivity(sensitivityName);
Map<String, Class<?>> mapParams = storage.getParameterNames();
if (!mapParams.isEmpty()) {
for (String paramName : mapParams.keySet()) {
Doc fieldDoc = storage.getParamDoc(paramName);
texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
}
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field.sensitivitycalculator", sensitivityName), eee);
+ log.warn(_("isisfish.error.obtain.field.sensitivitycalculator",
+ sensitivityName), eee);
}
}
}
return new ToolTipListModel(texts, toolTips);
}
-
+
/**
* Build a new {@link ToolTipListModel} for params of a given {@link Export} :
* <ul>
@@ -434,26 +450,26 @@
List<String> toolTips = new ArrayList<String>();
if (!StringUtils.isEmpty(exportName)) {
try {
- ExportStorage storage =
- ExportStorage.getExport(exportName);
+ ExportStorage storage = ExportStorage.getExport(exportName);
Map<String, Class<?>> mapParams = storage.getParameterNames();
if (!mapParams.isEmpty()) {
for (String paramName : mapParams.keySet()) {
Doc fieldDoc = storage.getParamDoc(paramName);
texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
}
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field.export", exportName), eee);
+ log.warn(_("isisfish.error.obtain.field.export",
+ exportName), eee);
}
}
}
return new ToolTipListModel(texts, toolTips);
}
-
+
/**
* Build a new {@link ToolTipListModel} for descriptions of given
* {@link Export} :
@@ -479,9 +495,10 @@
for (Export export : exports) {
String name = ExportStorage.getName(export);
ExportStorage storage = ExportStorage.getExport(name);
+ Doc classDoc = storage.getClassDoc();
String description = storage.getDescription();
texts.add(name);
- toolTips.add(description);
+ toolTips.add(ToolTipListModelFactory.asString(classDoc, description));
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -491,7 +508,49 @@
}
ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
// should check if there is an already listener ?
- SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list
+ .getModel());
return listModel;
}
+
+ /**
+ * Return HTML formatted tooltip.
+ *
+ * Use optional documentation (if any) or use @Doc's class doc.
+ *
+ * @param doc the doc to use
+ * @param optionalDocumentations optional documentation
+ * @return a string nicely print version
+ */
+ protected static String asString(Doc doc, String... optionalDocumentations) {
+
+ String tooltip = null;
+
+ if (doc != null) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<html>");
+ if (!ArrayUtils.isEmpty(optionalDocumentations)) {
+ for (String optionalDocumentation : optionalDocumentations) {
+ sb.append("<p>" + optionalDocumentation + "</p>");
+ }
+ } else {
+ sb.append("<p>" + doc.value() + "</p>");
+ }
+ if (!StringUtils.isEmpty(doc.author())) {
+ sb.append("<p><b>author: </b>" + doc.author() + "</p>");
+ }
+ if (!StringUtils.isEmpty(doc.date())) {
+ sb.append("<p><b>date: </b>" + doc.date() + "</p>");
+ }
+ if (!StringUtils.isEmpty(doc.version())) {
+ sb.append("<p><b>version: </b>" + doc.version() + "</p>");
+ }
+ sb.append("</html>");
+ tooltip = sb.toString();
+
+ // replace all \n by <br/>
+ tooltip = tooltip.replace("\n", "<br/>");
+ }
+ return tooltip;
+ }
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Doc.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Doc.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Doc.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,24 +1,42 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.util;
+/**
+ * Used by user to add informations about a code he wrote.
+ *
+ * @author chemit
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
@java.lang.annotation.Retention(value =
- java.lang.annotation.RetentionPolicy.RUNTIME
-)
-
+ java.lang.annotation.RetentionPolicy.RUNTIME)
@java.lang.annotation.Target(value = {
- java.lang.annotation.ElementType.FIELD,
- java.lang.annotation.ElementType.TYPE
- }
-)
-
-/**
- * used by user to add informations about a code he wrote.
- * @see Rule
- * @see AnalysePlan
- * @see Export
- */
-
+ java.lang.annotation.ElementType.FIELD,
+ java.lang.annotation.ElementType.TYPE
+ })
public @interface Doc {
+
/**
+ *
* @return the content of the documentation
*/
String value();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -27,12 +27,17 @@
import java.lang.reflect.Field;
/**
- * Class containg usefull methods to obtain @Doc informations
+ * Class containing usefull methods to obtain @Doc informations
* for a class,field,method...
*
* @author chemit
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
*/
public class DocHelper {
+
/** Logger for this class */
private static final Log log = LogFactory.getLog(DocHelper.class);
@@ -49,6 +54,8 @@
* @param value object given
* @return the @Doc associated to the class of the given object, or null if value is
* null or no doc found for his class
+ *
+ * @deprecated as of 20090408 never used
*/
public static Doc getClassDoc(Object value) {
return value == null ? null : getClassDoc(value.getClass());
@@ -58,19 +65,21 @@
* @param f file to use
* @return the @Doc associated to the field, or null
* if field is null of no @doc found
+ *
+ * @deprecated as of 20090408 never used
*/
public static Doc getFieldDoc(Field f) {
return f == null ? null : f.getAnnotation(Doc.class);
}
/**
- * @param klazz klazz to use
- * @param fieldName flied name ot use
- * @return the @Doc asosciated with e filed of the given class,
- * or null if clazz is null, field does not exist, or no
+ * @param klazz class to use
+ * @param fieldName field name to use
+ * @return the @Doc associated with e filed of the given class,
+ * or null if class is null, field does not exist, or no
* Doc for the field
*/
- public static Doc getFieldDoc(Class klazz, String fieldName) {
+ public static Doc getFieldDoc(Class<?> klazz, String fieldName) {
Field f = null;
try {
f = klazz == null ? null : klazz.getField(fieldName);
@@ -86,6 +95,8 @@
/**
* @param doc doc to use
* @return the {@link Doc#value()} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
*/
public static String getValue(Doc doc) {
return doc == null ? "" : doc.value();
@@ -94,6 +105,8 @@
/**
* @param doc doc to use
* @return the {@link Doc#author()}} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
*/
public static String getAuthor(Doc doc) {
return doc == null ? "" : doc.author();
@@ -102,6 +115,8 @@
/**
* @param doc doc to use
* @return the {@link Doc#date()} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
*/
public static String getDate(Doc doc) {
return doc == null ? "" : doc.date();
@@ -110,39 +125,10 @@
/**
* @param doc doc to use
* @return the {@link Doc#version()} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
*/
public static String getVersion(Doc doc) {
return doc == null ? "" : doc.version();
}
-
- /**
- * @param doc the doc to use
- * @return a string nicely print version
- */
- public static String asString(Doc doc) {
- StringBuilder sb = new StringBuilder();
- if (doc == null) {
- return "";
- }
- sb.append(doc.value());
- boolean more = false;
- StringBuilder sb2 = new StringBuilder();
- if (!"".equals(doc.author())) {
- sb2.append(", author: ").append(doc.author());
- more = true;
- }
- if (!"".equals(doc.date())) {
- sb2.append(", date: ").append(doc.date());
- more = true;
- }
- if (!"".equals(doc.version())) {
- sb2.append(", version: ").append(doc.version());
- more = true;
- }
- if (more) {
- sb.append(" <").append(sb2.toString().substring(2)).append(">");
- }
- return sb.toString();
- }
-
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Docable.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Docable.java 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Docable.java 2009-04-08 10:24:31 UTC (rev 2088)
@@ -1,23 +1,55 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.util;
/**
- * This is the contract to be realize by any class wich wanted to have a @Doc support.
+ * This is the contract to be realize by any class which wanted to have a @Doc support.
*
* @author chemit
* @see Doc
* @see DocHelper
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
*/
public interface Docable {
- /** @return the @Doc of the class, or null if none */
+ /**
+ * Class documentation (if any).
+ *
+ * @return the @Doc of the class, or null if none
+ */
Doc getClassDoc();
/**
+ * Field documentation (if any).
+ *
* @param fieldName name of the field to use
* @return the @Doc of the field, or null if none
*/
Doc getFieldDoc(String fieldName);
- /** @return the description of the class, or null if none */
+ /**
+ * Class documentation (if any).
+ *
+ * @return the description of the class, or null if none
+ */
String getDescription();
}
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-08 10:24:31 UTC (rev 2088)
@@ -154,6 +154,7 @@
isisfish.config.main.defaultSimulator.description=
isisfish.config.main.defaultTagValue.description=
isisfish.config.main.encoding.description=encoding used on system
+isisfish.config.main.javadocDirectory.description=
isisfish.config.main.javadocURL.description=
isisfish.config.main.launchUI.description=
isisfish.config.main.localSimulator.description=
@@ -246,13 +247,11 @@
isisfish.error.empty.species=specie capturable empty
isisfish.error.empty.species.name=specie's name is empty
isisfish.error.empty.unit=measure unit is empty
-isisfish.error.emty.emigration=emigration empty
-isisfish.error.emty.migration=Migration empty
-isisfish.error.equation.retun.number=EquationImpl must retun a number\: %1$s
+isisfish.error.equation.return.number=EquationImpl must retun a number\: %1$s
isisfish.error.evaluate.equation=Can't evaluate equation\: %1$s
isisfish.error.evalute.plan.script=Can't evaluate plan script
isisfish.error.factor.coefValueIsOne=Coefficient can't be equal to 1
-isisfish.error.factor.invalid=Factor is not valid \:
+isisfish.error.factor.invalid=Factor is not valid
isisfish.error.file.already.exists=The file %1$s already exist
isisfish.error.get.fisheryRegion=Can't get FisheryRegion
isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
@@ -1005,6 +1004,11 @@
isisfish.welcome.menu.file=File
isisfish.welcome.menu.frame=Frame
isisfish.welcome.menu.help=Help
+isisfish.welcome.menu.help.isisfish=Isis-Fish Website
+isisfish.welcome.menu.help.isisfishapi=Isis-Fish API
+isisfish.welcome.menu.help.javaapi=Java API
+isisfish.welcome.menu.help.lutinmatrixapi=LutinMatrix API
+isisfish.welcome.menu.help.topiaapi=ToPIA API
isisfish.welcome.menu.input=Input
isisfish.welcome.menu.monitor=Logs frame
isisfish.welcome.menu.queue=Simulation queue
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-08 10:22:41 UTC (rev 2087)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-08 10:24:31 UTC (rev 2088)
@@ -154,6 +154,7 @@
isisfish.config.main.defaultSimulator.description=le nom du simulateur par d\u00E9faut \u00E0 utiliser lors d'une simulation
isisfish.config.main.defaultTagValue.description=TODO
isisfish.config.main.encoding.description=l'encoding du syst\u00E8me
+isisfish.config.main.javadocDirectory.description=
isisfish.config.main.javadocURL.description=l'url de la javadoc des scripts
isisfish.config.main.launchUI.description=
isisfish.config.main.localSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement
@@ -246,14 +247,12 @@
isisfish.error.empty.species=espece capturable vide
isisfish.error.empty.species.name=le nom d'espece est vide
isisfish.error.empty.unit=l'unit\u00E9 de mesure est vide
-isisfish.error.emty.emigration=emigration vide
-isisfish.error.emty.migration=Migration vide
-isisfish.error.equation.retun.number=EquationImpl must retun a number\: %1$s
+isisfish.error.equation.return.number=EquationImpl must retun a number\: %1$s
isisfish.error.evaluate.equation=Can't evaluate equation\: %1$s
isisfish.error.evalute.plan.script=Can't evaluate plan script
isisfish.error.factor.coefValueIsOne=Un co\u00E9fficient ne peux pas \u00EAtre \u00E9gual \u00E0 1
-isisfish.error.factor.invalid=Le facteur n'est pas valide \:
-isisfish.error.file.already.exists\=The=file %1$s already exist
+isisfish.error.factor.invalid=Le facteur n'est pas valide
+isisfish.error.file.already.exists=The file %1$s already exist
isisfish.error.get.fisheryRegion=Can't get FisheryRegion
isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
isisfish.error.immigration.negative=immigration negative
@@ -1005,6 +1004,11 @@
isisfish.welcome.menu.file=Fichier
isisfish.welcome.menu.frame=Fen\u00EAtre
isisfish.welcome.menu.help=Aide
+isisfish.welcome.menu.help.isisfish=Site d'Isis-Fish
+isisfish.welcome.menu.help.isisfishapi=API Isis-Fish
+isisfish.welcome.menu.help.javaapi=API Java
+isisfish.welcome.menu.help.lutinmatrixapi=API LutinMatrix
+isisfish.welcome.menu.help.topiaapi=API ToPIA
isisfish.welcome.menu.input=Saisie
isisfish.welcome.menu.monitor=Fen\u00EAtre de logs
isisfish.welcome.menu.queue=Liste des simulations
1
0
r2087 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
08 Apr '09
Author: chatellier
Date: 2009-04-08 10:22:41 +0000 (Wed, 08 Apr 2009)
New Revision: 2087
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
Log:
Remove subjar manifest introspection
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-08 08:54:34 UTC (rev 2086)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-08 10:22:41 UTC (rev 2087)
@@ -41,7 +41,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.FileUtil;
-import org.codelutin.util.Resource;
import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.JavaSourceStorage;
@@ -245,16 +244,6 @@
url.getPath().indexOf("!"));
if (!result.contains(jarName)) {
result += File.pathSeparator + jarName;
-
- // FIX to launch isis with java -jar
- URL jarURL = new URL("jar", null, jarName);
- URL[] urls = Resource.getClassPathURLsFromJarManifest(jarURL);
- for (URL url2 : urls) {
- String jarName2 = url2.getPath();
- if (!result.contains(jarName2)) {
- result += File.pathSeparator + jarName2;
- }
- }
}
}
}
1
0
r2086 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
08 Apr '09
Author: chatellier
Date: 2009-04-08 08:54:34 +0000 (Wed, 08 Apr 2009)
New Revision: 2086
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
Log:
Increase tooltip defaut display time
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 2009-04-08 07:48:09 UTC (rev 2085)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2009-04-08 08:54:34 UTC (rev 2086)
@@ -1,6 +1,6 @@
<!--
/* *##%
- * Copyright (C) 2005
+ * Copyright (C) 2005 - 2009
* Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -18,8 +18,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * IsisFish.java
+/**
+ * SimulUI.java
*
* Created: 1 aout 2005 18:37:25 CEST
*
@@ -39,22 +39,28 @@
import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
import fr.ifremer.isisfish.datastore.StorageException;
import fr.ifremer.isisfish.entities.FisheryRegionImpl;
+ import javax.swing.ToolTipManager;
- public SimulUI(SimulAction action){
+ public SimulUI(SimulAction action) {
setContextValue(action);
+
+ // increase tooltip display time
+ ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
+ toolTipManager.setInitialDelay(0);
+ toolTipManager.setDismissDelay(60000);
}
- protected void enablePreSimul(){
+ protected void enablePreSimul() {
simulTabs.setEnabledAt(1,true);
selTab(1);
}
- protected void enableAnalysePlan(){
+ protected void enableAnalysePlan() {
simulTabs.setEnabledAt(2,true);
selTab(2);
}
- protected void selTab(int i){
+ protected void selTab(int i) {
simulTabs.setSelectedIndex(i);
}
- protected void refreshAll(){
+ protected void refreshAll() {
paramsUI.refresh();
preSciptUI.refresh();
sensUI.refresh();
@@ -62,7 +68,7 @@
resultChoiceUI.refresh();
advencedParamsUI.refresh();
}
- protected void importSimulation(){
+ protected void importSimulation() {
JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(null);
@@ -73,7 +79,7 @@
refreshAll();
}
}
- protected void saveSimulation(){
+ protected void saveSimulation() {
JFileChooser fc = new JFileChooser();
int returnVal = fc.showSaveDialog(null);
1
0
r2085 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
by chatellier@users.labs.libre-entreprise.org 08 Apr '09
08 Apr '09
Author: chatellier
Date: 2009-04-08 07:48:09 +0000 (Wed, 08 Apr 2009)
New Revision: 2085
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
Log:
Move log from warn to trace (too verbose at runtime)
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 2009-04-07 16:06:51 UTC (rev 2084)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2009-04-08 07:48:09 UTC (rev 2085)
@@ -342,9 +342,14 @@
double result = defaultValue;
if (contextEquationValue.containsKey(key) && contextEquationOperator.containsKey(key)) {
+
Double value = contextEquationValue.get(key);
String operator = contextEquationOperator.get(key);
+ if (log.isTraceEnabled()) {
+ log.trace("Found key '" + key + "' current value = " + value);
+ }
+
if ("+".equals(operator)) {
result = value + defaultValue;
}
@@ -362,8 +367,8 @@
}
}
else {
- if (log.isWarnEnabled()) {
- log.warn("No key defined for key '" + key + "' in context");
+ if (log.isTraceEnabled()) {
+ log.trace("No key defined for key '" + key + "' in context");
}
}
1
0
Author: jcouteau
Date: 2009-04-07 16:06:51 +0000 (Tue, 07 Apr 2009)
New Revision: 2084
Modified:
isis-fish/trunk/pom.xml
Log:
Changing lutinj2r version in dependencies
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-07 14:54:23 UTC (rev 2083)
+++ isis-fish/trunk/pom.xml 2009-04-07 16:06:51 UTC (rev 2084)
@@ -353,7 +353,7 @@
<i18n.version>0.9</i18n.version>
<lutinwidget.version>0.14-SNAPSHOT</lutinwidget.version>
<generator.version>0.64</generator.version>
- <lutinj2r.version>0.2</lutinj2r.version>
+ <lutinj2r.version>0.3-SNAPSHOT</lutinj2r.version>
<jrst.version>0.8.4</jrst.version>
<license-switcher.version>0.6</license-switcher.version>
<openmap.version>4.6.4</openmap.version>
1
0
r2083 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
07 Apr '09
Author: chatellier
Date: 2009-04-07 14:54:23 +0000 (Tue, 07 Apr 2009)
New Revision: 2083
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
Log:
Tooltip here break analyseplan !
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-07 14:24:27 UTC (rev 2082)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-07 14:54:23 UTC (rev 2083)
@@ -1,6 +1,6 @@
<!--
/* *##%
- * Copyright (C) 2005
+ * Copyright (C) 2005 - 2009
* Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
*##%*/
/* *
- * IsisFish.java
+ * SensUI.java
*
* Created: 1 aout 2005 18:37:25 CEST
*
@@ -45,11 +45,11 @@
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
import jaxx.runtime.swing.Item;
- public SensUI (SimulAction action){
-
+ public SensUI (SimulAction action) {
setContextValue(action);
}
- public void refresh(){
+
+ public void refresh() {
java.util.List<Item> items = new ArrayList<Item>();
java.util.List<AnalysePlan> values = getContextValue(SimulAction.class).getParamAnalysePlans();
for (AnalysePlan ap : values) {
@@ -60,47 +60,53 @@
//listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList)));
setSimulParamsAnalysePlans();
}
- public void addAnalysePlan(){
+
+ public void addAnalysePlan() {
getContextValue(SimulAction.class).addAnalysePlan(fieldSimulParamsAnalysePlansSelect.getSelectedItem().toString());
setAnalysePlanButton();
refresh();
}
- public void removeAnalysePlan(){
+
+ public void removeAnalysePlan() {
getContextValue(SimulAction.class).removeAnalysePlan((AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
refresh();
}
- public void clearAnalysePlan(){
+
+ public void clearAnalysePlan() {
getContextValue(SimulAction.class).clearAnalysePlan();
refresh();
}
- protected void setAnalysePlanButton(){
- if (getContextValue(SimulAction.class).getParamAnalysePlans().toArray().length == 0){
+
+ protected void setAnalysePlanButton() {
+ if (getContextValue(SimulAction.class).getParamAnalysePlans().toArray().length == 0) {
buttonSimulParamsAnalysePlansClear.setEnabled(false);
buttonSimulParamsAnalysePlansRemove.setEnabled(false);
}
- else{
- if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1){
+ else {
+ if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1) {
buttonSimulParamsAnalysePlansRemove.setEnabled(true);
setSimulParamsAnalysePlans();
}
buttonSimulParamsAnalysePlansClear.setEnabled(true);
}
}
- protected void setSimulParamsAnalysePlans(){
- if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1){
- Map<String, Class> values = getContextValue(SimulAction.class).getAnalysePlanParameterName((AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
+
+ protected void setSimulParamsAnalysePlans() {
+ if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1) {
+ AnalysePlan analysePlan = (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue();
+ Map<String, Class> values = getContextValue(SimulAction.class).getAnalysePlanParameterName(analysePlan);
int row = 0;
- if (values != null){
- DefaultTableModel model = new DefaultTableModel(){
- @Override
- public boolean isCellEditable(int row, int column) {
- boolean result = false;
- if (column > 0){
- result =true;
- }
- return result;
+ if (values != null) {
+ DefaultTableModel model = new DefaultTableModel() {
+ @Override
+ public boolean isCellEditable(int row, int column) {
+ boolean result = false;
+ if (column > 0){
+ result =true;
}
- };
+ return result;
+ }
+ };
java.util.List<GenericCell> valuesList = new ArrayList<GenericCell>();
java.util.List<Object> propertyList = new ArrayList<Object>();
for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
@@ -111,9 +117,9 @@
propertyList.add(properties);
row++;
}
- model.addColumn(_("isisfish.common.name"), valuesList.toArray());
- model.addColumn(_("isisfish.common.value"), propertyList.toArray());
- simulParamsAnalysePlans.setModel(model);
+ model.addColumn(_("isisfish.common.name"), valuesList.toArray());
+ model.addColumn(_("isisfish.common.value"), propertyList.toArray());
+ simulParamsAnalysePlans.setModel(model);
ParameterColumnEditor cellEditor = new ParameterColumnEditor();
cellEditor.setRegion(getContextValue(SimulAction.class).getRegionStorage());
simulParamsAnalysePlans.getColumnModel().getColumn(1).setCellEditor(cellEditor);
@@ -126,7 +132,7 @@
getContextValue(SimulAction.class).setAnalysePlanParameterValue(data.getName(), (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue(), model.getValueAt(row, 1));
}
});
- simulParamsAnalysePlans.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createAnalysePlanParamsModel(listSimulParamsAnalysePlansList.getSelectedValue().toString())));
+ simulParamsAnalysePlans.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createAnalysePlanParamsModel(AnalysePlanStorage.getName(analysePlan))));
}
}
}
1
0
r2082 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
07 Apr '09
Author: chatellier
Date: 2009-04-07 14:24:27 +0000 (Tue, 07 Apr 2009)
New Revision: 2082
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
Log:
Tooltip here break analyseplan !
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-07 13:14:40 UTC (rev 2081)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-07 14:24:27 UTC (rev 2082)
@@ -42,6 +42,7 @@
import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
import fr.ifremer.isisfish.simulator.AnalysePlan;
+ import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
import jaxx.runtime.swing.Item;
public SensUI (SimulAction action){
@@ -51,12 +52,12 @@
public void refresh(){
java.util.List<Item> items = new ArrayList<Item>();
java.util.List<AnalysePlan> values = getContextValue(SimulAction.class).getParamAnalysePlans();
-
- for (AnalysePlan ap : values){
- items.add(new Item(ap.toString(), fr.ifremer.isisfish.datastore.AnalysePlanStorage.getName(ap), ap, false));
+ for (AnalysePlan ap : values) {
+ items.add(new Item(ap.toString(), AnalysePlanStorage.getName(ap), ap, false));
}
listSimulParamsAnalysePlansList.setItems(items);
- listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList)));
+ // Tooltip here break Name display
+ //listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList)));
setSimulParamsAnalysePlans();
}
public void addAnalysePlan(){
@@ -110,8 +111,8 @@
propertyList.add(properties);
row++;
}
- model.addColumn("Name", valuesList.toArray());
- model.addColumn("Value", propertyList.toArray());
+ model.addColumn(_("isisfish.common.name"), valuesList.toArray());
+ model.addColumn(_("isisfish.common.value"), propertyList.toArray());
simulParamsAnalysePlans.setModel(model);
ParameterColumnEditor cellEditor = new ParameterColumnEditor();
cellEditor.setRegion(getContextValue(SimulAction.class).getRegionStorage());
1
0
r2081 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
07 Apr '09
Author: chatellier
Date: 2009-04-07 13:14:40 +0000 (Tue, 07 Apr 2009)
New Revision: 2081
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/package-info.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/Formule.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java
Log:
Update entities doc
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,28 +1,54 @@
+/* *##%
+ * Copyright (C) 2006 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
/**
* Implantation des operations pour l'entité Cell.
+ *
+ * Created: 19 oct. 06 16:30:35
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class CellImpl extends CellAbstract implements Serializable, Cell {
+public class CellImpl extends CellAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.CellAbstract#toString()
*/
@Override
@@ -30,5 +56,5 @@
String result = getName();
return result;
}
-
+
} //CellImpl
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,6 +1,5 @@
/* *##%
- * Copyright (C) 2006
- * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ * Copyright (C) 2006 - 2009 Ifremer, Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -17,8 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * EffortDescriptionImpl.java
+package fr.ifremer.isisfish.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+/**
+ * EffortDescriptionImpl.
*
* Created: 19 oct. 06 16:30:35
*
@@ -28,25 +31,18 @@
* Last update: $Date$
* by : $Author$
*/
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-/**
- * @author poussin
- */
public class EffortDescriptionImpl extends EffortDescriptionAbstract {
- /* (non-Javadoc)
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3668146790780517650L;
+
+ /*
* @see fr.ifremer.isisfish.entities.EffortDescriptionAbstract#toString()
*/
@Override
public String toString() {
- String result = _("isisfish.effortDescription.toString", getSetOfVessels(), getPossibleMetiers());
+ String result = _("isisfish.effortDescription.toString",
+ getSetOfVessels(), getPossibleMetiers());
return result;
}
-
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,112 +17,107 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * EquationImpl.java
- *
- * Created: 20 janv. 2006 03:43:01
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
+import static org.codelutin.i18n.I18n._;
+
+import java.util.HashMap;
+import java.util.Map;
+
import bsh.Interpreter;
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.FormuleStorage;
import fr.ifremer.isisfish.equation.Language;
import fr.ifremer.isisfish.simulator.SimulationContext;
import fr.ifremer.isisfish.util.EvaluatorHelper;
-import static org.codelutin.i18n.I18n._;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
/**
+ * EquationImpl.
+ *
+ * Created: 20 janv. 2006 03:43:01
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
+public class EquationImpl extends EquationAbstract {
-public class EquationImpl extends EquationAbstract implements Serializable, Cloneable {
-
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = -2195404062556810283L;
/**
- * Evalue l'equation et retourne le résultat
- * @param param
- * @return
- * @throws IsisFishException
+ * Evalue l'equation et retourne le résultat.
+ *
+ * @param param equation args
+ * @return equation evaluation
*/
public double evaluate(Map<String, Object> param) {
String eq = getContent();
try {
// add Simulation context in map
param.put("context", SimulationContext.get());
-
+
// default is BSH
- if (Language.BSH.equals(getLanguage()) ||
- (("".equals(getLanguage()) || getLanguage() == null ) &&
- getJavaInterface() == null)) {
+ if (Language.BSH.equals(getLanguage())
+ || (("".equals(getLanguage()) || getLanguage() == null) && getJavaInterface() == null)) {
Interpreter bsh = new Interpreter();
for (Map.Entry<String, Object> e : param.entrySet()) {
bsh.set(e.getKey(), e.getValue());
}
Object val = bsh.eval(eq);
if (val instanceof Number) {
- double result =((Number)val).doubleValue();
+ double result = ((Number) val).doubleValue();
return result;
} else {
- throw new IsisFishRuntimeException(_("isisfish.error.equation.retun.number", eq));
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.equation.return.number", eq));
}
- } else // default Java if there are javaInterface
- if (Language.JAVA.equals(getLanguage()) || getJavaInterface() != null) {
- Object val = EvaluatorHelper.evaluate(FormuleStorage.FORMULE_PATH,
- getTopiaId(), getJavaInterface(), getContent(), param);
+ } else if (Language.JAVA.equals(getLanguage())
+ || getJavaInterface() != null) {
+ // default Java if there are javaInterface
+ Object val = EvaluatorHelper.evaluate(
+ FormuleStorage.FORMULE_PATH, getTopiaId(),
+ getJavaInterface(), getContent(), param);
if (val instanceof Number) {
- double result =((Number)val).doubleValue();
+ double result = ((Number) val).doubleValue();
return result;
} else {
- throw new IsisFishRuntimeException(_("isisfish.error.equation.retun.number", eq));
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.equation.return.number", eq));
}
- } else
+ } else {
// TODO other language support
- {
- throw new IsisFishRuntimeException(_("isisfish.error.unsupported.equation.langage", getLanguage(), eq));
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.unsupported.equation.langage",
+ getLanguage(), eq));
}
} catch (Exception eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.evaluate.equation", eq), eee);
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.evaluate.equation", eq), eee);
}
}
-
- public double evaluate(String name, Object value, Object ... others) {
+
+ public double evaluate(String name, Object value, Object... others) {
Map<String, Object> param = new HashMap<String, Object>();
param.put(name, value);
- for (int i=0; i<others.length;) {
- name = (String)others[i++];
+ for (int i = 0; i < others.length;) {
+ name = (String) others[i++];
value = others[i++];
param.put(name, value);
}
double result = evaluate(param);
return result;
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.EquationAbstract#toString()
*/
@Override
public String toString() {
- String result = getName() + "("+getCategory()+")";
+ String result = getName() + "(" + getCategory() + ")";
return result;
}
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * FisheryRegionImpl.java
- *
- * Created: 3 janv. 2006 17:14:52
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import java.io.File;
@@ -41,15 +29,20 @@
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
-
/**
+ * FisheryRegionImpl.
+ *
+ * Created: 3 janv. 2006 17:14:52
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class FisheryRegionImpl extends FisheryRegionAbstract {
- /** */
+ /** serialVersionUID */
private static final long serialVersionUID = 1L;
/* (non-Javadoc)
@@ -92,12 +85,12 @@
ArrayList<String> result = new ArrayList<String>();
RegionStorage regionStorage = RegionStorage.getRegion(getName());
for (String mapName : mapNames) {
- result.add(regionStorage.getMapRepository().getPath() + File.separator
- + mapName);
+ result.add(regionStorage.getMapRepository().getPath()
+ + File.separator + mapName);
}
return result;
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.FisheryRegion#getPort()
*/
@@ -129,7 +122,8 @@
*/
public List<VesselType> getVesselType() {
try {
- VesselTypeDAO dao = IsisFishDAOHelper.getVesselTypeDAO(getTopiaContext());
+ VesselTypeDAO dao = IsisFishDAOHelper
+ .getVesselTypeDAO(getTopiaContext());
List<VesselType> result = dao.findAll();
return result;
} catch (TopiaException eee) {
@@ -168,7 +162,8 @@
*/
public List<SetOfVessels> getSetOfVessels() {
try {
- SetOfVesselsDAO dao = IsisFishDAOHelper.getSetOfVesselsDAO(getTopiaContext());
+ SetOfVesselsDAO dao = IsisFishDAOHelper
+ .getSetOfVesselsDAO(getTopiaContext());
List<SetOfVessels> result = dao.findAll();
return result;
} catch (TopiaException eee) {
@@ -194,7 +189,8 @@
*/
public List<Strategy> getStrategy() {
try {
- StrategyDAO dao = IsisFishDAOHelper.getStrategyDAO(getTopiaContext());
+ StrategyDAO dao = IsisFishDAOHelper
+ .getStrategyDAO(getTopiaContext());
List<Strategy> result = dao.findAll();
return result;
} catch (TopiaException eee) {
@@ -207,7 +203,8 @@
*/
public List<TripType> getTripType() {
try {
- TripTypeDAO dao = IsisFishDAOHelper.getTripTypeDAO(getTopiaContext());
+ TripTypeDAO dao = IsisFishDAOHelper
+ .getTripTypeDAO(getTopiaContext());
List<TripType> result = dao.findAll();
return result;
} catch (TopiaException eee) {
@@ -237,5 +234,3 @@
return result;
}
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/Formule.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/Formule.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/Formule.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,8 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * Formule.java
+package fr.ifremer.isisfish.entities;
+
+/**
+ * Formule.
*
* Created: 14 févr. 2006 11:32:40
*
@@ -28,19 +30,26 @@
* Last update: $Date$
* by : $Author$
*/
+public interface Formule {
-package fr.ifremer.isisfish.entities;
+ /**
+ * Return formule name.
+ *
+ * @return formule name
+ */
+ String getName();
+ /**
+ * Return formule category name.
+ *
+ * @return formule category name
+ */
+ String getCategory();
-/**
- * @author poussin
- *
- */
-
-public interface Formule {
-
- public String getName();
- public String getCategory();
- public String getContent();
-
+ /**
+ * Return formule content.
+ *
+ * @return formule content
+ */
+ String getContent();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,19 +1,45 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
/**
* Implantation des operations pour l'entité Gear.
+ *
+ * Created: 14 févr. 2006 11:32:40
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class GearImpl extends GearAbstract implements Serializable, Gear {
+public class GearImpl extends GearAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
+ @Override
public FisheryRegion getFisheryRegion() {
try {
FisheryRegion result = RegionStorage
@@ -24,7 +50,7 @@
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,6 +1,24 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
import java.util.Collection;
import fr.ifremer.isisfish.IsisFishRuntimeException;
@@ -10,27 +28,39 @@
/**
* Implantation des operations pour l'entité Metier.
+ *
+ * Created: 14 févr. 2006 11:32:40
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class MetierImpl extends fr.ifremer.isisfish.entities.MetierAbstract implements Serializable, fr.ifremer.isisfish.entities.Metier {
+public class MetierImpl extends MetierAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
+ @Override
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.Metier#getMetierSeasonInfo(fr.ifremer.isisfish.types.Month)
*/
+ @Override
public MetierSeasonInfo getMetierSeasonInfo(Month month) {
Collection<MetierSeasonInfo> all = getMetierSeasonInfo();
MetierSeasonInfo result = null;
- for(MetierSeasonInfo msi : all) {
+ for (MetierSeasonInfo msi : all) {
if (msi.containsMonth(month)) {
result = msi;
break;
@@ -38,7 +68,8 @@
}
return result;
}
-
+
+ @Override
public double getGearParameterValueAsDouble() {
String val = getGearParameterValue();
double result = 0;
@@ -47,8 +78,8 @@
}
return result;
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.MetierAbstract#toString()
*/
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * MetierSeasonInfoImpl.java
- *
- * Created: 23 août 2006 16:25:40
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
@@ -40,27 +28,36 @@
import org.apache.commons.logging.LogFactory;
/**
+ * MetierSeasonInfoImpl.
+ *
+ * Created: 23 août 2006 16:25:40
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class MetierSeasonInfoImpl extends MetierSeasonInfoAbstract {
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory.getLog(MetierSeasonInfoImpl.class);
-
- /* (non-Javadoc)
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4554500494092542926L;
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory
+ .getLog(MetierSeasonInfoImpl.class);
+
+ /*
* @see fr.ifremer.isisfish.entities.MetierSeasonInfo#targetFactor(fr.ifremer.isisfish.entities.PopulationGroup)
*/
+ @Override
public double getTargetFactor(PopulationGroup group) {
// Par defaut on retourne 1 si dans les donnes rien n'est
// precisé (20041108: Stef + dom)
double result = 1;
-
- Species species = group.getPopulation().getSpecies();
- TargetSpecies targetSpecies = this.getSpeciesTargetSpecies(species);
+
+ Species species = group.getPopulation().getSpecies();
+ TargetSpecies targetSpecies = this.getSpeciesTargetSpecies(species);
if (targetSpecies != null) {
result = targetSpecies.getTargetFactor(group);
} else {
@@ -71,6 +68,7 @@
return result;
}
+ @Override
public List<Cell> getCells() {
List<Cell> result = new ArrayList<Cell>();
for (Zone zone : getZone()) {
@@ -78,16 +76,15 @@
}
return result;
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@Override
public String toString() {
- String result = _("isisfish.metierSeasonInfo.toString", this.getMetier(), this.getFirstMonth(), this.getLastMonth());
+ String result = _("isisfish.metierSeasonInfo.toString", this
+ .getMetier(), this.getFirstMonth(), this.getLastMonth());
return result;
- }
+ }
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * PopulationGroupImpl.java
- *
- * Created: 3 janv. 2006 15:26:53
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
@@ -38,60 +26,69 @@
import fr.ifremer.isisfish.types.Month;
-
/**
+ * PopulationGroupImpl.
+ *
+ * Created: 3 janv. 2006 15:26:53
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class PopulationGroupImpl extends PopulationGroupAbstract {
- /**
- * Logger for this class
- */
+ /** Logger for this class. */
private static final Log log = LogFactory.getLog(PopulationGroupImpl.class);
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.PopulationGroup#getAge()
*/
+ @Override
public double getAge() {
double result = 0;
if (getPopulation() != null && getPopulation().getSpecies() != null) {
if (getPopulation().getSpecies().getAgeGroupType()) {
result = super.getAge();
} else {
- result = getPopulation().getAge(getLength(), this) / Month.NUMBER_OF_MONTH;
+ result = getPopulation().getAge(getLength(), this)
+ / Month.NUMBER_OF_MONTH;
}
}
return result;
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.PopulationGroup#getLongueurMin()
*/
+ @Override
public double getLength() {
double result = 0;
if (getPopulation() != null && getPopulation().getSpecies() != null) {
- if(!getPopulation().getSpecies().getAgeGroupType()) {
+ if (!getPopulation().getSpecies().getAgeGroupType()) {
result = (getMinLength() + getMaxLength()) / 2.0;
} else {
- result = getPopulation().getLength(getAge() * Month.NUMBER_OF_MONTH, this);
+ result = getPopulation().getLength(
+ getAge() * Month.NUMBER_OF_MONTH, this);
}
}
return result;
}
+ @Override
public boolean isInLength(double length) {
boolean result = getMinLength() <= length && length <= getMaxLength();
return result;
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.PopulationGroup#getMeanWeight()
*/
+ @Override
public double getMeanWeight() {
double result = 0;
try {
@@ -108,15 +105,17 @@
return result;
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.PopulationGroup#getNaturalDeathRate()
*/
+ @Override
public double getNaturalDeathRate(Zone zone) {
double result = 0;
try {
Equation eq = getPopulation().getNaturalDeathRate();
if (eq != null) {
- result = eq.evaluate("pop", this.getPopulation(), "group", this, "zone", zone);
+ result = eq.evaluate("pop", this.getPopulation(), "group",
+ this, "zone", zone);
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -129,9 +128,10 @@
return result;
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.PopulationGroup#getPrice()
*/
+ @Override
public double getPrice() {
double result = 0;
try {
@@ -147,13 +147,12 @@
log.debug("StackTrace", eee);
}
}
- return result;
+ return result;
}
+ @Override
public String toString() {
- return _("isisfish.populationGroup.toString", this.getPopulation(), this.getId());
- }
-
+ return _("isisfish.populationGroup.toString", this.getPopulation(),
+ this.getId());
+ }
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -70,7 +70,7 @@
*/
@Override
public void delete() throws TopiaException {
- // chatellier 20090317 fix hibernate exeception
+ // chatellier 20090317 fix hibernate exception
// object will be resaved ...
// FIXME should be fixed on topia maybe ?
this.getSpecies().getPopulation().remove(this);
@@ -337,8 +337,9 @@
}
/**
- * return Matrix [groups x zones] of Natural death rate
- * @return
+ * Return Matrix [groups x zones] of Natural death rate.
+ *
+ * @return a matrix
*/
@Override
public MatrixND getNaturalDeathRateMatrix() {
@@ -399,7 +400,8 @@
}
/**
- * Compute length of group with age
+ * Compute length of group with age.
+ *
* @param age age of group in month
* @param group group
* @return length of group
@@ -468,8 +470,7 @@
MatrixND mat = super.getCapturability();
// check the validity
if (sizePopulationGroup() == 0 || sizePopulationSeasonInfo() == 0) {
- log
- .warn("Population doesn't have population group or population season info");
+ log.warn("Population doesn't have population group or population season info");
return null;
}
List[] sems = new List[] { getPopulationGroup(),
@@ -485,8 +486,7 @@
// matrix when capturability is null instead check validity and
// create new one and paste the old
} else if (!Arrays.equals(mat.getSemantics(), sems)) {
- log
- .debug("Capturability has changed, create new matrix and copy old: "
+ log.debug("Capturability has changed, create new matrix and copy old: "
+ mat.getSemantics() + " " + sems);
MatrixND newmat = MatrixFactory.getInstance().create(
n_("isisfish.population.capturability"),
@@ -507,8 +507,7 @@
@Override
public MatrixND getMappingZoneReproZoneRecru() {
if (sizeReproductionZone() == 0 || sizeRecruitmentZone() == 0) {
- log
- .warn("Population doesn't have zone reproduction or zone recruitment");
+ log.warn("Population doesn't have zone reproduction or zone recruitment");
return null;
}
MatrixND mat = super.getMappingZoneReproZoneRecru();
@@ -535,11 +534,11 @@
}
/**
- * convertie une matrice N 2D en une matrice N 1D strucutre pour les
- * calcules.
- * N2D[classes, zones] --> N1D[classe1(zone1, zone2, ...), classe2(zone1, zone2, ...)]
+ * Convertie une matrice N 2D en une matrice N 1D strucutre pour les calculer.
+ *
+ * N2D[classes, zones] --> N1D[classe1(zone1, zone2, ...), classe2(zone1, zone2, ...)]
*
- * @see #split2D(MatrixND)
+ * @see #split2D(MatrixND)
*/
public MatrixND N2DToN1D(MatrixND N) {
int maxX = N.getDim(0);
@@ -558,7 +557,7 @@
}
/**
- * a partir d'une matrice N structure selon l'ecriture matricielle
+ * A partir d'une matrice N structure selon l'ecriture matricielle
* en classe puis en zone, construit une matrice 2D en Classe(X)
* et en Zone(Y)
*
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * PopulationSeasonInfoImpl.java
- *
- * Created: 18 mars 2006 15:24:56
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
@@ -54,18 +42,26 @@
import fr.ifremer.isisfish.equation.MigrationEquation;
import fr.ifremer.isisfish.types.Month;
-
/**
+ * PopulationSeasonInfoImpl.java
+ *
+ * Created: 18 mars 2006 15:24:56
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class PopulationSeasonInfoImpl extends PopulationSeasonInfoAbstract {
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1375563617129149755L;
+
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(PopulationSeasonInfoImpl.class);
+ private static Log log = LogFactory.getLog(PopulationSeasonInfoImpl.class);
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getReproductionDistribution()
*/
@Override
@@ -76,22 +72,21 @@
if (result != null) {
oldMonths = result.getSemantics(0);
}
-
+
List<Month> months = getMonths();
-
- if ( ! months.equals(oldMonths)) {
- MatrixND tmp =
- MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.distributionSpawing"),
- new List[]{months},
- new String[]{_("isisfish.populationSeasonInfo.months")});
+
+ if (!months.equals(oldMonths)) {
+ MatrixND tmp = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.distributionSpawing"),
+ new List[] { months },
+ new String[] { _("isisfish.populationSeasonInfo.months") });
tmp.pasteSemantics(result);
result = tmp;
}
-
+
return result;
}
-
+
/**
* overload to return matrix if no matrix available. The matrix returned
* by this method can't be used directly because it conatins only the
@@ -108,17 +103,27 @@
if (getPopulation() != null) {
List groups = getPopulation().getPopulationGroup();
List zones = getPopulation().getPopulationZone();
- List [] sems = new List[]{ groups, zones, zones };
-
+ List[] sems = new List[] { groups, zones, zones };
+
if (mat == null) {
- mat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.migration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure"), _("isisfish.populationSeasonInfo.arrival")});
+ mat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.migration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure"),
+ _("isisfish.populationSeasonInfo.arrival") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)){
- MatrixND newmat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.migration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure"), _("isisfish.populationSeasonInfo.arrival")});
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.migration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure"),
+ _("isisfish.populationSeasonInfo.arrival") });
newmat.pasteSemantics(mat);
mat = newmat;
// perhaps call setCapturability, but if possible wait the user
@@ -127,7 +132,8 @@
}
return mat;
}
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getEmigrationMatrix()
*/
@Override
@@ -137,17 +143,25 @@
if (getPopulation() != null) {
List groups = getPopulation().getPopulationGroup();
List zones = getPopulation().getPopulationZone();
- List [] sems = new List[]{ groups, zones };
-
+ List[] sems = new List[] { groups, zones };
+
if (mat == null) {
- mat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.emigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure")});
+ mat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.emigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)){
- MatrixND newmat = MatrixFactory.getInstance().create(n_("isisfish.populationSeasonInfo.emigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure")});
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ n_("isisfish.populationSeasonInfo.emigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure") });
newmat.pasteSemantics(mat);
mat = newmat;
// perhaps call setCapturability, but if possible wait the user
@@ -156,7 +170,8 @@
}
return mat;
}
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getImmigrationMatrix()
*/
@Override
@@ -166,17 +181,25 @@
if (getPopulation() != null) {
List groups = getPopulation().getPopulationGroup();
List zones = getPopulation().getPopulationZone();
- List [] sems = new List[]{ groups, zones };
-
+ List[] sems = new List[] { groups, zones };
+
if (mat == null) {
- mat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.immigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.arrival")});
+ mat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.immigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.arrival") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)){
- MatrixND newmat = MatrixFactory.getInstance().create(n_("isisfish.populationSeasonInfo.immigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.arrival")});
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ n_("isisfish.populationSeasonInfo.immigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.arrival") });
newmat.pasteSemantics(mat);
mat = newmat;
// perhaps call setCapturability, but if possible wait the user
@@ -185,8 +208,8 @@
}
return mat;
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getCapturability(fr.ifremer.isisfish.entities.PopulationGroup)
*/
public double getCapturability(PopulationGroup group) {
@@ -197,116 +220,125 @@
}
return result;
}
-
+
/**
- * Create not initialized no spacialized change group matrix
+ * Create not initialized no spacialized change group matrix.
+ *
* @return
*/
public MatrixND createNoSpacializedChangeGroupMatrix() {
Population pop = getPopulation();
-
+
List<PopulationGroup> groups = pop.getPopulationGroup();
-
- MatrixND result = MatrixFactory.getInstance().create(new List[]{groups, groups});
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[] { groups, groups });
return result;
}
-
+
/**
- * Converte spacialized matrix to no spacialized matrix
+ * Convert spacialized matrix to non spacialized matrix.
+ *
* @param mat spacialized matrix
- * @return spacialized matrix
+ * @return non spacialized matrix
*/
public MatrixND unspacializeLengthChangeMatrix(MatrixND mat) {
Population pop = getPopulation();
-
+
int nbsecteurs = pop.sizePopulationZone();
int nbclasses = pop.sizePopulationGroup();
-
+
MatrixND smallmat = createNoSpacializedChangeGroupMatrix();
- for(int i=0; i<nbclasses; i++){
- for(int j=0; j<nbclasses; j++){
- double val = mat.getValue(i*nbsecteurs, j*nbsecteurs);
- smallmat.setValue(i,j, val);
+ for (int i = 0; i < nbclasses; i++) {
+ for (int j = 0; j < nbclasses; j++) {
+ double val = mat.getValue(i * nbsecteurs, j * nbsecteurs);
+ smallmat.setValue(i, j, val);
}
}
return smallmat;
}
/**
- * Create not initialized spacialized change group matrix
+ * Create not initialized spacialized change group matrix.
+ *
* @return
*/
protected MatrixND createSpacializedChangeGroupMatrix() {
Population pop = getPopulation();
-
+
List<Zone> zones = pop.getPopulationZone();
List<PopulationGroup> groups = pop.getPopulationGroup();
-
+
ArrayList<String> semantique = new ArrayList<String>();
-
+
for (PopulationGroup group : groups) {
for (Zone zone : zones) {
semantique.add(group + "/" + zone);
}
}
-
- MatrixND result = MatrixFactory.getInstance().create(new List[]{semantique, semantique});
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[] { semantique, semantique });
return result;
}
-
+
/**
- * Converte no spacialized matrix to spacialized matrix
+ * Convert no spacialized matrix to spacialized matrix.
+ *
* @param mat no spacialized matrix
* @return spacialized matrix
*/
public MatrixND spacializeLengthChangeMatrix(MatrixND mat) {
Population pop = getPopulation();
-
+
int nbsecteurs = pop.sizePopulationZone();
int nbclasses = pop.sizePopulationGroup();
-
+
MatrixND bigmat = createSpacializedChangeGroupMatrix();
- for(int i=0; i<nbclasses; i++){
- for(int j=0; j<nbclasses; j++){
- MatrixND matId = MatrixFactory.getInstance().matrixId(nbsecteurs);
- matId.mults(mat.getValue(i,j));
- bigmat.paste(new int[]{i*nbsecteurs, j*nbsecteurs}, matId);
+ for (int i = 0; i < nbclasses; i++) {
+ for (int j = 0; j < nbclasses; j++) {
+ MatrixND matId = MatrixFactory.getInstance().matrixId(
+ nbsecteurs);
+ matId.mults(mat.getValue(i, j));
+ bigmat.paste(new int[] { i * nbsecteurs, j * nbsecteurs },
+ matId);
}
}
return bigmat;
}
/**
- * Create default non spacialized matrix group changement
+ * Create default non spacialized matrix group changement.
+ *
*/
public MatrixND computeLengthChangeMatrix() {
-
+
int NB_DISCRETISATION = 10;
- Population pop = getPopulation();
+ Population pop = getPopulation();
List<PopulationGroup> groups = pop.getPopulationGroup();
-
+
MatrixND result = createNoSpacializedChangeGroupMatrix();
- for (int i=0; i<groups.size(); i++) {
+ for (int i = 0; i < groups.size(); i++) {
PopulationGroup group = groups.get(i);
double min = group.getMinLength();
double max = group.getMaxLength();
// creation de la matrice de longueurs pour la classe
- double step = (max-min)/NB_DISCRETISATION;
- double [] length = new double[NB_DISCRETISATION];
+ double step = (max - min) / NB_DISCRETISATION;
+ double[] length = new double[NB_DISCRETISATION];
length[0] = min;
- for(int l=1; l<NB_DISCRETISATION; l++){
- length[l] = length[l-1] + step;
+ for (int l = 1; l < NB_DISCRETISATION; l++) {
+ length[l] = length[l - 1] + step;
}
// calcul des nouvelles longueurs pour la classe
- for(int l=0; l<NB_DISCRETISATION; l++){
+ for (int l = 0; l < NB_DISCRETISATION; l++) {
double age = pop.getAge(length[l], group);
length[l] = pop.getLength(age + 1, group); // + 1 mois
}
@@ -314,13 +346,16 @@
// modification de la matrice de changement d'age en fonction
// de la vitesse croissance de la classe.
- for(int l=0; l<NB_DISCRETISATION; l++){
+ for (int l = 0; l < NB_DISCRETISATION; l++) {
int c = 0;
- while(c<groups.size() && ! groups.get(c).isInLength(length[l])){
+ while (c < groups.size()
+ && !groups.get(c).isInLength(length[l])) {
c++;
}
- if(c >= groups.size()){
- log.warn(_("isisfish.error.acceptable.population") + " (group=" + group +" new length: " + length[l] + ")");
+ if (c >= groups.size()) {
+ log.warn(_("isisfish.error.acceptable.population")
+ + " (group=" + group + " new length: " + length[l]
+ + ")");
// pas retrouver une classe pour cette longueur, on le laisse dans la meme classe.
result.setValue(i, i, result.getValue(i, i) + 1);
} else {
@@ -341,51 +376,52 @@
*/
public MatrixND getGroupChangeMatrix(Month month) {
Population pop = getPopulation();
-
+
if (log.isDebugEnabled()) {
- log.debug("pop: " + pop + " AgeGroup: " + pop.getSpecies().getAgeGroupType() + " groupChange: " + getGroupChange() + " month: " + month + " firstMonth: " + getFirstMonth());
+ log.debug("pop: " + pop + " AgeGroup: "
+ + pop.getSpecies().getAgeGroupType() + " groupChange: "
+ + getGroupChange() + " month: " + month + " firstMonth: "
+ + getFirstMonth());
}
-
+
// si en longueur
- if (! pop.getSpecies().getAgeGroupType()){
- if(getSimpleLengthChangeMatrix()){
+ if (!pop.getSpecies().getAgeGroupType()) {
+ if (getSimpleLengthChangeMatrix()) {
return spacializeLengthChangeMatrix(getLengthChangeMatrix());
- }else{
+ } else {
return getLengthChangeMatrix();
}
- }else if(getGroupChange() &&
- month.getMonthNumber() == getFirstMonth().getMonthNumber()){
+ } else if (getGroupChange()
+ && month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
// create identity matrix with special 1 for plus group if necessary
int nbrAge = pop.sizePopulationGroup();
int nbrZone = pop.sizePopulationZone();
boolean groupplus = pop.getPlusGroup();
-
+
MatrixND result = createSpacializedChangeGroupMatrix();
- for(MatrixIterator mi=result.iterator(); mi.next();){
- int [] dim = mi.getCoordinates();
+ for (MatrixIterator mi = result.iterator(); mi.next();) {
+ int[] dim = mi.getCoordinates();
int i = dim[0];
int j = dim[1];
- if(
- // un element de la diagonale dans le block choisi
- (i+nbrZone == j)
- || // calcul pour savoir s'il y a le groupe plus
+ if (
+ // un element de la diagonale dans le block choisi
+ (i + nbrZone == j) || // calcul pour savoir s'il y a le groupe plus
(groupplus
// regarde si on est bien dans le dernier block
- && (nbrAge-1 == i/nbrZone)
+ && (nbrAge - 1 == i / nbrZone)
// regarde si on est bien sur la diagonal
- && (i == j))
- ){
+ && (i == j))) {
mi.setValue(1);
}
}
return result;
- }else{
+ } else {
int nbsecteurs = pop.sizePopulationZone();
int nbclasses = pop.sizePopulationGroup();
-
+
int dim = nbsecteurs * nbclasses;
-
+
return MatrixFactory.getInstance().matrixId(dim);
}
}
@@ -394,9 +430,9 @@
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getMigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
*/
public MatrixND getMigrationMatrix(Month month, MatrixND N) {
- if(month.getMonthNumber() == getFirstMonth().getMonthNumber()){
+ if (month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
return getMigrationMatrix(N);
- }else{
+ } else {
MatrixND result = createSpacializedChangeGroupMatrix();
MatrixHelper.convertToId(result);
return result;
@@ -405,14 +441,14 @@
protected MatrixND getMigrationMatrix(MatrixND aN) {
MatrixND mat = null;
- try{
+ try {
Population population = getPopulation();
List<Zone> zones = population.getPopulationZone();
List<PopulationGroup> groups = population.getPopulationGroup();
-
+
int nbSecteur = zones.size();
-
+
mat = createSpacializedChangeGroupMatrix();
MatrixHelper.convertToId(mat);
@@ -422,11 +458,11 @@
Equation eq = getMigrationEquation();
- for (int c=0; c<groups.size(); c++) {
+ for (int c = 0; c < groups.size(); c++) {
PopulationGroup group = groups.get(c);
- for (int d=0; d<zones.size(); d++) {
+ for (int d = 0; d < zones.size(); d++) {
Zone departureZone = zones.get(d);
- for (int a=0; a<zones.size(); a++) {
+ for (int a = 0; a < zones.size(); a++) {
Zone arrivalZone = zones.get(a);
if (departureZone.equals(arrivalZone)) {
// pour zd == za on ne fait pas le calcul
@@ -435,18 +471,16 @@
continue;
}
- double coef = eq.evaluate(
- "N", N,
- "pop", population,
- "group", group,
+ double coef = eq.evaluate("N", N, "pop",
+ population, "group", group,
"departureZone", departureZone,
"arrivalZone", arrivalZone);
- int x = c*nbSecteur+d;
- int y = c*nbSecteur+a;
- double ancienne_val = mat.getValue(x,x) - coef;
- mat.setValue(x,x, ancienne_val);
- if(ancienne_val<0){
+ int x = c * nbSecteur + d;
+ int y = c * nbSecteur + a;
+ double ancienne_val = mat.getValue(x, x) - coef;
+ mat.setValue(x, x, ancienne_val);
+ if (ancienne_val < 0) {
/*#java.util.logging.Logger.getLogger("fr.ifremer.db.InfoSaisonPop.getMatriceMigration").info("Erreur dans la migration, un coef est negatif");#*/
}
mat.setValue(x, y, coef);
@@ -454,47 +488,47 @@
}
}
} else {
-
+
// matrix 3D: Group, departure, arrival
MatrixND mig = getMigrationMatrix();
-
- for (MatrixIterator i=mig.iterator(); i.hasNext();) {
+
+ for (MatrixIterator i = mig.iterator(); i.hasNext();) {
i.next();
double coef = i.getValue();
if (coef != 0) {
- int [] coord = i.getCoordinates();
+ int[] coord = i.getCoordinates();
int posClasse = coord[0];
int posSecteurD = coord[1];
int posSecteurA = coord[2];
- int x = posClasse*nbSecteur+posSecteurD;
- int y = posClasse*nbSecteur+posSecteurA;
+ int x = posClasse * nbSecteur + posSecteurD;
+ int y = posClasse * nbSecteur + posSecteurA;
// toutes les migrations doivent etre precisees.
// Peut-etre faire un teste pour que les migrations ne depassent pas 1
- double ancienne_val = mat.getValue(x,x);
- mat.setValue(x,x, ancienne_val - coef);
- if(ancienne_val<0){
+ double ancienne_val = mat.getValue(x, x);
+ mat.setValue(x, x, ancienne_val - coef);
+ if (ancienne_val < 0) {
/*#log.info("Erreur dans la migration, un coef est negatif");#*/
}
mat.setValue(x, y, coef);
}
}
}
+ } catch (Exception eee) {
+ log.warn("Erreur lors de la creation de la matrice de migration",
+ eee);
}
- catch(Exception eee){
- log.warn("Erreur lors de la creation de la matrice de migration", eee);
- }
return mat;
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getEmigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
*/
public MatrixND getEmigrationMatrix(Month month, MatrixND N) {
- if(month.getMonthNumber() == getFirstMonth().getMonthNumber()){
+ if (month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
return getEmigrationMatrix(N);
- }else{
+ } else {
MatrixND result = createSpacializedChangeGroupMatrix();
return result;
}
@@ -502,14 +536,14 @@
protected MatrixND getEmigrationMatrix(MatrixND aN) {
MatrixND mat = null;
- try{
+ try {
Population population = getPopulation();
List<Zone> zones = population.getPopulationZone();
List<PopulationGroup> groups = population.getPopulationGroup();
-
+
int nbSecteur = zones.size();
-
+
mat = createSpacializedChangeGroupMatrix();
if (getUseEquationMigration()) {
@@ -518,55 +552,51 @@
Equation eq = getEmigrationEquation();
- for (int c=0; c<groups.size(); c++) {
+ for (int c = 0; c < groups.size(); c++) {
PopulationGroup group = groups.get(c);
- for (int d=0; d<zones.size(); d++) {
+ for (int d = 0; d < zones.size(); d++) {
Zone departureZone = zones.get(d);
- double coef = eq.evaluate(
- "N", N,
- "pop", population,
- "group", group,
- "departureZone", departureZone
- );
+ double coef = eq.evaluate("N", N, "pop", population,
+ "group", group, "departureZone", departureZone);
- int x = c*nbSecteur+d;
+ int x = c * nbSecteur + d;
mat.setValue(x, x, coef);
}
}
} else {
-
+
// matrix 3D: Group, departure, arrival
MatrixND mig = getEmigrationMatrix();
-
- for (MatrixIterator i=mig.iterator(); i.hasNext();) {
+
+ for (MatrixIterator i = mig.iterator(); i.hasNext();) {
i.next();
double coef = i.getValue();
if (coef != 0) {
- int [] coord = i.getCoordinates();
+ int[] coord = i.getCoordinates();
int posClasse = coord[0];
int posSecteurD = coord[1];
- int x = posClasse*nbSecteur+posSecteurD;
+ int x = posClasse * nbSecteur + posSecteurD;
mat.setValue(x, x, coef);
}
}
}
+ } catch (Exception eee) {
+ log.warn("Erreur lors de la creation de la matrice d'emigration",
+ eee);
}
- catch(Exception eee){
- log.warn("Erreur lors de la creation de la matrice d'emigration", eee);
- }
return mat;
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getImmigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
*/
public MatrixND getImmigrationMatrix(Month month, MatrixND N) {
- if(month.getMonthNumber() == getFirstMonth().getMonthNumber()){
+ if (month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
return getImmigrationMatrix(N);
- }else{
+ } else {
MatrixND result = createSpacializedChangeGroupMatrix();
return result;
}
@@ -574,77 +604,76 @@
protected MatrixND getImmigrationMatrix(MatrixND aN) {
MatrixND mat = null;
- try{
+ try {
Population population = getPopulation();
List<Zone> zones = population.getPopulationZone();
List<PopulationGroup> groups = population.getPopulationGroup();
-
+
int nbSecteur = zones.size();
-
- mat = MatrixFactory.getInstance().create(new int[]{groups.size() * nbSecteur});
+ mat = MatrixFactory.getInstance().create(
+ new int[] { groups.size() * nbSecteur });
+
if (getUseEquationMigration()) {
// on commence par faire une copie pour ne pas modifier N
MatrixND N = MatrixFactory.getInstance().create(aN);
Equation eq = getImmigrationEquation();
- for (int c=0; c<groups.size(); c++) {
+ for (int c = 0; c < groups.size(); c++) {
PopulationGroup group = groups.get(c);
- for (int a=0; a<zones.size(); a++) {
+ for (int a = 0; a < zones.size(); a++) {
Zone arrivalZone = zones.get(a);
-
- double coef = eq.evaluate(
- "N", N,
- "pop", population,
- "group", group,
- "arrivalZone", arrivalZone);
- int y = c*nbSecteur+a;
+ double coef = eq.evaluate("N", N, "pop", population,
+ "group", group, "arrivalZone", arrivalZone);
+
+ int y = c * nbSecteur + a;
mat.setValue(y, coef);
}
}
} else {
-
+
// matrix 3D: Group, departure, arrival
MatrixND mig = getImmigrationMatrix();
-
- for (MatrixIterator i=mig.iterator(); i.hasNext();) {
+
+ for (MatrixIterator i = mig.iterator(); i.hasNext();) {
i.next();
double coef = i.getValue();
if (coef != 0) {
- int [] coord = i.getCoordinates();
+ int[] coord = i.getCoordinates();
int posClasse = coord[0];
int posSecteurA = coord[1];
- int y = posClasse*nbSecteur+posSecteurA;
+ int y = posClasse * nbSecteur + posSecteurA;
mat.setValue(y, coef);
}
}
}
+ } catch (Exception eee) {
+ log.warn("Erreur lors de la creation de la matrice d'immigration",
+ eee);
}
- catch(Exception eee){
- log.warn("Erreur lors de la creation de la matrice d'immigration", eee);
- }
return mat;
}
-
+
public void setMigrationEquationAsString(String content) {
try {
Equation eq = getMigrationEquation();
-
+
if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
// create equation
- eq = dao.create();
+ eq = dao.create();
eq.setCategory("Migration");
eq.setLanguage(Language.JAVA);
eq.setJavaInterface(MigrationEquation.class);
setMigrationEquation(eq);
}
-
+
if (getPopulation() != null) {
eq.setName(getPopulation().getName() + "(" + toString() + ")");
}
@@ -659,24 +688,26 @@
fireOnPostWrite("content", _oldValue, content);
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.change.equation"), eee);
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
}
}
public void setEmigrationEquationAsString(String content) {
try {
Equation eq = getEmigrationEquation();
-
+
if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
// create equation
- eq = dao.create();
+ eq = dao.create();
eq.setCategory("Emigration");
eq.setLanguage(Language.JAVA);
eq.setJavaInterface(EmigrationEquation.class);
setEmigrationEquation(eq);
}
-
+
if (getPopulation() != null) {
eq.setName(getPopulation().getName() + "(" + toString() + ")");
}
@@ -691,24 +722,26 @@
fireOnPostWrite("content", _oldValue, content);
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.change.equation"), eee);
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
}
}
public void setImmigrationEquationAsString(String content) {
try {
Equation eq = getImmigrationEquation();
-
+
if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
// create equation
- eq = dao.create();
+ eq = dao.create();
eq.setCategory("Immigration");
eq.setLanguage(Language.JAVA);
eq.setJavaInterface(ImmigrationEquation.class);
setImmigrationEquation(eq);
}
-
+
if (getPopulation() != null) {
eq.setName(getPopulation().getName() + "(" + toString() + ")");
}
@@ -723,7 +756,8 @@
fireOnPostWrite("content", _oldValue, content);
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.change.equation"), eee);
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
}
}
@@ -732,44 +766,38 @@
* nombre d'individu creer par la reproduction. Le vecteur est structure
* en zone de reproduction.
*/
- public MatrixND getReproductionMatrix(Month month, MatrixND aN) {
- Population pop = getPopulation();
- List<Zone> zoneRepro = pop.getReproductionZone();
- MatrixND result = MatrixFactory.getInstance().create(new List[]{zoneRepro});
- try{
- // on commence par faire une copie pour ne pas modifier N
- MatrixND N = aN.copy();
+ public MatrixND getReproductionMatrix(Month month, MatrixND aN) {
+ Population pop = getPopulation();
+ List<Zone> zoneRepro = pop.getReproductionZone();
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[] { zoneRepro });
+ try {
+ // on commence par faire une copie pour ne pas modifier N
+ MatrixND N = aN.copy();
- if(getReproduction()){
- //recuperation de l'equation de reproduction
- Equation e = pop.getReproductionEquation();
+ if (getReproduction()) {
+ //recuperation de l'equation de reproduction
+ Equation e = pop.getReproductionEquation();
- //le coeff de repro pour le mois demande
- MatrixND coeff = getReproductionDistribution().copy();
+ //le coeff de repro pour le mois demande
+ MatrixND coeff = getReproductionDistribution().copy();
- // l'equation doit mettre les resultats dans la matrice result
- e.evaluate(
- "N", N,
- "pop", pop,
- "month", month,
- "prepro", coeff.getValue(month),
- "zoneRepro", zoneRepro,
- "groups", N.getSemantics(0),
- "zones", N.getSemantics(1),
- "result", result
- );
- }
- }catch(Exception eee){
- log.fatal("Error in matrix reproduction creation", eee);
- }
- return result;
+ // l'equation doit mettre les resultats dans la matrice result
+ e.evaluate("N", N, "pop", pop, "month", month, "prepro", coeff
+ .getValue(month), "zoneRepro", zoneRepro, "groups", N
+ .getSemantics(0), "zones", N.getSemantics(1), "result",
+ result);
+ }
+ } catch (Exception eee) {
+ log.fatal("Error in matrix reproduction creation", eee);
+ }
+ return result;
}
public String toString() {
- String result = _("isisfish.populationSeasonInfo.toString", this.getPopulation(), this.getFirstMonth(), this.getLastMonth());
+ String result = _("isisfish.populationSeasonInfo.toString", this
+ .getPopulation(), this.getFirstMonth(), this.getLastMonth());
return result;
- }
+ }
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,28 +1,55 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
/**
* Implantation des operations pour l'entité Port.
+ *
+ * Created: 18 mars 2006 15:24:56
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class PortImpl extends fr.ifremer.isisfish.entities.PortAbstract implements Serializable, fr.ifremer.isisfish.entities.Port {
+public class PortImpl extends PortAbstract {
+ /** serialVersionUID.*/
private static final long serialVersionUID = 1L;
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * SeasonImpl.java
- *
- * Created: 3 janv. 2006 18:28:19
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import java.util.ArrayList;
@@ -37,15 +25,20 @@
import fr.ifremer.isisfish.types.Month;
import static org.codelutin.i18n.I18n._;
-
-/**
+/***
+ * SeasonImpl.
+ *
+ * Created: 3 janv. 2006 18:28:19
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class SeasonImpl extends SeasonAbstract {
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
@@ -76,11 +69,12 @@
*/
public void setMonths(List<Month> listMonth) {
if (listMonth == null || listMonth.size() == 0) {
- throw new IllegalArgumentException("listMonth must contains one month or more");
+ throw new IllegalArgumentException(
+ "listMonth must contains one month or more");
}
Month first = listMonth.get(0);
- Month last = listMonth.get(listMonth.size()-1);
-
+ Month last = listMonth.get(listMonth.size() - 1);
+
setFirstMonth(first);
setLastMonth(last);
}
@@ -90,7 +84,7 @@
*/
public boolean containsMonth(Month month) {
boolean result = month.equals(getLastMonth()); // check first last month, because loop don't do that
-
+
Month m = getFirstMonth();
while (result == false && m.equals(getLastMonth()) == false) {
result = m.equals(month);
@@ -104,10 +98,9 @@
*/
@Override
public String toString() {
- String result = _("isisfish.season.toString", this.getFirstMonth(), this.getLastMonth());
+ String result = _("isisfish.season.toString", this.getFirstMonth(),
+ this.getLastMonth());
return result;
- }
-
-}
+ }
-
+}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * SelectivityImpl.java
- *
- * Created: 20 janv. 2006 03:29:14
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import org.codelutin.topia.TopiaException;
@@ -38,30 +26,37 @@
import fr.ifremer.isisfish.equation.Language;
import fr.ifremer.isisfish.equation.SelectivityEquation;
-
/**
+ * SelectivityImpl.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
+public class SelectivityImpl extends SelectivityAbstract {
-public class SelectivityImpl extends SelectivityAbstract implements Selectivity {
-
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.Selectivity#getCoefficient(double, double, fr.ifremer.isisfish.entities.Metier)
*/
- public double getCoefficient(Population pop, PopulationGroup group, Metier metier) {
+ public double getCoefficient(Population pop, PopulationGroup group,
+ Metier metier) {
Equation eq = getEquation();
// poussin 20060823: modification par rapport a la version 2, on ne passe
// plus age et length mais pop et group sur lequel on pourra recuperer
// age et length. Ca evite de calculer age et length si on ne les utilise
// pas dans l'equation
- double result = eq.evaluate("pop", pop, "group", group, "metier", metier);
+ double result = eq.evaluate("pop", pop, "group", group, "metier",
+ metier);
return result;
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.SelectivityAbstract#getEquation()
*/
@@ -70,7 +65,8 @@
if (super.getEquation() == null) {
Equation eq;
try {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
eq = dao.create();
eq.setCategory("Selectivity");
eq.setLanguage(Language.JAVA);
@@ -83,7 +79,7 @@
}
return super.getEquation();
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.SelectivityAbstract#setGear(fr.ifremer.isisfish.entities.Gear)
*/
@@ -92,7 +88,7 @@
super.setGear(value);
setEquationName(getEquation());
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.SelectivityAbstract#setPopulation(fr.ifremer.isisfish.entities.Population)
*/
@@ -101,14 +97,14 @@
super.setPopulation(value);
setEquationName(getEquation());
}
-
+
protected void setEquationName(Equation eq) {
if (getGear() != null && getPopulation() != null) {
eq.setName(getGear().getName() + " - " + getPopulation().getName()
- + "(" + getPopulation().getSpecies().getName() + ")");
+ + "(" + getPopulation().getSpecies().getName() + ")");
}
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@@ -119,5 +115,3 @@
}
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
@@ -2,5 +21,7 @@
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaException;
+
import fr.ifremer.isisfish.IsisFishDAOHelper;
-import java.io.Serializable;
-
import fr.ifremer.isisfish.IsisFishRuntimeException;
@@ -11,25 +32,30 @@
import fr.ifremer.isisfish.equation.Language;
import fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation;
import fr.ifremer.isisfish.types.Date;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaException;
/**
* Implantation des operations pour l'entité SetOfVessels.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class SetOfVesselsImpl extends fr.ifremer.isisfish.entities.SetOfVesselsAbstract implements Serializable, fr.ifremer.isisfish.entities.SetOfVessels {
+public class SetOfVesselsImpl extends SetOfVesselsAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
- /**
- * Logger for this class
- */
+ /** Logger for this class. */
private static final Log log = LogFactory.getLog(SetOfVesselsImpl.class);
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
@@ -37,8 +63,9 @@
}
/**
- * override to change name of equation
- * @see fr.ifremer.isisfish.entities.SetOfVesselsAbstract#setName(java.lang.String)
+ * Override to change name of equation.
+ *
+ * @see SetOfVesselsAbstract#setName(java.lang.String)
*/
@Override
public void setName(String value) {
@@ -49,21 +76,16 @@
}
}
- /**
- * Compute or return inactivity days
- * @param length length of group
- * @param group group
- * @return age in month
- */
@Override
- public double getTechnicalEfficiency(Date date, Metier metier) {
+ public double getTechnicalEfficiency(Date date, Metier metier) {
double result = 1;
try {
Gear gear = metier.getGear();
Equation eq = getTechnicalEfficiencyEquation();
if (eq != null) {
- result = eq.evaluate("date", date, "metier", metier, "gear", gear);
+ result = eq.evaluate("date", date, "metier", metier, "gear",
+ gear);
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
@@ -75,21 +97,22 @@
}
return result;
}
-
+
public void setEquationTechnicalEfficiency(String content) {
try {
Equation eq = getTechnicalEfficiencyEquation();
-
+
if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
// create Growth equation
- eq = dao.create();
+ eq = dao.create();
eq.setCategory("TechnicalEfficiency");
eq.setJavaInterface(SoVTechnicalEfficiencyEquation.class);
eq.setLanguage(Language.JAVA);
setTechnicalEfficiencyEquation(eq);
}
-
+
eq.setName(getName());
// Fire
@@ -98,15 +121,16 @@
eq.setContent(content);
eq.update();
-
+
fireOnPostWrite("content", _oldValue, content);
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.change.equation"), eee);
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"),
+ eee);
}
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,28 +1,55 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
/**
* Implantation des operations pour l'entité Species.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class SpeciesImpl extends fr.ifremer.isisfish.entities.SpeciesAbstract implements Serializable, fr.ifremer.isisfish.entities.Species {
+public class SpeciesImpl extends SpeciesAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
@@ -2,3 +21,2 @@
-import java.io.Serializable;
import java.util.ArrayList;
@@ -20,26 +38,37 @@
/**
* Implantation des operations pour l'entité Strategy.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class StrategyImpl extends fr.ifremer.isisfish.entities.StrategyAbstract implements Serializable, fr.ifremer.isisfish.entities.Strategy {
+public class StrategyImpl extends StrategyAbstract {
- /** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(StrategyImpl.class);
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(StrategyImpl.class);
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
-
+
/**
- * override to change name of equation
- * @see fr.ifremer.isisfish.entities.StrategyAbstract#setName(java.lang.String)
+ * Override to change name of equation.
+ *
+ * @see StrategyAbstract#setName(java.lang.String)
*/
@Override
public void setName(String value) {
@@ -50,7 +79,7 @@
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.StrategyAbstract#getStrategyMonthInfo()
*/
@Override
@@ -59,14 +88,17 @@
List<StrategyMonthInfo> result = super.getStrategyMonthInfo();
if (result == null) { // Faire le test suivant pose de gros probleme, car il essai de faire un getStrategyMonthInfo et donc ca boucle || result.size() != Month.NUMBER_OF_MONTH) {
if (result != null) {
- log.warn(_("isisfish.error.strategy.order", getName(), result.size()));
+ log.warn(_("isisfish.error.strategy.order", getName(),
+ result.size()));
clearStrategyMonthInfo();
} else {
- result = new ArrayList<StrategyMonthInfo>(Month.NUMBER_OF_MONTH);
+ result = new ArrayList<StrategyMonthInfo>(
+ Month.NUMBER_OF_MONTH);
setStrategyMonthInfo(result);
}
for (Month month : Month.MONTH) {
- StrategyMonthInfoDAO dao = IsisFishDAOHelper.getStrategyMonthInfoDAO(getTopiaContext());
+ StrategyMonthInfoDAO dao = IsisFishDAOHelper
+ .getStrategyMonthInfoDAO(getTopiaContext());
StrategyMonthInfo smi = dao.create();
smi.setMonth(month);
smi.setStrategy(this);
@@ -78,11 +110,12 @@
}
return result;
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException("Can't create StrategyMonthInfo", eee);
+ throw new IsisFishRuntimeException(
+ "Can't create StrategyMonthInfo", eee);
}
}
-
- /* (non-Javadoc)
+
+ /*
* @see fr.ifremer.isisfish.entities.Strategy#getStrategyMonthInfo(fr.ifremer.isisfish.types.Month)
*/
public StrategyMonthInfo getStrategyMonthInfo(Month month) {
@@ -91,7 +124,8 @@
if (!month.equals(result.getMonth())) {
// normalement les StrategyMonthInfo sont dans l'ordre mais
// pour etre sur que ca fonctionne on fait un petit test
- log.warn("StrategyMonthInfo not in month order, i take time to find good StrategyMonthInfo");
+ log
+ .warn("StrategyMonthInfo not in month order, i take time to find good StrategyMonthInfo");
result = null;
for (StrategyMonthInfo smi : smis) {
if (month.equals(smi.getMonth())) {
@@ -102,14 +136,14 @@
}
return result;
}
-
+
/**
- * Compute or return inactivity days
- * @param length length of group
- * @param group group
+ * Compute or return inactivity days.
+ *
+ * @param month month
* @return age in month
*/
- public double getInactivityDays(Month month) {
+ public double getInactivityDays(Month month) {
double result = 0;
StrategyMonthInfo info = getStrategyMonthInfo(month);
@@ -130,20 +164,22 @@
}
return result;
}
+
public void setEquationInactivity(String content) {
try {
Equation eq = getInactivityEquation();
-
+
if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
// create Growth equation
- eq = dao.create();
+ eq = dao.create();
eq.setCategory("Inactivity");
eq.setJavaInterface(StrategyInactivityEquation.class);
eq.setLanguage(Language.JAVA);
setInactivityEquation(eq);
}
-
+
eq.setName(getName());
// Fire
@@ -156,11 +192,12 @@
fireOnPostWrite("content", _oldValue, content);
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.change.equation"), eee);
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"),
+ eee);
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.entities.StrategyAbstract#toString()
*/
@Override
@@ -168,5 +205,5 @@
String result = getName();
return result;
}
-
+
} //StrategyImpl
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,22 +17,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * StrategyMonthInfoImpl.java
- *
- * Created: 29 août 06 11:30:27
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
import java.util.ArrayList;
import java.util.Collection;
@@ -47,31 +34,40 @@
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
-
/**
+ * StrategyMonthInfoImpl.
+ *
+ * Created: 29 août 06 11:30:27
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class StrategyMonthInfoImpl extends StrategyMonthInfoAbstract {
- /** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(StrategyMonthInfoImpl.class);
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4266095355294103240L;
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(StrategyMonthInfoImpl.class);
+
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
-
+
public double getProportionMetier(Metier metier) {
double result = 0;
// on prend le super car ca ne sert a rien de mettre a jour,
// se le metier n'y ait pas on renvera 0;
- MatrixND mat = super.getProportionMetier();
+ MatrixND mat = super.getProportionMetier();
if (mat != null) {
int indice = mat.getSemantics(0).indexOf(metier);
if (indice >= 0) {
@@ -81,54 +77,53 @@
return result;
}
- public void setProportionMetier(Metier metier, double value) {
+ public void setProportionMetier(Metier metier, double value) {
MatrixND mat = getProportionMetier();
if (mat != null) {
mat = mat.copy();
mat.setValue(metier, value);
setProportionMetier(mat);
} else {
- log.warn("Can't set proportion of metier, not enough information available");
+ log
+ .warn("Can't set proportion of metier, not enough information available");
}
}
-
+
@Override
public MatrixND getProportionMetier() {
- if (getStrategy() == null
- || getStrategy().getSetOfVessels() == null
+ if (getStrategy() == null || getStrategy().getSetOfVessels() == null
|| getStrategy().getSetOfVessels().getPossibleMetiers() == null) {
return null;
}
-
- Collection<EffortDescription> efforts = getStrategy().getSetOfVessels().getPossibleMetiers();
-
+
+ Collection<EffortDescription> efforts = getStrategy().getSetOfVessels()
+ .getPossibleMetiers();
+
List<Metier> metiers = new ArrayList<Metier>(efforts.size());
for (EffortDescription effort : efforts) {
metiers.add(effort.getPossibleMetiers());
}
-
+
if (metiers.size() <= 0) {
return null;
}
-
+
MatrixND result = super.getProportionMetier();
-
+
if (result == null) {
result = MatrixFactory.getInstance().create(
_("isisfish.strategyMonthInfo.proportion"),
- new List[]{metiers},
- new String[]{_("isisfish.strategyMonthInfo.metier")}
- );
+ new List[] { metiers },
+ new String[] { _("isisfish.strategyMonthInfo.metier") });
} else if (!result.getSemantics(0).equals(metiers)) {
MatrixND tmp = MatrixFactory.getInstance().create(
_("isisfish.strategyMonthInfo.proportion"),
- new List[]{metiers},
- new String[]{_("isisfish.strategyMonthInfo.metier")}
- );
+ new List[] { metiers },
+ new String[] { _("isisfish.strategyMonthInfo.metier") });
tmp.pasteSemantics(result);
result = tmp;
}
-
+
return result;
}
@@ -140,7 +135,7 @@
super.setTripType(value);
computeNumberOfTrips();
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.StrategyMonthInfoAbstract#setMinInactivityDays(int)
*/
@@ -149,29 +144,30 @@
super.setMinInactivityDays(value);
computeNumberOfTrips();
}
-
+
public void computeNumberOfTrips() {
TripType tripType = getTripType();
// remplace un simple getMinInactivityDays(), pour pouvoir utiliser une
// equation si besoin (tout est pret, il ne manque que l'interface
// graphique pour saisir l'equation dans strategie
double inactivity = getStrategy().getInactivityDays(getMonth());
- if(tripType != null && tripType.getTripDuration() != null && inactivity >= 0){
+ if (tripType != null && tripType.getTripDuration() != null
+ && inactivity >= 0) {
int nbDayMonth = getMonth().getNumbersOfDays();
- double result = (nbDayMonth - inactivity) / tripType.getTripDuration().getDay();
+ double result = (nbDayMonth - inactivity)
+ / tripType.getTripDuration().getDay();
setNumberOfTrips(result);
}
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
@Override
public String toString() {
- String result = _("isisfish.strategyMonthInfo.toString", this.getStrategy(), this.getMonth());
+ String result = _("isisfish.strategyMonthInfo.toString", this
+ .getStrategy(), this.getMonth());
return result;
- }
+ }
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * TargetSpeciesImpl.java
- *
- * Created: 23 août 2006 16:38:23
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.entities;
import static org.codelutin.i18n.I18n._;
@@ -42,17 +30,25 @@
import fr.ifremer.isisfish.equation.Language;
import fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation;
-
/**
+ * TargetSpeciesImpl.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public class TargetSpeciesImpl extends TargetSpeciesAbstract {
- /** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(TargetSpeciesImpl.class);
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8028733540961872729L;
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(TargetSpeciesImpl.class);
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#getTargetFactorEquation()
*/
@@ -60,18 +56,20 @@
public Equation getTargetFactorEquation() {
if (super.getTargetFactorEquation() == null) {
try {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
// create equation
- Equation eq = dao.create();
+ Equation eq = dao.create();
eq.setCategory("TargetFactor");
eq.setLanguage(Language.JAVA);
- eq.setJavaInterface(TargetSpeciesTargetFactorEquation.class);
+ eq.setJavaInterface(TargetSpeciesTargetFactorEquation.class);
eq.update();
- setTargetFactorEquation(eq);
+ setTargetFactorEquation(eq);
} catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.create.equation"), eee);
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.create.equation"), eee);
}
-
+
}
return super.getTargetFactorEquation();
}
@@ -80,11 +78,11 @@
* @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#setMetierSeasonInfo(fr.ifremer.isisfish.entities.MetierSeasonInfo)
*/
@Override
- public void setMetierSeasonInfo(MetierSeasonInfo value) {
+ public void setMetierSeasonInfo(MetierSeasonInfo value) {
super.setMetierSeasonInfo(value);
setEquationName(getTargetFactorEquation());
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#setSpecies(fr.ifremer.isisfish.entities.Species)
*/
@@ -93,16 +91,17 @@
super.setSpecies(value);
setEquationName(getTargetFactorEquation());
}
-
+
protected void setEquationName(Equation eq) {
- if (getMetierSeasonInfo() != null && getMetierSeasonInfo().getMetier() != null
+ if (getMetierSeasonInfo() != null
+ && getMetierSeasonInfo().getMetier() != null
&& getSpecies() != null) {
- eq.setName(getMetierSeasonInfo().getMetier().getName()+ "-" +
- getSpecies().getName() + "(" + getMetierSeasonInfo().toString() + ")");
+ eq.setName(getMetierSeasonInfo().getMetier().getName() + "-"
+ + getSpecies().getName() + "("
+ + getMetierSeasonInfo().toString() + ")");
}
}
-
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.TargetSpecies#targetFactor(fr.ifremer.isisfish.entities.PopulationGroup)
*/
@@ -136,5 +135,3 @@
}
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,7 +1,24 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import org.codelutin.topia.TopiaException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
@@ -11,9 +28,18 @@
/**
* Implantation des operations pour l'entité TripType.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class TripTypeImpl extends fr.ifremer.isisfish.entities.TripTypeAbstract implements Serializable, fr.ifremer.isisfish.entities.TripType {
+public class TripTypeImpl extends TripTypeAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
/* (non-Javadoc)
@@ -24,23 +50,25 @@
setMinTimeBetweenTrip(new TimeUnit(0));
setTripDuration(new TimeUnit(0));
}
-
+
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.TripTypeAbstract#toString()
*/
@Override
public String toString() {
- String result = getName() + "(" + getTripDuration() + ":" + getMinTimeBetweenTrip() + ")";
+ String result = getName() + "(" + getTripDuration() + ":"
+ + getMinTimeBetweenTrip() + ")";
return result;
}
-
+
} //TripTypeImpl
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,7 +1,24 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import org.codelutin.topia.TopiaException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
@@ -11,9 +28,18 @@
/**
* Implantation des operations pour l'entité VesselType.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class VesselTypeImpl extends fr.ifremer.isisfish.entities.VesselTypeAbstract implements Serializable, fr.ifremer.isisfish.entities.VesselType {
+public class VesselTypeImpl extends VesselTypeAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
/* (non-Javadoc)
@@ -23,10 +49,11 @@
public void postCreate() throws TopiaException {
setMaxTripDuration(new TimeUnit(0));
}
-
+
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java 2009-04-07 13:14:20 UTC (rev 2080)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -1,27 +1,54 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.entities;
-import java.io.Serializable;
-
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
/**
* Implantation des operations pour l'entité Zone.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class ZoneImpl extends fr.ifremer.isisfish.entities.ZoneAbstract implements Serializable, fr.ifremer.isisfish.entities.Zone {
+public class ZoneImpl extends ZoneAbstract {
+ /** serialVersionUID. */
private static final long serialVersionUID = 1L;
public FisheryRegion getFisheryRegion() {
try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
return result;
} catch (StorageException eee) {
throw new IsisFishRuntimeException(eee);
}
}
-
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/package-info.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/package-info.java 2009-04-07 13:14:40 UTC (rev 2081)
@@ -0,0 +1,5 @@
+/**
+ * Database storage migration.
+ */
+package fr.ifremer.isisfish.entities;
+
1
0
r2080 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/util
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
by chatellier@users.labs.libre-entreprise.org 07 Apr '09
07 Apr '09
Author: chatellier
Date: 2009-04-07 13:14:20 +0000 (Tue, 07 Apr 2009)
New Revision: 2080
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
Log:
Proper test coding (use forkMode=once :()
Remove bad java hack for this
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-07 10:22:14 UTC (rev 2079)
+++ isis-fish/trunk/pom.xml 2009-04-07 13:14:20 UTC (rev 2080)
@@ -362,6 +362,9 @@
<xmlrpc.version>3.1</xmlrpc.version>
<javadoc.version>2.5</javadoc.version>
+ <!-- for compilation test to run -->
+ <maven.test.forkMode>once</maven.test.forkMode>
+
<!--Main class in JAR -->
<maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
@@ -497,7 +500,6 @@
</execution>
</executions>
</plugin>
-
</plugins>
<pluginManagement>
@@ -508,7 +510,7 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
- <classpathPrefix>./lib/</classpathPrefix>
+ <classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
@@ -518,6 +520,24 @@
</build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/javase/6/docs/api/</link>
+ <link>http://lutinutil.labs.libre-entreprise.org/lutinutil/apidocs/</link>
+ <link>http://lutinmatrix.labs.libre-entreprise.org/lutinmatrix/apidocs/</link>
+ <link>http://topia.labs.libre-entreprise.org/topia/topia-persistence/apidocs/</link>
+ </links>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-07 10:22:14 UTC (rev 2079)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-07 13:14:20 UTC (rev 2080)
@@ -216,16 +216,22 @@
}
/**
- * @return
+ * Return full classpath (for compilation or javadoc) as string.
+ * Separated by {@link File.pathSeparator}.
+ *
+ * Add :
+ * <ul>
+ * <li>System.getProperty("java.class.path")
+ * <li>All first jar dependency (META-INF/MANIFEST.MF)
+ * <li>target/classes (if exists : for maven tests)
+ * </ul>
+ * @return classptah as string
*/
private static String getClassPathAsString(List<File> classpath)
throws Exception {
String result = StringUtils.join(classpath.iterator(),
File.pathSeparator)
+ File.pathSeparator + System.getProperty("java.class.path");
- if (log.isDebugEnabled()) {
- log.debug("Result : " + result);
- }
// Ajout des jars
for (Enumeration<?> e = CompileHelper.class.getClassLoader()
@@ -241,10 +247,10 @@
result += File.pathSeparator + jarName;
// FIX to launch isis with java -jar
- URL jarURL = new URL("jar",null,jarName);
+ URL jarURL = new URL("jar", null, jarName);
URL[] urls = Resource.getClassPathURLsFromJarManifest(jarURL);
for (URL url2 : urls) {
- String jarName2 = url2.getFile();
+ String jarName2 = url2.getPath();
if (!result.contains(jarName2)) {
result += File.pathSeparator + jarName2;
}
@@ -253,14 +259,6 @@
}
}
- // FIXME just for test to run in maven
- // In this case, current project in not packaged ad jar
- // and no META-INF/MANIFEST.MF could be found...
- File targetClassesFile = new File("target", "classes");
- if (targetClassesFile.isDirectory()) {
- result += File.pathSeparator + targetClassesFile.getAbsolutePath();
- }
-
if (log.isDebugEnabled()) {
log.debug("CLASSPATH : " + result);
}
1
0