Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
Author: chatellier
Date: 2009-04-06 08:39:21 +0000 (Mon, 06 Apr 2009)
New Revision: 2069
Modified:
isis-fish/trunk/pom.xml
Log:
Update h2 to 1.1.110.
Hex data bug is now fixed
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-06 08:32:01 UTC (rev 2068)
+++ isis-fish/trunk/pom.xml 2009-04-06 08:39:21 UTC (rev 2069)
@@ -217,11 +217,10 @@
</dependency>
<!-- Change this dependence if you change database -->
- <!-- 109 bug on hex characters -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
- <version>1.1.108</version>
+ <version>1.1.110</version>
<scope>compile</scope>
</dependency>
1
0
r2068 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 06 Apr '09
by chatellier@users.labs.libre-entreprise.org 06 Apr '09
06 Apr '09
Author: chatellier
Date: 2009-04-06 08:32:01 +0000 (Mon, 06 Apr 2009)
New Revision: 2068
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Fix "september" > "septembre"
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-03 15:20:46 UTC (rev 2067)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-06 08:32:01 UTC (rev 2068)
@@ -629,7 +629,7 @@
isisfish.month.may=mai
isisfish.month.november=novembre
isisfish.month.october=octobre
-isisfish.month.september=september
+isisfish.month.september=septembre
isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
isisfish.params.clearFilter=Reset filtre
isisfish.params.description=Description
1
0
r2067 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/datastore java/fr/ifremer/isisfish/ui/sensitivity java/fr/ifremer/isisfish/ui/simulator java/fr/ifremer/isisfish/ui/widget/renderer resources/i18n
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
03 Apr '09
Author: chatellier
Date: 2009-04-03 15:20:46 +0000 (Fri, 03 Apr 2009)
New Revision: 2067
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Add tooltip on sensitivity UIs
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-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2009-04-03 15:20:46 UTC (rev 2067)
@@ -154,8 +154,14 @@
* @see Docable
*/
public Doc getFieldDoc(String fieldName) {
- throw new IsisFishRuntimeException(_("isisfish.error.not.found.class"
- + "support Docable#getFieldDoc(String) method %1$s", this));
+ Doc result=null;
+ try {
+ Class klazz = getCodeClass();
+ result = DocHelper.getFieldDoc(klazz,fieldName);
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.field",fieldName,this));
+ }
+ return result;
}
/**
@@ -167,11 +173,69 @@
* @see Docable
*/
public String getDescription() {
- throw new IsisFishRuntimeException(_("isisfish.error.not.support.class"
- + "Docable#getDescription() method %1$s", this));
+ String result = null;
+ try {
+ Export export = getNewExportInstance();
+ if (export != null) {
+ result = export.getDescription();
+ }
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.description",this));
+ }
+ return result;
}
/**
+ * @param paramName the name of the param to inspect
+ * @return the doc associated with the param,
+ * (says the field PARAM_PREFIX+fieldName)
+ */
+ public Doc getParamDoc(String paramName) {
+ Doc doc;
+ doc = getFieldDoc(PARAM_PREFIX + paramName);
+ return doc;
+ }
+
+ /**
+ * Permet de recuperer les parametres de l'export.
+ *
+ * @return Une map contenant le nom du parametre et son type
+ * @throws IsisFishException s'il est impossible de retourner une map
+ * convenable
+ */
+ 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 {
+ if (0 == compile(false, null)) {
+ Export export = getNewExportInstance();
+ result = ExportStorage.getParameterNames(export);
+ }
+ } catch (Exception eee) {
+ log.info(_("isisfish.error.compiled.parameter"), eee);
+ }
+ // si on ne reussi pas avec la classe compilé on essai en parsant le
+ // source
+ if (result == null) {
+ try {
+ //String code = getContent();
+ log.fatal("FIXME a faire recherche des parametre dans le source");
+ throw new IsisFishException(_("isisfish.error.source.parameter"));
+ // TODO implanter la recherche des parametres.
+ // Se sont les attributs commencant par 'param_' et ils doivent
+ // etre public non static, non transient.
+ // ex: public Date param_Date.
+ // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
+ // le prefix param.
+ } catch (Exception eee) {
+ throw new IsisFishException(_("isisfish.error.source.parameter"), eee);
+ }
+ }
+ return result;
+ }
+
+ /**
* Recherche par introspection tous les parametres de la classe
* commencant par {@link #PARAM_PREFIX}.
*
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx 2009-04-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx 2009-04-03 15:20:46 UTC (rev 2067)
@@ -32,6 +32,7 @@
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import jaxx.runtime.swing.Item;
+ import fr.ifremer.isisfish.datastore.ExportStorage;
import fr.ifremer.isisfish.datastore.SensitivityStorage;
import fr.ifremer.isisfish.ui.simulator.SimulAction;
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
@@ -42,6 +43,9 @@
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.export.SensitivityExport;
import fr.ifremer.isisfish.IsisFishException;
+ import fr.ifremer.isisfish.ui.simulator.ToolTipListModelFactory;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer;
protected SimulAction getSimulAction() {
return getContextValue(SimulAction.class);
@@ -54,6 +58,8 @@
items.add(new Item(s, s, s, false));
}
fieldSensitivityCalculatorSelect.setItems(items);
+ // add list tooltip renderer
+ //fieldSensitivityCalculatorSelect.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createRuleDescriptionsModel(getSimulAction().getSensitivityNames())));
return fieldSensitivityCalculatorSelect.getModel();
}
@@ -78,7 +84,8 @@
}
protected void setSensitivityCalculatorParamsModel() {
- Map<String, Class<?>> values = getSimulAction().getSensitivityParameterNames((String)fieldSensitivityCalculatorSelect.getSelectedItem());
+ String sensitivityName = (String)fieldSensitivityCalculatorSelect.getSelectedItem();
+ Map<String, Class<?>> values = getSimulAction().getSensitivityParameterNames(sensitivityName);
setSensitivityCalculatorParamsTableModel(values, simulSensitivityCalculatorParam);
simulSensitivityCalculatorParam.getModel().addTableModelListener(new TableModelListener() {
@Override
@@ -89,6 +96,7 @@
getContextValue(SimulAction.class).setSensitivityCalculatorParameterValue(data.getName(), model.getValueAt(row, 1));
}
});
+ simulSensitivityCalculatorParam.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createSensitivityParamsModel(sensitivityName)));
}
protected void setSensitivityCalculatorParamsTableModel(Map<String, Class<?>> values, JTable table) {
@@ -164,6 +172,7 @@
protected DefaultComboBoxModel getExportTableModel() {
java.util.List<String> exportNames = getSimulAction().getSensitivityExportNames();
DefaultComboBoxModel model = new DefaultComboBoxModel(exportNames.toArray());
+ // TODO add tooltip model for this combo
return model;
}
@@ -177,7 +186,8 @@
* Fill export parameters names and values in table.
*/
protected void setExportParams() {
- Map<String, Class<?>> values = getSimulAction().getSensitivityExportParameterNames(getSelectedExport());
+ SensitivityExport export = getSelectedExport();
+ Map<String, Class<?>> values = getSimulAction().getSensitivityExportParameterNames(export);
setSensitivityExportParamsTableModel(values, exportParamsTable);
exportParamsTable.getModel().addTableModelListener(new TableModelListener() {
@@ -189,6 +199,7 @@
getContextValue(SimulAction.class).setSensitivityExportParameterValue(getSelectedExport(), (String)data.getName(), model.getValueAt(row, 1));
}
});
+ exportParamsTable.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createExportParamsModel(ExportStorage.getName(export))));
}
/**
@@ -254,11 +265,14 @@
}
protected void setExportListModel() {
+ java.util.List<SensitivityExport> exports = getSimulAction().getSensitivityExportList();
DefaultListModel model = new DefaultListModel();
- for (SensitivityExport s : getSimulAction().getSensitivityExports()){
+
+ for (SensitivityExport s : exports) {
model.addElement(new GenericCell(s.getExportFilename(), s, s.getClass()));
}
exportList.setModel(model);
+ exportList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createExportDescriptionsModel2(exports, clearExportsButton, exportList)));
}
]]>
</script>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-03 15:20:46 UTC (rev 2067)
@@ -318,8 +318,8 @@
properties.add(propertie);
cells.add(value);
}
- model.addColumn("Name", cells.toArray());
- model.addColumn("Value", properties.toArray());
+ model.addColumn(_("isisfish.common.name"), cells.toArray());
+ model.addColumn(_("isisfish.common.value"), properties.toArray());
}
simulParamsRules.setModel(model);
ParameterColumnEditor cellEditor = new ParameterColumnEditor();
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-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-03 15:20:46 UTC (rev 2067)
@@ -83,6 +83,7 @@
import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
+
/**
* SimulAction.
*
@@ -707,10 +708,6 @@
return result;
}
- public Collection<SensitivityExport> getSensitivityExports() {
- return sensitivityExports.keySet();
- }
-
public List<SensitivityExport> getSensitivityExportList() {
List<SensitivityExport> result = new ArrayList<SensitivityExport>();
for (Map.Entry<SensitivityExport, String> entry : sensitivityExports
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-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-03 15:20:46 UTC (rev 2067)
@@ -38,6 +38,8 @@
import fr.ifremer.isisfish.datastore.ExportStorage;
import fr.ifremer.isisfish.datastore.RuleStorage;
import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SensitivityStorage;
+import fr.ifremer.isisfish.export.Export;
import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.simulator.AnalysePlan;
import fr.ifremer.isisfish.ui.widget.renderer.ToolTipListModel;
@@ -69,8 +71,7 @@
* @param names Result script field names
* @return the model builded
*/
- static public ToolTipListModel createResultFieldsModel(
- List<String> names) {
+ public static ToolTipListModel createResultFieldsModel(List<String> names) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
@@ -116,8 +117,7 @@
* @param names Export names to use
* @return the model builded
*/
- public static ToolTipListModel createExportClassDocsModel(
- List<String> names) {
+ public static ToolTipListModel createExportClassDocsModel(List<String> names) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
@@ -270,7 +270,6 @@
* @param names AnalysePlan names to use
* @return the model builded
*/
- @SuppressWarnings({"unchecked"})
public static ToolTipListModel createAnalysePlanDescriptionsModel(
List<String> names) {
@@ -315,7 +314,6 @@
* @param list list containing the renderer
* @return the model builded
*/
- @SuppressWarnings({"unchecked"})
public static ToolTipListModel createAnalysePlanDescriptionsModel2(
List<AnalysePlan> plans, JButton clearButton, JList list) {
@@ -353,7 +351,7 @@
* the param in the AnalysePlan</li>
* </ul>
*
- * @param analysePlans the selected analyse plan (we only use the first one)
+ * @param name the selected analyze plan name
* @return the model builded
*/
public static ToolTipListModel createAnalysePlanParamsModel(String name) {
@@ -381,4 +379,119 @@
}
return new ToolTipListModel(texts, toolTips);
}
+
+ /**
+ * Build a new {@link ToolTipListModel} for params of a given {link SensitivityCalculator} :
+ * <ul>
+ * <li>text : the name fo the param fo the AnalysePlan</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * the param in the {link SensitivityCalculator}</li>
+ * </ul>
+ *
+ * @param sensitivityName the sensitivity calculator name
+ * @return the model builded
+ */
+ 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);
+ 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));
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ 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>
+ * <li>text : the name fo the param fo the AnalysePlan</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * the param in the AnalysePlan</li>
+ * </ul>
+ *
+ * @param exportName the selected export name
+ * @return the model builded
+ */
+ public static ToolTipListModel createExportParamsModel(String exportName) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+ if (!StringUtils.isEmpty(exportName)) {
+ try {
+ 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));
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ 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} :
+ * <ul>
+ * <li>text : the name of the AnalysePlan</li>
+ * <li>tooltip : the description of the AnalysePlan</li>
+ * </ul>
+ *
+ * @param exports export to use
+ * @param clearButton clear button linked to list
+ * @param list list containing the renderer
+ * @return the model builded
+ */
+ public static ToolTipListModel createExportDescriptionsModel2(
+ List<? extends Export> exports, JButton clearButton, JList list) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!exports.isEmpty()) {
+ try {
+ // we are dealing with Export objects
+ for (Export export : exports) {
+ String name = ExportStorage.getName(export);
+ ExportStorage storage = ExportStorage.getExport(name);
+ String description = storage.getDescription();
+ texts.add(name);
+ toolTips.add(description);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.analyseplan"), eee);
+ }
+ }
+ }
+ ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
+ // should check if there is an already listener ?
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
+ return listModel;
+ }
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-03 15:20:46 UTC (rev 2067)
@@ -19,8 +19,8 @@
package fr.ifremer.isisfish.ui.widget.renderer;
-import java.awt.Color;
import java.awt.Component;
+
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-03 15:20:46 UTC (rev 2067)
@@ -19,7 +19,6 @@
package fr.ifremer.isisfish.ui.widget.renderer;
-import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
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-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-03 15:20:46 UTC (rev 2067)
@@ -309,6 +309,8 @@
isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
isisfish.error.obtain.field=Can't obtain field @Doc for Rule %1$s
isisfish.error.obtain.field.analyseplan=Can't obtain field @Doc for AnalysePlan %1$s
+isisfish.error.obtain.field.export=Can't obtain field @Doc for Export %1$s
+isisfish.error.obtain.field.sensitivitycalculator=Can't obtain field @Doc for Calculator %1$s
isisfish.error.out.memory=Out of memory try with more memory (option -mx)
isisfish.error.overlap.season=Cette saison chevauche une autre saison
isisfish.error.parse.date=Can't parse date %1$s
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-03 12:30:29 UTC (rev 2066)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-03 15:20:46 UTC (rev 2067)
@@ -309,6 +309,8 @@
isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
isisfish.error.obtain.field=Can't obtain field @Doc for Rule %1$s
isisfish.error.obtain.field.analyseplan=Can't obtain field @Doc for AnalysePlan %1$s
+isisfish.error.obtain.field.export=Can't obtain field @Doc for Export %1$s
+isisfish.error.obtain.field.sensitivitycalculator=Can't obtain field @Doc for Calculator %1$s
isisfish.error.out.memory=Out of memory try with more memory (option -mx)
isisfish.error.overlap.season=Cette saison chevauche une autre saison
isisfish.error.parse.date=Can't parse date %1$s
1
0
r2066 - isis-fish/trunk/src/main/resources/templates/script
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
03 Apr '09
Author: chatellier
Date: 2009-04-03 12:30:29 +0000 (Fri, 03 Apr 2009)
New Revision: 2066
Modified:
isis-fish/trunk/src/main/resources/templates/script/script.ftl
isis-fish/trunk/src/main/resources/templates/script/sensitivity.ftl
Log:
Add @Doc on templates
Modified: isis-fish/trunk/src/main/resources/templates/script/script.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/script/script.ftl 2009-04-03 10:24:10 UTC (rev 2065)
+++ isis-fish/trunk/src/main/resources/templates/script/script.ftl 2009-04-03 12:30:29 UTC (rev 2066)
@@ -21,7 +21,7 @@
public class ${name} {
/** to use log facility, just put in your code: log.info("..."); */
- private static Log log = LogFactory.getLog(${name}.class);
+ private static Log log = LogFactory.getLog(${name}.class);
// add your method here
Modified: isis-fish/trunk/src/main/resources/templates/script/sensitivity.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/script/sensitivity.ftl 2009-04-03 10:24:10 UTC (rev 2065)
+++ isis-fish/trunk/src/main/resources/templates/script/sensitivity.ftl 2009-04-03 12:30:29 UTC (rev 2066)
@@ -27,10 +27,11 @@
* Last update: $Date: ${date?date?string.long} $
* by : $Author: ${author} $
*/
+ at Doc("TODO Doc for ${name} SensitivityCalculator")
public class ${name} implements SensitivityCalculator {
/** to use log facility, just put in your code: log.info("..."); */
- private static Log log = LogFactory.getLog(${name}.class);
+ private static Log log = LogFactory.getLog(${name}.class);
/**
* Return calculator description.
1
0
r2065 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: simulator widget/renderer
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
03 Apr '09
Author: chatellier
Date: 2009-04-03 10:24:10 +0000 (Fri, 03 Apr 2009)
New Revision: 2065
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java
Log:
Remove unused code
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-03 10:21:13 UTC (rev 2064)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-03 10:24:10 UTC (rev 2065)
@@ -174,7 +174,7 @@
// that is not filled, when coming in getListCellRendererComponent
// we must also give to model the objects of the model...
// TODO Fix this
- return new ToolTipListModel(texts, toolTips, names);
+ return new ToolTipListModel(texts, toolTips);
}
/**
@@ -278,7 +278,7 @@
List<String> toolTips = new ArrayList<String>();
if (names.isEmpty()) {
- return new ToolTipListModel(texts, toolTips, names);
+ return new ToolTipListModel(texts, toolTips);
}
try {
@@ -299,7 +299,7 @@
// that is not filled, when coming in getListCellRendererComponent
// we must also give to model the objects of the model...
// TODO Fix this
- return new ToolTipListModel(texts, toolTips, names);
+ return new ToolTipListModel(texts, toolTips);
}
/**
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java 2009-04-03 10:21:13 UTC (rev 2064)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java 2009-04-03 10:24:10 UTC (rev 2065)
@@ -32,23 +32,14 @@
public class ToolTipListModel {
/** cache of text */
- protected List objects;
-
- /** cache of text */
protected List<String> texts;
/** cache of tooltip */
protected List<String> tooltips;
public ToolTipListModel(List<String> texts, List<String> tooltips) {
- this(texts, tooltips, null);
- }
-
- public ToolTipListModel(List<String> texts, List<String> tooltips,
- List objects) {
this.texts = texts;
this.tooltips = tooltips;
- this.objects = objects;
}
public String getText(int index) {
@@ -60,12 +51,4 @@
return tooltips == null || index < 0 || tooltips.size() <= index ? null
: tooltips.get(index);
}
-
- public int getIndex(Object value) {
- int result = -1;
- if (objects != null) {
- result = objects.indexOf(value);
- }
- return result;
- }
}
1
0
r2064 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: ui/simulator ui/widget/renderer util
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
by chatellier@users.labs.libre-entreprise.org 03 Apr '09
03 Apr '09
Author: chatellier
Date: 2009-04-03 10:21:13 +0000 (Fri, 03 Apr 2009)
New Revision: 2064
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java
Log:
Fix already in place tooltip
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-02 16:43:31 UTC (rev 2063)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-03 10:21:13 UTC (rev 2064)
@@ -19,6 +19,21 @@
package fr.ifremer.isisfish.ui.simulator;
+import static org.codelutin.i18n.I18n._;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.swing.JButton;
+import javax.swing.JList;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
import fr.ifremer.isisfish.datastore.ExportStorage;
import fr.ifremer.isisfish.datastore.RuleStorage;
@@ -29,23 +44,13 @@
import fr.ifremer.isisfish.util.Doc;
import fr.ifremer.isisfish.util.DocHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import static org.codelutin.i18n.I18n.*;
-
-import javax.swing.JButton;
-import javax.swing.JList;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
/**
* This is a factory of {@link ToolTipListModel} used in simulator ui
*
* @author chemit
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
*/
public class ToolTipListModelFactory {
@@ -219,23 +224,24 @@
* the param in the Rule</li>
* </ul>
*
- * @param rules the selected rules (we only use the first one)
+ * @param ruleName the selected rule name (we only use the first one)
* @return the model builded
*/
- public static ToolTipListModel createRuleParamsModel(String rules) {
- System.out.println("createRuleParamsModel for rules : " + rules);
+ public static ToolTipListModel createRuleParamsModel(String ruleName) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("createRuleParamsModel for rules : " + ruleName);
+ }
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
- if (rules == null || rules.equals("")) {
+ if (StringUtils.isEmpty(ruleName)) {
return new ToolTipListModel(texts, toolTips);
}
- String name = RuleStorage.getName(rules);
try {
-
- RuleStorage storage = RuleStorage.getRule(name);
+ RuleStorage storage = RuleStorage.getRule(ruleName);
Map<String, Class> mapParams = storage.getParameterNames();
if (!mapParams.isEmpty()) {
@@ -247,7 +253,7 @@
}
} catch (Exception eee) {
if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field", name), eee);
+ log.warn(_("isisfish.error.obtain.field", ruleName), eee);
}
}
return new ToolTipListModel(texts, toolTips);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-02 16:43:31 UTC (rev 2063)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-03 10:21:13 UTC (rev 2064)
@@ -1,12 +1,32 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * 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.
+ *##%*/
+
package fr.ifremer.isisfish.ui.widget.renderer;
+import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
/**
- * Simple implementation of {@link ToolTipTableColumnRenderer} renderer
+ * Simple implementation of {@link ListCellRenderer} renderer
* with a cache to store text and tooltip to be displayed.
* <p/>
* <p/>
@@ -14,21 +34,25 @@
* <p/>
* Internal cache will be based on two list (one for text, and one for doc)
* <p/>
- * <b>This is a swixat extends, so just for swixat...</b>
*
* @author chemit
- * @see ToolTipListRenderer
* @see ToolTipListModel
*/
-public class SimpleToolTipComboBoxRenderer extends JLabel implements ListCellRenderer {
+public class SimpleToolTipComboBoxRenderer extends JLabel implements
+ ListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6435245208150840312L;
+
/** the model to use */
protected ToolTipListModel model;
- public SimpleToolTipComboBoxRenderer(ToolTipListModel model){
+ public SimpleToolTipComboBoxRenderer(ToolTipListModel model) {
this.model = model;
}
+
/**
- * set the model to use
+ * Set the model to use.
*
* @param model the mode to use
*/
@@ -36,30 +60,21 @@
this.model = model;
}
- /**
- * @param value model contrete value
- * @param index index of the row
- * @return the text to display (this is a pre-computed value)
- */
- public String getText(Object value, int index) {
- return model == null ? null : model.getText(index);
- }
-
- /**
- * @param value model concret object
- * @param index index of the row
- * @param text the text to be displayed
- * @return the tooltip to display (this is a pre-computed value)
- */
- public String getToolTip(Object value, int index, String text) {
- return model == null ? null : model.getToolTipText(index);
- }
-
@Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
String toolTip = model.getToolTipText(index);
setToolTipText(toolTip);
setText(value.toString());
+ if(isSelected) {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ super.setOpaque(true); // background won't work
+ }
+ else {
+ setBackground(list.getBackground());
+ setForeground(list.getForeground());
+ }
return this;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-02 16:43:31 UTC (rev 2063)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-03 10:21:13 UTC (rev 2064)
@@ -1,13 +1,33 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * 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.
+ *##%*/
+
package fr.ifremer.isisfish.ui.widget.renderer;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import java.awt.Color;
import java.awt.Component;
+
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
/**
- * Simple implementation of {@link ToolTipTableColumnRenderer} renderer
+ * Simple implementation of {@link TableCellRenderer} renderer
* with a cache to store text and tooltip to be displayed.
* <p/>
* <p/>
@@ -15,19 +35,23 @@
* <p/>
* Internal cache will be based on two list (one for text, and one for doc)
* <p/>
- * <b>This is a swixat extends, so just for swixat...</b>
*
* @author chemit
- * @see ToolTipListRenderer
* @see ToolTipListModel
*/
-public class SimpleToolTipTableColumnRenderer extends JLabel implements TableCellRenderer {
- /** the model to use */
+public class SimpleToolTipTableColumnRenderer extends JLabel implements
+ TableCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8016432041908541106L;
+
+ /** The model to use */
protected ToolTipListModel model;
- public SimpleToolTipTableColumnRenderer(ToolTipListModel model){
+ public SimpleToolTipTableColumnRenderer(ToolTipListModel model) {
this.model = model;
}
+
/**
* set the model to use
*
@@ -37,30 +61,22 @@
this.model = model;
}
- /**
- * @param value model contrete value
- * @param index index of the row
- * @return the text to display (this is a pre-computed value)
- */
- public String getText(Object value, int index) {
- return model == null ? null : model.getText(index);
- }
-
- /**
- * @param value model concret object
- * @param index index of the row
- * @param text the text to be displayed
- * @return the tooltip to display (this is a pre-computed value)
- */
- public String getToolTip(Object value, int index, String text) {
- return model == null ? null : model.getToolTipText(index);
- }
-
@Override
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
- String toolTip = model.getToolTipText(column);
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ String toolTip = model.getToolTipText(row);
setToolTipText(toolTip);
setText(value.toString());
+ if(isSelected) {
+ setBackground(table.getSelectionBackground());
+ setForeground(table.getSelectionForeground());
+ super.setOpaque(true); // background won't work
+ }
+ else {
+ setBackground(table.getBackground());
+ setForeground(table.getForeground());
+ }
+
return this;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java 2009-04-02 16:43:31 UTC (rev 2063)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListModel.java 2009-04-03 10:21:13 UTC (rev 2064)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * 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.
+ *##%*/
+
package fr.ifremer.isisfish.ui.widget.renderer;
import java.util.List;
@@ -2,2 +21,10 @@
+/**
+ * ToolTipListModel.
+ *
+ * @author chemit
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ */
public class ToolTipListModel {
@@ -13,29 +40,31 @@
/** cache of tooltip */
protected List<String> tooltips;
-
public ToolTipListModel(List<String> texts, List<String> tooltips) {
- this(texts,tooltips,null);
+ this(texts, tooltips, null);
}
- public ToolTipListModel(List<String> texts, List<String> tooltips, List objects) {
+ public ToolTipListModel(List<String> texts, List<String> tooltips,
+ List objects) {
this.texts = texts;
this.tooltips = tooltips;
- this.objects=objects;
+ this.objects = objects;
}
public String getText(int index) {
- return texts == null || index < 0 || texts.size() <= index ? null : texts.get(index);
+ return texts == null || index < 0 || texts.size() <= index ? null
+ : texts.get(index);
}
public String getToolTipText(int index) {
- return tooltips == null || index < 0 || tooltips.size() <= index ? null : tooltips.get(index);
+ return tooltips == null || index < 0 || tooltips.size() <= index ? null
+ : tooltips.get(index);
}
public int getIndex(Object value) {
int result = -1;
if (objects != null) {
- result = objects.indexOf(value);
+ result = objects.indexOf(value);
}
return result;
}
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-02 16:43:31 UTC (rev 2063)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java 2009-04-03 10:21:13 UTC (rev 2064)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2007 - 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.util;
import static org.codelutin.i18n.I18n._;
@@ -57,8 +76,8 @@
f = klazz == null ? null : klazz.getField(fieldName);
} catch (NoSuchFieldException e) {
// should never appear
- log.warn(_("isisfish.error.not.found.field.class",
- fieldName, klazz));
+ log.warn(_("isisfish.error.not.found.field.class", fieldName,
+ klazz));
//throw new IsisFishRuntimeException(e);
}
return f == null ? null : f.getAnnotation(Doc.class);
@@ -102,10 +121,10 @@
*/
public static String asString(Doc doc) {
StringBuilder sb = new StringBuilder();
- if (doc == null) return "";
- if (!"".equals(doc.value())) {
- sb.append('\'').append(doc.value()).append('\'');
+ if (doc == null) {
+ return "";
}
+ sb.append(doc.value());
boolean more = false;
StringBuilder sb2 = new StringBuilder();
if (!"".equals(doc.author())) {
@@ -120,10 +139,10 @@
sb2.append(", version: ").append(doc.version());
more = true;
}
- if (more)
+ if (more) {
sb.append(" <").append(sb2.toString().substring(2)).append(">");
+ }
return sb.toString();
}
-
}
1
0
r2063 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 02 Apr '09
by chatellier@users.labs.libre-entreprise.org 02 Apr '09
02 Apr '09
Author: chatellier
Date: 2009-04-02 16:43:31 +0000 (Thu, 02 Apr 2009)
New Revision: 2063
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java
Log:
Execute le rechargement des simulations dans un thread pour ne pas empecher l'UI de se charger.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java 2009-04-02 16:42:11 UTC (rev 2062)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java 2009-04-02 16:43:31 UTC (rev 2063)
@@ -141,13 +141,19 @@
*
* @param service SimulationService
*/
- public void reloadConfig(SimulationService service) {
+ public void reloadConfig(final SimulationService service) {
if (monitorFile.canRead()) {
try {
properties.load(new FileInputStream(monitorFile));
- restartSimulationProgression(service);
+ // in a thead
+ // don't temporize UI loading
+ new Thread() {
+ public void run() {
+ restartSimulationProgression(service);
+ }
+ }.start();
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("Can't reload monitor file", e);
1
0
Author: chatellier
Date: 2009-04-02 16:42:11 +0000 (Thu, 02 Apr 2009)
New Revision: 2062
Modified:
isis-fish/trunk/pom.xml
Log:
Make i18n analyse all java file (not only UI.java)
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-02 16:38:10 UTC (rev 2061)
+++ isis-fish/trunk/pom.xml 2009-04-02 16:42:11 UTC (rev 2062)
@@ -456,9 +456,9 @@
<entry>
<basedir>${maven.gen.dir}/java/</basedir>
<specificGoal>parserJava</specificGoal>
- <includes>
+ <!-- <includes>
<param>**\/**UI.java</param>
- </includes>
+ </includes> -->
</entry>
</entries>
</configuration>
1
0
r2061 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 02 Apr '09
by chatellier@users.labs.libre-entreprise.org 02 Apr '09
02 Apr '09
Author: chatellier
Date: 2009-04-02 16:38:10 +0000 (Thu, 02 Apr 2009)
New Revision: 2061
Modified:
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:
Readd deleted entries by strictMode
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-02 09:55:22 UTC (rev 2060)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-02 16:38:10 UTC (rev 2061)
@@ -28,6 +28,7 @@
Cut\ current\ selection\ (Ctrl-x)=
Error\ during\ vcs\ initialisation=
Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
+Export\ selected\ script(s)\ to\ zip\ archive=
Generate\ next\ simulation=
Import\ one\ java\ file\ script\ source=
Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s=
@@ -361,8 +362,20 @@
isisfish.export.directory=Export directory
isisfish.export.saved=Export saved
isisfish.export.title=Results export
+isisfish.factor.coefficient=Coefficient (in %)
+isisfish.factor.comment=Comment
+isisfish.factor.continue=Continue factor
+isisfish.factor.discret=Discret factor
isisfish.factor.factor=Factor
+isisfish.factor.firstValue=First value
isisfish.factor.increment=Cardinality
+isisfish.factor.lastValue=Last value
+isisfish.factor.name=Factor name
+isisfish.factor.operateur=Operator
+isisfish.factor.selectDiscretNumber=Number of factors
+isisfish.factor.title=Factor input
+isisfish.factor.validDiscretNumber=Ok
+isisfish.factor.value=Value
isisfish.filter=Filter
isisfish.filter.apply=Apply filter
isisfish.filter.cancel=Cancel
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-02 09:55:22 UTC (rev 2060)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-02 16:38:10 UTC (rev 2061)
@@ -28,6 +28,7 @@
Cut\ current\ selection\ (Ctrl-x)=
Error\ during\ vcs\ initialisation=
Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
+Export\ selected\ script(s)\ to\ zip\ archive=
Generate\ next\ simulation=
Import\ one\ java\ file\ script\ source=
Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s=
@@ -361,8 +362,20 @@
isisfish.export.directory=Dossier d'export
isisfish.export.saved=Exports des r\u00E9sultats sauvegard\u00E9s
isisfish.export.title=Export des r\u00E9sultats
+isisfish.factor.coefficient=Co\u00E9fficient (en %)
+isisfish.factor.comment=Commentaires
+isisfish.factor.continue=Facteur continu
+isisfish.factor.discret=Facteur discret
isisfish.factor.factor=Facteur
+isisfish.factor.firstValue=Premi\u00E8re valeur
isisfish.factor.increment=Cardinalit\u00E9
+isisfish.factor.lastValue=Derni\u00E8re valeur
+isisfish.factor.name=Nom du facteur
+isisfish.factor.operateur=Op\u00E9rateur
+isisfish.factor.selectDiscretNumber=Nombre de facteurs
+isisfish.factor.title=Saisie d'un facteur
+isisfish.factor.validDiscretNumber=Valider
+isisfish.factor.value=Valeur
isisfish.filter=Filtrer
isisfish.filter.apply=Appliquer le filtre
isisfish.filter.cancel=Annuler
1
0
r2060 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/script java/fr/ifremer/isisfish/ui/sensitivity java/fr/ifremer/isisfish/ui/simulator java/fr/ifremer/isisfish/ui/widget/renderer resources/i18n
by sletellier@users.labs.libre-entreprise.org 02 Apr '09
by sletellier@users.labs.libre-entreprise.org 02 Apr '09
02 Apr '09
Author: sletellier
Date: 2009-04-02 09:55:22 +0000 (Thu, 02 Apr 2009)
New Revision: 2060
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx
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/ToolTipListModelFactory.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.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:
Adding ToolTips
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -150,7 +150,7 @@
<JLabel text="isisfish.effortDescription.fishingOperationDuration" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionFishingOperationDuration" text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}' onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))' enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperationDuration"'/>
+ <JTextField id="fieldEffortDescriptionFishingOperationDuration" text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}' toolTipText="in hour" onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))' enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperationDuration"'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -161,10 +161,10 @@
<JLabel text="isisfish.populationGroup.length" enabled='{isPopGroupNotNull()}'/>
</cell>
<cell fill='both' weightx='0.5'>
- <JTextField id="fieldPopulationGroupMinLength" text='{getPopulationGroup().getMinLength()}' onKeyReleased='getPopulationGroup().setMinLength(Double.parseDouble(fieldPopulationGroupMinLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/>
+ <JTextField id="fieldPopulationGroupMinLength" text='{getPopulationGroup().getMinLength()}' toolTipText="minimum length" onKeyReleased='getPopulationGroup().setMinLength(Double.parseDouble(fieldPopulationGroupMinLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/>
</cell>
<cell fill='both' weightx='0.5'>
- <JTextField id="fieldPopulationGroupMaxLength" text='{getPopulationGroup().getMaxLength()}' onKeyReleased='getPopulationGroup().setMaxLength(Double.parseDouble(fieldPopulationGroupMaxLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/>
+ <JTextField id="fieldPopulationGroupMaxLength" text='{getPopulationGroup().getMaxLength()}' toolTipText="maximum length" onKeyReleased='getPopulationGroup().setMaxLength(Double.parseDouble(fieldPopulationGroupMaxLength.getText()))' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -89,7 +89,7 @@
<JLabel text="isisfish.tripType.duration" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldTripTypeDuration" text='{getBean().getTripDuration().getHour()}' onKeyReleased='getBean().setTripDuration(new TimeUnit(Double.parseDouble(fieldTripTypeDuration.getText()) * 3600))' enabled='{isActif()}' decorator='boxed' _bean='{TripTypeImpl.class}' _method='"TripDuration"'/>
+ <JTextField id="fieldTripTypeDuration" text='{getBean().getTripDuration().getHour()}' toolTipText="in hour" onKeyReleased='getBean().setTripDuration(new TimeUnit(Double.parseDouble(fieldTripTypeDuration.getText()) * 3600))' enabled='{isActif()}' decorator='boxed' _bean='{TripTypeImpl.class}' _method='"TripDuration"'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -126,7 +126,7 @@
<JLabel text="isisfish.vesselType.maxDuration" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeMaxTripDuration" text='{getBean().getMaxTripDuration().getHour()}' enabled='{isActif()}' onKeyReleased='getBean().setMaxTripDuration(new TimeUnit(Double.parseDouble(fieldVesselTypeMaxTripDuration.getText()) * 3600))' decorator='boxed' _bean='{VesselTypeImpl.class}' _method='"MaxTripDuration"'/>
+ <JTextField id="fieldVesselTypeMaxTripDuration" text='{getBean().getMaxTripDuration().getHour()}' toolTipText="in hour" enabled='{isActif()}' onKeyReleased='getBean().setMaxTripDuration(new TimeUnit(Double.parseDouble(fieldVesselTypeMaxTripDuration.getText()) * 3600))' decorator='boxed' _bean='{VesselTypeImpl.class}' _method='"MaxTripDuration"'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -316,15 +316,15 @@
<JPanel layout='{new BorderLayout()}' constraints='BorderLayout.CENTER'>
<JPanel id="buttonBar" layout='{new GridLayout()}' constraints='BorderLayout.NORTH'>
<JComboBox id="ScriptTypeChoice" model='{new DefaultComboBoxModel(getContextValue(ScriptAction.class).getScriptTypesNames())}'/>
- <JButton id="buttonScriptNew" text="isisfish.script.new" onActionPerformed='newScript()'/>
- <JButton id="buttonScriptSave" text="isisfish.script.save" enabled='false' onActionPerformed='saveScript()'/>
- <JButton id="buttonScriptExport" text="isisfish.script.txtExport" enabled='false' onActionPerformed='exportScript()'/>
- <JButton id="buttonScriptCommit" text="isisfish.script.commit" enabled='false' onActionPerformed='commitScript()'/>
- <JButton id="buttonScriptCut" text="isisfish.script.cut" enabled='false' onActionPerformed='cut()'/>
- <JButton id="buttonScriptCopy" text="isisfish.script.copy" enabled='false' onActionPerformed='copy()'/>
- <JButton id="buttonScriptPaste" text="isisfish.script.paste" enabled='false' onActionPerformed='paste()'/>
- <JButton id="buttonScriptCheck" text="isisfish.script.check" enabled='false' onActionPerformed='checkScript()'/>
- <JButton id="buttonScriptEval" text="isisfish.script.evaluate" enabled='false' onActionPerformed='evaluateScript()'/>
+ <JButton id="buttonScriptNew" text="isisfish.script.new" toolTipText='Create a new script' onActionPerformed='newScript()'/>
+ <JButton id="buttonScriptSave" text="isisfish.script.save" toolTipText="Save current script" enabled='false' onActionPerformed='saveScript()'/>
+ <JButton id="buttonScriptExport" text="isisfish.script.txtExport" toolTipText="Export selected script(s) to zip archive" enabled='false' onActionPerformed='exportScript()'/>
+ <JButton id="buttonScriptCommit" text="isisfish.script.commit" toolTipText="Commit script to CVS server" enabled='false' onActionPerformed='commitScript()'/>
+ <JButton id="buttonScriptCut" text="isisfish.script.cut" toolTipText="Cut current selection (Ctrl-x)" enabled='false' onActionPerformed='cut()'/>
+ <JButton id="buttonScriptCopy" text="isisfish.script.copy" toolTipText="Copy current selection (Ctrl-c)" enabled='false' onActionPerformed='copy()'/>
+ <JButton id="buttonScriptPaste" text="isisfish.script.paste" toolTipText="Paste current selection (Ctrl-v)" enabled='false' onActionPerformed='paste()'/>
+ <JButton id="buttonScriptCheck" text="isisfish.script.check" toolTipText="Check syntax of the current script" enabled='false' onActionPerformed='checkScript()'/>
+ <JButton id="buttonScriptEval" text="isisfish.script.evaluate" toolTipText="Try to eval current script (must be have main method)" enabled='false' onActionPerformed='evaluateScript()'/>
</JPanel>
<JSplitPane oneTouchExpandable="true" dividerLocation="250" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'>
<JScrollPane>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -111,10 +111,12 @@
result = listResult;
} else if (result instanceof JCheckBox){
((JCheckBox) result).setSelected((Boolean)callMethod(e, fieldName));
-
+ JCheckBox cOrigin = (JCheckBox)c;
+ ((JCheckBox) result).setText(cOrigin.getText());
} else if (result instanceof JRadioButton){
((JRadioButton) result).setSelected((Boolean)callMethod(e, fieldName));
-
+ JRadioButton cOrigin = (JRadioButton)c;
+ ((JRadioButton) result).setText(cOrigin.getText());
} else if (result instanceof SpeciesStructuredUI){
SpeciesStructuredUI origine = (SpeciesStructuredUI)c;
SpeciesStructuredUI ui = new SpeciesStructuredUI();
@@ -325,10 +327,13 @@
result = listResult;
} else if (result instanceof JCheckBox){
((JCheckBox) result).setSelected((Boolean)value);
+ JCheckBox ch = (JCheckBox)c;
+ ((JCheckBox) result).setText(ch.getText());
} else if (result instanceof JRadioButton){
((JRadioButton) result).setSelected((Boolean)value);
-
+ JRadioButton cOrigin = (JRadioButton) c;
+ ((JRadioButton) result).setText(cOrigin.getText());
} else if (result instanceof SpeciesStructuredUI){
SpeciesStructuredUI origine = (SpeciesStructuredUI)c;
SpeciesStructuredUI ui = new SpeciesStructuredUI();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -105,9 +105,12 @@
if (Factor.class.isInstance(o)){
Factor f = (Factor)o;
FactorWizard wizard = new FactorWizard(this);
- wizard.initExisting(getSimulAction().getFactorComponent(f), f);
- wizard.pack();
- wizard.setVisible(true);
+ JComponent c = getSimulAction().getFactorComponent(f);
+ if (c != null){
+ wizard.initExisting(c, f);
+ wizard.pack();
+ wizard.setVisible(true);
+ }
}
}
}
@@ -146,7 +149,7 @@
DefaultTreeModel model = new DefaultTreeModel(null);
navigation.setModel(model);
}
-protected void setFactorModel(){
+public void setFactorModel(){
TreeNode root = new DefaultMutableTreeNode(getSimulAction().getFactors());
factors.setRootVisible(true);
FactorTreeModel model = new FactorTreeModel(root);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -35,6 +35,7 @@
<script><![CDATA[
import jaxx.runtime.swing.Item;
import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
refresh();
public ExportUI (SimulAction action){
@@ -56,6 +57,7 @@
items.add(new Item(s, s, s, selected));
}
listSimulExportChoose.setItems(items);
+ listSimulExportChoose.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createExportClassDocsModel(values)));
}
protected void exportChanged(){
if (listSimulExportChoose.getSelectedIndex() > -1){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -66,6 +66,8 @@
import fr.ifremer.isisfish.ui.sensitivity.SensitivityUI;
import fr.ifremer.isisfish.entities.FisheryRegionImpl;
import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer;
+import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
import fr.ifremer.isisfish.simulator.launcher.SimulationServiceListener;
SimulationServiceListener simulationListener;
@@ -99,14 +101,16 @@
setListSimulParamsPopulationsItems();
setRulesItems();
fieldSimulParamsRegion.setSelectedItem(getContextValue(SimulAction.class).getSimulationParameter().getRegionName());
- if (getContextValue(SimulAction.class).getSimulationParameter().getUsePreScript()){
- SimulUI simul = getParentContainer(SimulUI.class);
- simul.enablePreSimul();
+ if (!isSensitivity()){
+ if (getContextValue(SimulAction.class).getSimulationParameter().getUsePreScript()){
+ SimulUI simul = getParentContainer(SimulUI.class);
+ simul.enablePreSimul();
+ }
+ if (getContextValue(SimulAction.class).getSimulationParameter().getUseAnalysePlan()){
+ SimulUI simul = getParentContainer(SimulUI.class);
+ simul.enableAnalysePlan();
+ }
}
- if (getContextValue(SimulAction.class).getSimulationParameter().getUseAnalysePlan()){
- SimulUI simul = getParentContainer(SimulUI.class);
- simul.enableAnalysePlan();
- }
}
protected void regionChange(ItemEvent e){
if (e.getStateChange() == ItemEvent.SELECTED) {
@@ -139,6 +143,19 @@
};
}
}
+protected void setFactor(){
+ if (isSensitivity()){
+ getParentContainer(SensitivityUI.class).getSensitivityTabUI().setFactorModel();
+ }
+}
+protected void setExportSens(){
+ if (isSensitivity()){
+ }
+}
+protected void setSensibilities(){
+ if (isSensitivity()){
+ }
+}
public void setSimulationParameter(SimulAction simulAction){
getContextValue(SimulAction.class).setSimulationParameter(simulAction.getSimulationParameter());
}
@@ -153,6 +170,9 @@
getContextValue(SimulAction.class).loadOldSimulation(selected);
refresh();
setFactorRegion();
+ setExportSens();
+ setSensibilities();
+ setFactor();
getParentContainer(WelcomePanelUI.class).setInfoText(_("isisfish.message.old.simulation.loaded"));
}
});
@@ -181,24 +201,18 @@
getParentContainer(WelcomeTabUI.class).selTab(5);
}
protected void enablePreSimul(){
- if (fieldUseSimulPreScripts.isSelected()){
+ getContextValue(SimulAction.class).getSimulationParameter().setUsePreScript(fieldUseSimulPreScripts.isSelected());
+ if (fieldUseSimulPreScripts.isSelected() && !isSensitivity()){
SimulUI simul = getParentContainer(SimulUI.class);
- if (simul != null){
- simul.enablePreSimul();
- }
+ simul.enablePreSimul();
}
}
protected void enableAnalysePlan(){
- if (fieldSimulUseAnalysePlan.isSelected()){
- getContextValue(SimulAction.class).getSimulationParameter().setUseAnalysePlan(true);
+ getContextValue(SimulAction.class).getSimulationParameter().setUseAnalysePlan(fieldSimulUseAnalysePlan.isSelected());
+ if (fieldSimulUseAnalysePlan.isSelected() && !isSensitivity()){
SimulUI simul = getParentContainer(SimulUI.class);
- if (simul != null){
- simul.enableAnalysePlan();
- }
+ simul.enableAnalysePlan();
}
- else{
- getContextValue(SimulAction.class).getSimulationParameter().setUseAnalysePlan(false);
- }
}
protected void enableOnlyExport(){
if (fieldSimulOnlyExport.isSelected()){
@@ -251,6 +265,8 @@
}
protected void setRulesItems(){
listSimulParamsMesuresList.setListData(getContextValue(SimulAction.class).getRules().toArray());
+ listSimulParamsMesuresList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createRuleDescriptionsModel2(getContextValue(SimulAction.class).getSimulationParameter().getRules(),buttonSimulParamsMesuresClear,listSimulParamsMesuresList)));
+
setRulesButton();
}
protected void populationSelected(){
@@ -318,6 +334,7 @@
getContextValue(SimulAction.class).setRuleParameterValue(data.getName(), listSimulParamsMesuresList.getSelectedValue().toString(), model.getValueAt(row, 1));
}
});
+ simulParamsRules.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createRuleParamsModel(listSimulParamsMesuresList.getSelectedValue().toString())));
}
protected void selectFilter(){
try {
@@ -342,6 +359,12 @@
}
return result;
}
+protected ComboBoxModel getParamsMesuresSelectModel(){
+ java.util.List values = getContextValue(SimulAction.class).getRuleNames();
+ DefaultComboBoxModel model = new DefaultComboBoxModel(values.toArray());
+ fieldSimulParamsMesuresSelect.setRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createRuleDescriptionsModel(values)));
+ return model;
+}
protected void resetFilter(){
getContextValue(SimulAction.class).resetOldSimulatorNames();
}
@@ -393,6 +416,7 @@
}
return result;
}
+
]]>
</script>
<row>
@@ -526,7 +550,7 @@
</row>
<row>
<cell fill="horizontal">
- <JComboBox id="fieldSimulParamsMesuresSelect" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getRuleNames().toArray())}'/>
+ <JComboBox id="fieldSimulParamsMesuresSelect" model='{getParamsMesuresSelectModel()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -34,6 +34,7 @@
<script><![CDATA[
import fr.ifremer.isisfish.ui.WelcomePanelUI;
import jaxx.runtime.swing.Item;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
setListSimulExportChooseModel();
public ResultChoiceUI (SimulAction action){
@@ -54,6 +55,7 @@
items.add(new Item(s, s, s, selected));
}
listResultNames.setItems(items);
+ listResultNames.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createResultFieldsModel(values)));
}
protected void saveResultNames(){
if (listResultNames.getSelectedIndex() != -1){
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-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-02 09:55:22 UTC (rev 2060)
@@ -38,6 +38,8 @@
import javax.swing.table.TableModel;
import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
import javax.swing.table.TableColumn;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
import fr.ifremer.isisfish.simulator.AnalysePlan;
import jaxx.runtime.swing.Item;
@@ -48,10 +50,13 @@
}
public void refresh(){
java.util.List<Item> items = new ArrayList<Item>();
- for (AnalysePlan ap : getContextValue(SimulAction.class).getParamAnalysePlans()){
+ java.util.List<AnalysePlan> values = getContextValue(SimulAction.class).getParamAnalysePlans();
+
+ for (AnalysePlan ap : values){
items.add(new Item(ap.toString(), fr.ifremer.isisfish.datastore.AnalysePlanStorage.getName(ap), ap, false));
}
listSimulParamsAnalysePlansList.setItems(items);
+ listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList)));
setSimulParamsAnalysePlans();
}
public void addAnalysePlan(){
@@ -120,6 +125,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())));
}
}
}
@@ -127,11 +133,16 @@
SimulUI simul = getParentContainer(SimulUI.class);
simul.selTab(0);
}
+ protected DefaultComboBoxModel getAnalysePlansSelectModel(){
+ java.util.List values = getContextValue(SimulAction.class).getAnalysePlanNames();
+ fieldSimulParamsAnalysePlansSelect.setRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel(values)));
+ return new DefaultComboBoxModel(values.toArray());
+ }
]]>
</script>
<row>
<cell columns="2" fill="horizontal" weightx="1.0">
- <JComboBox id="fieldSimulParamsAnalysePlansSelect" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getAnalysePlanNames().toArray())}'/>
+ <JComboBox id="fieldSimulParamsAnalysePlansSelect" model='{getAnalysePlansSelectModel()}'/>
</cell>
</row>
<row>
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-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -64,6 +64,7 @@
import fr.ifremer.isisfish.export.Export;
import fr.ifremer.isisfish.export.SensitivityExport;
import fr.ifremer.isisfish.logging.SimulationLoggerUtil;
+import fr.ifremer.isisfish.mexico.MexicoHelper;
import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.simulator.AnalysePlan;
import fr.ifremer.isisfish.simulator.SimulationParameter;
@@ -82,7 +83,6 @@
import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
-
/**
* SimulAction.
*
@@ -280,6 +280,26 @@
// all time reset number after load
param.setAnalysePlanNumber(-1);
regionStorage = param.getRegion();
+
+ // Chargement des sensibilites
+ sensitivityCalculator = param.getSensitivityCalculator();
+
+ // Chargement des exports de sensibilites
+ for (SensitivityExport ex : param.getSensitivityExport()){
+ sensitivityExports.put(ex, ex.getExportFilename());
+ }
+
+ // Chargement des facteurs
+ File f = simulStorage.getMexicoDesignPlan(SimulationStorage.getSimulationDirectory(simulName));
+ if (f != null){
+ log.debug("Import design plan from : " + f.getPath());
+ designPlan = MexicoHelper.getDesignPlanFromXML(f.getPath());
+ factors.clear();
+ for (Factor factor : designPlan.getFactors()){
+ log.debug("Find factor : " + factor.getName());
+ factors.put(factor.getPath() + factor.getName(), factor);
+ }
+ }
} catch (Exception eee) {
log.error("Can't load old Simulation: " + simulName, eee);
showMsgBox(eee);
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-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -145,8 +145,7 @@
* @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>();
@@ -185,8 +184,7 @@
* @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>();
@@ -224,15 +222,16 @@
* @param rules the selected rules (we only use the first one)
* @return the model builded
*/
- public static ToolTipListModel createRuleParamsModel(Collection rules) {
+ public static ToolTipListModel createRuleParamsModel(String rules) {
+ System.out.println("createRuleParamsModel for rules : " + rules);
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
- if (rules.isEmpty()) {
+ if (rules == null || rules.equals("")) {
return new ToolTipListModel(texts, toolTips);
}
- String name = RuleStorage.getName(rules.iterator().next());
+ String name = RuleStorage.getName(rules);
try {
@@ -351,15 +350,11 @@
* @param analysePlans the selected analyse plan (we only use the first one)
* @return the model builded
*/
- public static ToolTipListModel createAnalysePlanParamsModel(
- Collection analysePlans) {
+ public static ToolTipListModel createAnalysePlanParamsModel(String name) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
- if (analysePlans.size() > 0) {
- String name = AnalysePlanStorage.getName(
- analysePlans.iterator().next());
-
+ if (name != null && !name.equals("")) {
try {
AnalysePlanStorage storage =
AnalysePlanStorage.getAnalysePlan(name);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipComboBoxRenderer.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,62 +1,66 @@
-//package fr.ifremer.isisfish.ui.widget.renderer;
-//
-///**
-// * Simple implementation of {@link ToolTipComboBoxRenderer} renderer with a cache
-// * to store text and tooltip to be displayed.
-// * <p/>
-// * <p/>
-// * To set the cache just use the method {@link #setModel(ToolTipListModel)} .
-// * <p/>
-// * Internal cache will be based on two list (one for text, and one for doc)
-// * <p/>
-// * <b>This is a swixat extends, so just for swixat...</b>
-// *
-// * @author chemit
-// * @see ToolTipListRenderer
-// * @see WithToolTipListModel
-// * @see ToolTipComboBoxRenderer
-// */
-//public class SimpleToolTipComboBoxRenderer extends ToolTipComboBoxRenderer {
-//
-// /** the model to use */
-// protected ToolTipListModel model;
-//
-// /**
-// * set the model to use
-// *
-// * @param model the mode to use
-// */
-// public void setModel(ToolTipListModel model) {
-// this.model = model;
-// }
-//
-// /**
-// * @param value model contrete value
-// * @param index index of the row
-// * @return the text to display (this is a pre-computed value)
-// */
-// public String getText(Object value, int index) {
-// // index should contains the row index but for some mysterious reason
-// // we don't have for ComboBox, so must find realIndex by ourself
-// if (index==-1) {
-// index = model.getIndex(value);
-// }
-// return model == null ? null : model.getText(index);
-// }
-//
-// /**
-// * @param value model concret object
-// * @param index index of the row
-// * @param text the text to be displayed
-// * @return the tooltip to display (this is a pre-computed value)
-// */
-// public String getToolTip(Object value, int index, String text) {
-// // index should contains the row index but for some mysterious reason
-// // we don't have for ComboBox, so must find realIndex by ourself
-// if (index==-1) {
-// index = model.getIndex(text);
-// }
-// return model == null ? null : model.getToolTipText(index);
-// }
-//
-//} // SimpleToolTipComboBoxRenderer
\ No newline at end of file
+package fr.ifremer.isisfish.ui.widget.renderer;
+
+import java.awt.Component;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+
+/**
+ * Simple implementation of {@link ToolTipTableColumnRenderer} renderer
+ * with a cache to store text and tooltip to be displayed.
+ * <p/>
+ * <p/>
+ * To set the cache just use the method {@link #setModel(ToolTipListModel)} .
+ * <p/>
+ * Internal cache will be based on two list (one for text, and one for doc)
+ * <p/>
+ * <b>This is a swixat extends, so just for swixat...</b>
+ *
+ * @author chemit
+ * @see ToolTipListRenderer
+ * @see ToolTipListModel
+ */
+public class SimpleToolTipComboBoxRenderer extends JLabel implements ListCellRenderer {
+ /** the model to use */
+ protected ToolTipListModel model;
+
+ public SimpleToolTipComboBoxRenderer(ToolTipListModel model){
+ this.model = model;
+ }
+ /**
+ * set the model to use
+ *
+ * @param model the mode to use
+ */
+ public void setModel(ToolTipListModel model) {
+ this.model = model;
+ }
+
+ /**
+ * @param value model contrete value
+ * @param index index of the row
+ * @return the text to display (this is a pre-computed value)
+ */
+ public String getText(Object value, int index) {
+ return model == null ? null : model.getText(index);
+ }
+
+ /**
+ * @param value model concret object
+ * @param index index of the row
+ * @param text the text to be displayed
+ * @return the tooltip to display (this is a pre-computed value)
+ */
+ public String getToolTip(Object value, int index, String text) {
+ return model == null ? null : model.getToolTipText(index);
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ String toolTip = model.getToolTipText(index);
+ setToolTipText(toolTip);
+ setText(value.toString());
+ return this;
+ }
+
+} // SimpleToolTipTableColumnRenderer
\ No newline at end of file
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipListRenderer.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,50 +0,0 @@
-//package fr.ifremer.isisfish.ui.widget.renderer;
-//
-///**
-// * Simple implementation of {@link ToolTipListRenderer} renderer with a cache
-// * to store text and tooltip to be displayed.
-// * <p/>
-// * <p/>
-// * To set the cache just use the method {@link #setModel(ToolTipListModel)} .
-// * <p/>
-// * Internal cache will be based on two list (one for text, and one for doc)
-// * <p/>
-// * <b>This is a swixat extends, so just for swixat...</b>
-// *
-// * @author chemit
-// * @see ToolTipListRenderer
-// * @see ToolTipListModel
-// */
-//public class SimpleToolTipListRenderer extends ToolTipListRenderer {
-// /** the model to use */
-// protected ToolTipListModel model;
-//
-// /**
-// * set the model to use
-// *
-// * @param model the mode to use
-// */
-// public void setModel(ToolTipListModel model) {
-// this.model = model;
-// }
-//
-// /**
-// * @param value model contrete value
-// * @param index index of the row
-// * @return the text to display (this is a pre-computed value)
-// */
-// public String getText(Object value, int index) {
-// return model == null ? null : model.getText(index);
-// }
-//
-// /**
-// * @param value model concret object
-// * @param index index of the row
-// * @param text the text to be displayed
-// * @return the tooltip to display (this is a pre-computed value)
-// */
-// public String getToolTip(Object value, int index, String text) {
-// return model == null ? null : model.getToolTipText(index);
-// }
-//
-//} // SimpleToolTipListRenderer
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/SimpleToolTipTableColumnRenderer.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,50 +1,67 @@
-//package fr.ifremer.isisfish.ui.widget.renderer;
-//
-///**
-// * Simple implementation of {@link ToolTipTableColumnRenderer} renderer
-// * with a cache to store text and tooltip to be displayed.
-// * <p/>
-// * <p/>
-// * To set the cache just use the method {@link #setModel(ToolTipListModel)} .
-// * <p/>
-// * Internal cache will be based on two list (one for text, and one for doc)
-// * <p/>
-// * <b>This is a swixat extends, so just for swixat...</b>
-// *
-// * @author chemit
-// * @see ToolTipListRenderer
-// * @see ToolTipListModel
-// */
-//public class SimpleToolTipTableColumnRenderer extends ToolTipTableColumnRenderer {
-// /** the model to use */
-// protected ToolTipListModel model;
-//
-// /**
-// * set the model to use
-// *
-// * @param model the mode to use
-// */
-// public void setModel(ToolTipListModel model) {
-// this.model = model;
-// }
-//
-// /**
-// * @param value model contrete value
-// * @param index index of the row
-// * @return the text to display (this is a pre-computed value)
-// */
-// public String getText(Object value, int index) {
-// return model == null ? null : model.getText(index);
-// }
-//
-// /**
-// * @param value model concret object
-// * @param index index of the row
-// * @param text the text to be displayed
-// * @return the tooltip to display (this is a pre-computed value)
-// */
-// public String getToolTip(Object value, int index, String text) {
-// return model == null ? null : model.getToolTipText(index);
-// }
-//
-//} // SimpleToolTipTableColumnRenderer
\ No newline at end of file
+package fr.ifremer.isisfish.ui.widget.renderer;
+
+import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import java.awt.Component;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * Simple implementation of {@link ToolTipTableColumnRenderer} renderer
+ * with a cache to store text and tooltip to be displayed.
+ * <p/>
+ * <p/>
+ * To set the cache just use the method {@link #setModel(ToolTipListModel)} .
+ * <p/>
+ * Internal cache will be based on two list (one for text, and one for doc)
+ * <p/>
+ * <b>This is a swixat extends, so just for swixat...</b>
+ *
+ * @author chemit
+ * @see ToolTipListRenderer
+ * @see ToolTipListModel
+ */
+public class SimpleToolTipTableColumnRenderer extends JLabel implements TableCellRenderer {
+ /** the model to use */
+ protected ToolTipListModel model;
+
+ public SimpleToolTipTableColumnRenderer(ToolTipListModel model){
+ this.model = model;
+ }
+ /**
+ * set the model to use
+ *
+ * @param model the mode to use
+ */
+ public void setModel(ToolTipListModel model) {
+ this.model = model;
+ }
+
+ /**
+ * @param value model contrete value
+ * @param index index of the row
+ * @return the text to display (this is a pre-computed value)
+ */
+ public String getText(Object value, int index) {
+ return model == null ? null : model.getText(index);
+ }
+
+ /**
+ * @param value model concret object
+ * @param index index of the row
+ * @param text the text to be displayed
+ * @return the tooltip to display (this is a pre-computed value)
+ */
+ public String getToolTip(Object value, int index, String text) {
+ return model == null ? null : model.getToolTipText(index);
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+ String toolTip = model.getToolTipText(column);
+ setToolTipText(toolTip);
+ setText(value.toString());
+ return this;
+ }
+
+} // SimpleToolTipTableColumnRenderer
\ No newline at end of file
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipComboBoxRenderer.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,61 +0,0 @@
-//package fr.ifremer.isisfish.ui.widget.renderer;
-//
-////import org.swixat.databinding.JComboBoxRenderer;
-//
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//
-//import javax.swing.JList;
-//import java.awt.Component;
-//
-///**
-// * Class to defined an abstract comboBox renderer capable of dispaying some text
-// * and tooltip using object in model.
-// * <p/>
-// * Just implements {@link #getText(Object,int)} and
-// * {@link #getToolTip(Object,int, String)}
-// * to use it.
-// * <p/>
-// * <b>This is a swixat extends, so just for swixat...</b>
-// *
-// * @author chemit
-// * @see ToolTipListModel
-// * @see WithToolTipListModel
-// */
-//public abstract class ToolTipComboBoxRenderer extends JComboBoxRenderer
-// implements WithToolTipListModel {
-//
-// /** to use log facility, just put in your code: log.info(\"...\"); */
-// static private Log log = LogFactory.getLog(ToolTipComboBoxRenderer.class);
-//
-// @Override
-// public Component getListCellRendererComponent(JList list, Object value,
-// int index, boolean selected,
-// boolean hasFocus) {
-// // log.debug(" enter for [" + index + "] " + value + "(" +
-// if (value == null) {
-// list.setToolTipText(null);
-// return this;
-// }
-//
-// String tip = null;
-// String text = null;
-//
-// try {
-//
-// text = getText(value, index);
-//
-// tip = getToolTip(value, index, text);
-//
-// } catch (Exception e) {
-// log.warn("can't get text or tooltip for " + value);
-// }
-//
-// list.setToolTipText(tip == null || "".equals(tip) ? null : tip);
-//
-// // let default behaviour for rendering with specified text computed
-// return super.getListCellRendererComponent(list, text, index,
-// selected, hasFocus);
-// }
-//
-//} // ToolTipComboBoxRenderer
\ No newline at end of file
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipListRenderer.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,63 +0,0 @@
-//package fr.ifremer.isisfish.ui.widget.renderer;
-//
-//
-//import org.swixat.databinding.JListRenderer;
-//
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//
-//import javax.swing.JList;
-//import java.awt.Component;
-//
-///**
-// * Class to defined an abstract list renderer capable of dispaying some text
-// * and tooltip using object in model.
-// * <p/>
-// * Just implements {@link #getText(Object,int)} and
-// * {@link #getToolTip(Object,int, String)}
-// * to use it.
-// * <p/>
-// * <b>This is a swixat extends, so just for swixat...</b>
-// *
-// * @author chemit
-// * @see ToolTipListModel
-// * @see WithToolTipListModel
-// */
-//public abstract class ToolTipListRenderer extends JListRenderer
-// implements WithToolTipListModel {
-//
-// /** to use log facility, just put in your code: log.info(\"...\"); */
-// static private Log log = LogFactory.getLog(ToolTipListRenderer.class);
-//
-// @Override
-// public Component getListCellRendererComponent(JList list, Object value,
-// int index, boolean selected,
-// boolean hasFocus) {
-// // log.debug(" enter for [" + index + "] " + value + "(" +
-//
-// if (value == null) {
-// list.setToolTipText(null);
-// return this;
-// }
-//
-// String tip = null;
-// String text = null;
-//
-// try {
-//
-// text = getText(value, index);
-//
-// tip = getToolTip(value, index, text);
-//
-// } catch (Exception e) {
-// log.warn("can't get text or tooltip for " + value);
-// }
-//
-// list.setToolTipText(tip == null || "".equals(tip) ? null : tip);
-//
-// // let default behaviour for rendering with specified text computed
-// return super.getListCellRendererComponent(list, text, index,
-// selected, hasFocus);
-// }
-//
-//} //ToolTipListRenderer
\ No newline at end of file
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/ToolTipTableColumnRenderer.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,64 +0,0 @@
-//package fr.ifremer.isisfish.ui.widget.renderer;
-//
-//
-//import org.swixat.databinding.JTableColumnRenderer;
-//
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//
-//import javax.swing.JTable;
-//import java.awt.Component;
-//
-///**
-// * Class to defined an abstract list renderer capable of dispaying some text
-// * and tooltip using object in model.
-// * <p/>
-// * Just implements {@link #getText(Object,int)} and
-// * {@link #getToolTip(Object,int, String)}
-// * to use it.
-// * <p/>
-// * <b>This is a swixat extends, so just for swixat...</b>
-// *
-// * @author chemit
-// * @see ToolTipListModel
-// * @see WithToolTipListModel
-// */
-//public abstract class ToolTipTableColumnRenderer extends JTableColumnRenderer
-// implements WithToolTipListModel {
-//
-// /** to use log facility, just put in your code: log.info(\"...\"); */
-// static private Log log = LogFactory.getLog(ToolTipTableColumnRenderer.class);
-//
-// @Override
-// public Component getTableCellRendererComponent(
-// JTable table, Object value, boolean selected, boolean focus,
-// int row, int col) {
-//
-// if (value == null) {
-// table.setToolTipText(null);
-// return this;
-// }
-//
-// String tip = null;
-// Object realValue = value;
-//
-// // we only treate tooltip on first column which contains libelle
-//
-// if (col == 0) {
-// try {
-// realValue = getText(value, row);
-//
-// tip = getToolTip(value, row, (String) realValue);
-//
-// } catch (Exception e) {
-// log.warn("can't get text or tooltip for " + value);
-// }
-// }
-// table.setToolTipText(tip == null || "".equals(tip) ? null : tip);
-//
-// // let default behaviour for rendering
-// return super.getTableCellRendererComponent(table, realValue, selected,
-// focus, row, col);
-// }
-//
-//} //ToolTipTableColumnRenderer
\ No newline at end of file
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java 2009-04-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/renderer/WithToolTipListModel.java 2009-04-02 09:55:22 UTC (rev 2060)
@@ -1,43 +0,0 @@
-package fr.ifremer.isisfish.ui.widget.renderer;
-
-import javax.swing.ListCellRenderer;
-import javax.swing.table.TableCellRenderer;
-
-/**
- * This is the contract ot be realised by any {@link ListCellRenderer} or {@link TableCellRenderer} which
- * wants to have an automatic text - tooltip renderer.
- * <p/>
- * It used a {@link ToolTipListModel} to store the text and tootltip that
- * renderer will display.
- *
- * @see ToolTipListModel
- * @see ToolTipComboBoxRenderer
- * @see ToolTipListRenderer
- * @see ToolTipTableColumnRenderer
- */
-public interface WithToolTipListModel {
- /**
- * the text to display
- *
- * @param value current value in model
- * @param index row index
- * @return the text to display in cell
- */
- String getText(Object value, int index);
-
- /**
- * the tooltip to display
- *
- * @param value current value in model
- * @param index row index
- * @param text the text already computed to be displayed (could be usefull)
- * @return the tootltip to display the this row
- */
- String getToolTip(Object value, int index, String text);
-
- /**
- * @param model the model to use by renderer to display text and tooltipText
- * @see ToolTipListModel
- */
- void setModel(ToolTipListModel model);
-}
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-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-02 09:55:22 UTC (rev 2060)
@@ -18,9 +18,14 @@
Can't\ open\ log\ for\ %s=
Can't\ simulate\ %s=
Check\ state\ of\ local\ repository\:\ %s=
+Check\ syntax\ of\ the\ current\ script=
Checkout\ pom.xml\ to\ %s=
Command\ '%s'\ fail\ to\ execute=
+Commit\ script\ to\ CVS\ server=
+Copy\ current\ selection\ (Ctrl-c)=
Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
+Create\ a\ new\ script=
+Cut\ current\ selection\ (Ctrl-x)=
Error\ during\ vcs\ initialisation=
Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
Generate\ next\ simulation=
@@ -37,12 +42,14 @@
Month\ Gap\ BetweenRepro\ Recruitment=
Normal\ stop\ thread,\ this\ is\ not\ an\ error=
Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
+Paste\ current\ selection\ (Ctrl-v)=
Process\ template\ error=
Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
Region\ %s\ already\ inited=
Remote\ IsisFish\ server=
Remote\ control\ file\ doesn't\ exists\ %s=
Rename\ data\ directory\ to\ %s=
+Save\ current\ script=
Show\ help=
SimulationExecutor\ started\ with\ %s\ thread\ for\ %s=
Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to=
@@ -51,6 +58,7 @@
SubProcess\ start\:\ %s\ %s=
Switch\ repository\ type\ to\ none=
The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
+Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)=
Try\ to\ log\ on\ %s@%s\:%d=
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
@@ -67,6 +75,7 @@
destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
directory\ %s\ must\ be\ a\ directory=
filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
+in\ hour=
isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Please, report any bug you can found.<html>
isisfish.about.licensetext=You can modify and redistribute the program under the conditions of the GNU General Public License (version 2 or later). A copy of the GPL is in the file "LICENSE.txt" provided with Isis-Fish. All rights reserved. No guarantees are provided for use of this program.
isisfish.about.title=About Isis-Fish...
@@ -1014,6 +1023,8 @@
isisfish.zone.cells=Zone cells
isisfish.zone.comments=Comments
isisfish.zone.name=Name
+maximum\ length=
+minimum\ length=
not\ started=
region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
simulate\ %s\ with\ file\ %s=
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-01 16:52:11 UTC (rev 2059)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-02 09:55:22 UTC (rev 2060)
@@ -18,9 +18,14 @@
Can't\ open\ log\ for\ %s=
Can't\ simulate\ %s=
Check\ state\ of\ local\ repository\:\ %s=
+Check\ syntax\ of\ the\ current\ script=
Checkout\ pom.xml\ to\ %s=
Command\ '%s'\ fail\ to\ execute=
+Commit\ script\ to\ CVS\ server=
+Copy\ current\ selection\ (Ctrl-c)=
Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
+Create\ a\ new\ script=
+Cut\ current\ selection\ (Ctrl-x)=
Error\ during\ vcs\ initialisation=
Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
Generate\ next\ simulation=
@@ -37,12 +42,14 @@
Month\ Gap\ BetweenRepro\ Recruitment=
Normal\ stop\ thread,\ this\ is\ not\ an\ error=
Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
+Paste\ current\ selection\ (Ctrl-v)=
Process\ template\ error=
Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
Region\ %s\ already\ inited=La r\u00E9gion %s a d\u00E9j\u00E0 \u00E9t\u00E9 initialis\u00E9e
Remote\ IsisFish\ server=
Remote\ control\ file\ doesn't\ exists\ %s=
Rename\ data\ directory\ to\ %s=
+Save\ current\ script=
Show\ help=
SimulationExecutor\ started\ with\ %s\ thread\ for\ %s=
Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to=
@@ -51,6 +58,7 @@
SubProcess\ start\:\ %s\ %s=
Switch\ repository\ type\ to\ none=
The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
+Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)=
Try\ to\ log\ on\ %s@%s\:%d=
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
@@ -67,6 +75,7 @@
destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
directory\ %s\ must\ be\ a\ directory=
filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
+in\ hour=
isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Merci de rapporter les bugs.<html>
isisfish.about.licensetext=Vous pouvez modifier et redistribuer ce programme sous les conditions \u00E9nonc\u00E9es par la licence GNU GPL (version 2 ou ult\u00E9rieure). Une copie de la licence GPL est dans le fichier \u00AB\u00A0LICENSE.txt\u00A0\u00BB fourni avec Isis-Fish. Tous droits r\u00E9serv\u00E9s. Aucune garantie n'est fournie pour l'utilisation de ce programme.
isisfish.about.title=\u00C0 propos de Isis-Fish...
@@ -1014,6 +1023,8 @@
isisfish.zone.cells=cellules de la Zone
isisfish.zone.comments=Commentaires
isisfish.zone.name=Nom
+maximum\ length=
+minimum\ length=
not\ started=
region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
simulate\ %s\ with\ file\ %s=
1
0