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
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/index..."); } - 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
participants (1)
-
chatellier@users.labs.libre-entreprise.org