Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
April 2009
- 7 participants
- 108 discussions
r2092 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
09 Apr '09
Author: chatellier
Date: 2009-04-09 08:12:20 +0000 (Thu, 09 Apr 2009)
New Revision: 2092
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Trace.java
Log:
Fix / by zero (but displayed results seams to be wrong)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Trace.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Trace.java 2009-04-09 08:11:10 UTC (rev 2091)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Trace.java 2009-04-09 08:12:20 UTC (rev 2092)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ * Copyright (C) 2002-2009 Code Lutin, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -19,7 +19,6 @@
package fr.ifremer.isisfish.util;
-
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Stack;
@@ -31,7 +30,7 @@
* Permet de tracer les appels aux methodes utilisateur ainsi que l'execution
* a ces methodes. La difference entre les deux est lors de l'utilisation du
* cache les appels seront superieur a l'execution car certaine valeur seront
- * reutilisé dans le cache
+ * reutilisé dans le cache.
*
* @author poussin
* @version $Revision$
@@ -165,6 +164,13 @@
result.append("--- " + name + " Statistics ---\n");
for (String e : statistics.keySet()) {
long[] stat = getStatistics(e);
+
+ // fix / by zero
+ // FIXME need to be fixed in aspect !!!
+ if (stat[STAT_COMPUTATION] == 0) {
+ stat[STAT_COMPUTATION] = stat[STAT_CALL];
+ }
+
long meanTime = stat[STAT_TIME_TOTAL] / stat[STAT_COMPUTATION];
call += stat[STAT_CALL];
computation += stat[STAT_COMPUTATION];
1
0
r2091 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
09 Apr '09
Author: chatellier
Date: 2009-04-09 08:11:10 +0000 (Thu, 09 Apr 2009)
New Revision: 2091
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/Cache.java
Log:
add comment to really fix / by zero (but non done yet)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/Cache.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/Cache.java 2009-04-09 07:56:42 UTC (rev 2090)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/Cache.java 2009-04-09 08:11:10 UTC (rev 2091)
@@ -99,6 +99,11 @@
Object key = computeKey(jp);
Object result = cache.get(key);
if (result == null) {
+
+ // FIXME computation increment (/ by 0)
+ //Method method = ((MethodSignature)jp.getSignature()).getMethod();
+ //trace.traceAfterComputation(method);
+
result = realCall(jp);
// addListenerFor(key); // pas necessaire car on a la date et pour une date donnée rien ne peut changer
if (result != null) { // util pour les methodes retournant void, ne fonctionne pas si on met AND !execute(void *(..)) dans l'aspect. En fait fonction seulement si utilisé avec les traces :(
1
0
r2090 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: datastore util
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
09 Apr '09
Author: chatellier
Date: 2009-04-09 07:56:42 +0000 (Thu, 09 Apr 2009)
New Revision: 2090
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
Log:
Begin javadoc fonctionnality (just started)
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 12:43:46 UTC (rev 2089)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2009-04-09 07:56:42 UTC (rev 2090)
@@ -18,15 +18,18 @@
package fr.ifremer.isisfish.datastore;
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.util.CompileHelper;
-import org.apache.commons.lang.ClassUtils;
import static org.codelutin.i18n.I18n._;
import java.io.File;
import java.io.PrintWriter;
+import org.apache.commons.lang.ClassUtils;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.util.CompileHelper;
+import fr.ifremer.isisfish.util.JavadocHelper;
+
/**
* Classes abstraite permettant la gestion des fichiers de code source.
*
@@ -113,7 +116,7 @@
* @return
*/
public int doJavadoc(boolean force, PrintWriter out) {
- int result = 0; //JavadocHelper.javadoc(this, IsisFish.config.getJavadocDirectory(), force, out);
+ int result = JavadocHelper.generateJavadoc(this, IsisFish.config.getJavadocDirectory(), force, out);
return result;
}
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 12:43:46 UTC (rev 2089)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-09 07:56:42 UTC (rev 2090)
@@ -115,7 +115,7 @@
/**
* Compile le fichier source en .class si le source est plus recent que
* le .class
- * @param source le CodeSourceStorage a compiler
+ * @param source le JavaSourceStorage a compiler
* @param destDir le repertoire destination de la compilation
* @param force si vrai alors meme si le fichier destination est plus
* recent la compilation aura lieu
@@ -131,13 +131,14 @@
File.separatorChar)
+ ".class");
if (force || FileUtil.isNewer(src, dst)) {
- return CompileHelper.compile(source.getRoot(), src, destDir, out);
+ return compile(source.getRoot(), src, destDir, out);
}
return 0;
}
/**
- * Methode permettant de compiler un script, une regle ou un export
+ * Methode permettant de compiler un fichier Java.
+ *
* @param rootSrc le répertoire ou se trouve les sources
* @param src Le fichier source a compiler, il doit etre dans un sous
* répertoire de rootSrc en fonction du package
@@ -155,6 +156,21 @@
return result;
}
+ /**
+ * Methode permettant de compiler un ensemble de fichiers Java.
+ *
+ * @param rootSrc le répertoire ou se trouve les sources
+ * @param src Le fichier source a compiler, il doit etre dans un sous
+ * répertoire de rootSrc en fonction du package
+ * @param dest le repertoire destination de la compilation
+ * @param out l'objet sur lequel on ecrit la sortie (erreur) de la
+ * compilation
+ * @return un nombre different de 0 s'il y a une erreur
+ * <li> -1000 si l'exception vient de la recherche du compilateur par
+ * introspection
+ * <li> -10000 si une autre exception
+ * <li> sinon les valeurs retourné par le compilateur java
+ */
public static int compile(File rootSrc, Collection<File> src, File dest,
PrintWriter out) {
int result = -10000;
@@ -172,7 +188,8 @@
}
/**
- * Compile un fichier java
+ * Compile un fichier java.
+ *
* @param src les fichiers java source
* @param dest le repertoire destination
*/
@@ -226,7 +243,7 @@
* </ul>
* @return classptah as string
*/
- private static String getClassPathAsString(List<File> classpath)
+ protected static String getClassPathAsString(List<File> classpath)
throws Exception {
String result = StringUtils.join(classpath.iterator(),
File.pathSeparator)
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java 2009-04-09 07:56:42 UTC (rev 2090)
@@ -0,0 +1,147 @@
+/* *##%
+ * Copyright (C) 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.util;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.FileUtil;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.datastore.JavaSourceStorage;
+
+/**
+ * Helper for javadoc.
+ *
+ * Use "javadoc" executable tools located in JAVA_HOME.
+ *
+ * @author chatellier
+ * @version $Revision: 2087 $
+ *
+ * Last update: $Date: 2009-04-08 12:22:41 +0200 (mer. 08 avril 2009) $
+ * by : $Author: chatellier $
+ *
+ * @see CompileHelper for classpath purpose
+ * @since 3.2.0.4
+ */
+public class JavadocHelper {
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory.getLog(JavadocHelper.class);
+
+ /** Java home. */
+ private static final String JAVA_HOME = System.getProperty("java.home");
+
+
+ public static int generateJavadoc(JavaSourceStorage source, File destDir,
+ boolean force, PrintWriter out) {
+ File src = source.getFile();
+ File dst = new File(destDir, source.getFQN().replace('.', File.separatorChar) + ".html");
+ if (force || FileUtil.isNewer(src, dst)) {
+ return generateJavadoc(source.getRoot(), src, destDir, out);
+ }
+ return 0;
+ }
+
+ /**
+ * Generate single file javadoc.
+ *
+ * @param rootSrc le repertoire de toutes les sources
+ * @param fileSrc le fichier dont on veut la javadoc
+ * @param dest le répertoire de destination de la javadoc
+ * @param out le flux de sortie (peut etre null)
+ * @return le resulat de sortie de l'executable javadoc (0 si ok)
+ */
+ public static int generateJavadoc(File rootSrc, File fileSrc, File dest, PrintWriter out) {
+ int result = generateJavadoc(rootSrc, Collections.singletonList(fileSrc), dest, out);
+ return result;
+ }
+
+ /**
+ * Generate file collection javadoc.
+ *
+ * @param rootSrc le repertoire de toutes les sources
+ * @param filesSrc les fichiers dont on veut la javadoc
+ * @param dest le répertoire de destination de la javadoc
+ * @param out le flux de sortie (peut etre null)
+ * @return le resulat de sortie de l'executable javadoc (0 si ok)
+ */
+ public static int generateJavadoc(File rootSrc, Collection<File> filesSrc, File dest,
+ PrintWriter out) {
+ int result = -1;
+ try {
+ List<File> classpath = new ArrayList<File>();
+ classpath.add(rootSrc.getAbsoluteFile());
+ result = generateJavadoc(classpath, filesSrc, dest, out);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Javadoc failed", eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Generate file collection javadoc.
+ *
+ * @param classpath common classpath
+ * @param filesSrc les fichiers dont on veut la javadoc
+ * @param dest le répertoire de destination de la javadoc
+ * @param out le flux de sortie (peut etre null)
+ * @return le resulat de sortie de l'executable javadoc (0 si ok)
+ */
+ protected static int generateJavadoc(List<File> classpath, Collection<File> filesSrc,
+ File dest, PrintWriter out) {
+
+ int result = 0;
+
+ // make destination directory
+ dest.mkdirs();
+
+ try {
+ // Options de compilations
+ String classpathAsString = CompileHelper.getClassPathAsString(classpath);
+
+
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get compiler", eee);
+ }
+ }
+ return result;
+ }
+}
1
0
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