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
r1709 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: chatellier
Date: 2008-12-19 17:24:16 +0000 (Fri, 19 Dec 2008)
New Revision: 1709
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:
Update i18n
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-19 16:17:44 UTC (rev 1708)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-19 17:24:16 UTC (rev 1709)
@@ -792,18 +792,18 @@
isisfish.script.menu.new=New
isisfish.script.menu.paste=Paste
isisfish.script.menu.save=Save
-isisfish.script.menu.txtEditorHelp=txtEditorHelp
-isisfish.script.menu.txtExport=txtExport
-isisfish.script.menu.txtHelp=txtHelp
-isisfish.script.menu.txtImport=txtImport
-isisfish.script.menu.txtJavaHelp=txtJavaHelp
-isisfish.script.menu.txtNewAnalysePlan=txtNewAnalysePlan
-isisfish.script.menu.txtNewEquationModel=txtNewEquationModel
-isisfish.script.menu.txtNewExport=txtNewExport
-isisfish.script.menu.txtNewRule=txtNewRule
-isisfish.script.menu.txtNewScript=txtNewScript
-isisfish.script.menu.txtNewSimulator=txtNewSimulator
-isisfish.script.menu.txtVCS=txtVCS
+isisfish.script.menu.txtEditorHelp=Online help
+isisfish.script.menu.txtExport=Export
+isisfish.script.menu.txtHelp=Help
+isisfish.script.menu.txtImport=Import
+isisfish.script.menu.txtJavaHelp=Java help
+isisfish.script.menu.txtNewAnalysePlan=New analyse plan
+isisfish.script.menu.txtNewEquationModel=New Equation model
+isisfish.script.menu.txtNewExport=New Export
+isisfish.script.menu.txtNewRule=New rule
+isisfish.script.menu.txtNewScript=New script
+isisfish.script.menu.txtNewSimulator=New simulator
+isisfish.script.menu.txtVCS=Server
isisfish.script.menu.update=Update from server
isisfish.script.new=New
isisfish.script.paste=Paste
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-19 16:17:44 UTC (rev 1708)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-19 17:24:16 UTC (rev 1709)
@@ -763,7 +763,7 @@
isisfish.script.commit=Commit
isisfish.script.copy=Copier
isisfish.script.cut=Couper
-isisfish.script.evaluate=Evaluer
+isisfish.script.evaluate=\u00C9valuer
isisfish.script.export=Exporter des scripts dans une archive zip
isisfish.script.export.cancel=annuler
isisfish.script.export.checkAll=(de)-select tout
@@ -786,17 +786,17 @@
isisfish.script.menu.deleteLocaly=Supprimer localement
isisfish.script.menu.deleteLocalyServer=Supprimer localement et sur le serveur
isisfish.script.menu.diff=Voir les diff\u00E9rences avec la version du serveur
-isisfish.script.menu.edit=Edition
+isisfish.script.menu.edit=\u00C9dition
isisfish.script.menu.evaluate=Evaluer
isisfish.script.menu.file=Fichier
isisfish.script.menu.new=Nouveau
isisfish.script.menu.paste=Coller
isisfish.script.menu.save=Sauver
-isisfish.script.menu.txtEditorHelp=Aide en ligne
+isisfish.script.menu.txtEditorHelp=Aide en ligne...
isisfish.script.menu.txtExport=Exporter
isisfish.script.menu.txtHelp=Aide
isisfish.script.menu.txtImport=Importer
-isisfish.script.menu.txtJavaHelp=Aide Java
+isisfish.script.menu.txtJavaHelp=Aide Java...
isisfish.script.menu.txtNewAnalysePlan=Nouveau plan d'analyse
isisfish.script.menu.txtNewEquationModel=Nouvelle formule
isisfish.script.menu.txtNewExport=Nouveau script d'export
1
0
r1708 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 19 Dec '08
by sletellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: sletellier
Date: 2008-12-19 16:17:44 +0000 (Fri, 19 Dec 2008)
New Revision: 1708
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
Log:
Debug final !
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -92,11 +92,12 @@
setBean((CellImpl) cell);
jaxx.runtime.swing.Utils.fillComboBox(fieldCell,action.getFisheryRegion().getCell(), cell);
cellMap.setFisheryRegion(action.getFisheryRegion());
- if (cellMap == null){
+ if (mapListener == null){
cellMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
cellMap.setActiveMouseMode(new SelectMouseMode());
toolSet.setupListeners(cellMap);
toolMap.add((Component)toolSet);
+ map.add(toolMap, BorderLayout.NORTH);
setMapListener();
}
@@ -208,7 +209,9 @@
</cell>
</row>
</Table>
- <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ <JPanel id='map' layout='{new BorderLayout()}'>
+ <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ </JPanel>
</JSplitPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -67,6 +67,7 @@
cellMap.setFisheryRegion(region);
toolSet.setupListeners(cellMap);
toolMap.add((Component)toolSet);
+ map.add(toolMap, BorderLayout.NORTH);
}
}
public void refresh(){
@@ -332,8 +333,9 @@
</cell>
</row>
</Table>
- <!--JPanel id="fisheryRegionMapPanel" layout='{new BorderLayout()}'/-->
- <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ <JPanel id='map' layout='{new BorderLayout()}'>
+ <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ </JPanel>
</JSplitPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -216,7 +216,7 @@
}
}
protected void saveGrowthModel(){
- getContextValue(InputAction.class).saveAsModel("Population", "Java", editor.getText());
+ getContextValue(InputAction.class).saveAsModel("PopulationGrowth", "Java", editor.getText());
setFieldPopulationBasicsGrowthModel();
setInfoText(_("isisfish.message.saveModel.finished"));
// Equation e = getEquation();
@@ -238,7 +238,7 @@
}
}
protected void saveGrowthReverseModel(){
- getContextValue(InputAction.class).saveAsModel("Population", "Java", editor.getText());
+ getContextValue(InputAction.class).saveAsModel("PopulationGrowth", "Java", editor.getText());
setfieldPopulationBasicsGrowthReverseModel();
setInfoText(_("isisfish.message.saveModel.finished"));
// Equation e = getEquation();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -171,7 +171,7 @@
</row>
<row>
<cell columns='2' anchor='west'>
- <JCheckBox id="fieldUseEquationMigration" text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()' enabled='{isActif()}'/>
+ <JCheckBox id="fieldUseEquationMigration" selected='true' text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()' enabled='{isActif()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -122,12 +122,20 @@
if (e != null){
getContextValue(InputAction.class).saveAsModel(e.getCategory(), e.getLanguage(), e.getContent());
}
+ else{
+ getContextValue(InputAction.class).saveAsModel(name, "Java", editor.getText());
+ setComboModel(f, name);
+ }
+// setInfoText(_("isisfish.message.saveModel.finished"));
}
protected void openEditor(){
Equation e = getEquation();
if (e != null){
getContextValue(InputAction.class).openEditor(e.getCategory(), e.getName(), clazz, e.getContent(), editor);
}
+ else{
+ getContextValue(InputAction.class).openEditor(name,"new",c, editor.getText(), editor);
+ }
}
]]>
</script>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -114,12 +114,20 @@
if (e != null){
getContextValue(InputAction.class).saveAsModel(e.getCategory(), e.getLanguage(), e.getContent());
}
+ else{
+ getContextValue(InputAction.class).saveAsModel("Reproduction", "Java", editor.getText());
+ setFieldPopulationReproductionEquationModel();
+ setInfoText(_("isisfish.message.saveModel.finished"));
+ }
}
protected void openEditor(){
Equation e = getEquation();
if (e != null){
getContextValue(InputAction.class).openEditor(e.getCategory(), e.getName(), fr.ifremer.isisfish.equation.PopulationGrowth.class, e.getContent(), editor);
}
+ else{
+ getContextValue(InputAction.class).openEditor("Reproduction","new", fr.ifremer.isisfish.equation.PopulationGrowth.class, editor.getText(), editor);
+ }
}
protected void monthGapChanged(){
pop.setMonthGapBetweenReproRecrutement(Integer.parseInt(fieldPopulationMonthGapBetweenReproRecrutement.getText()));
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -142,8 +142,8 @@
}
ip.setLabelRenderer(Month.MONTH);
ip.setModel(interval);
- valueChanged(true);
}
+ valueChanged(true);
}
protected void groupChangedChanged(){
PopulationSeasonInfo selected = getPopulationSeasonInfo();
@@ -181,14 +181,14 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/" + species.getTopiaId() + "/$populations");
valueChanged(false);
refresh();
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
- TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/" + species.getTopiaId() + "/$populations");
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -93,11 +93,12 @@
}
portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- if(portMap == null){
+ if(mapListener == null){
portMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
portMap.setActiveMouseMode(new SelectMouseMode());
toolSet.setupListeners(portMap);
toolMap.add((Component)toolSet);
+ map.add(toolMap, BorderLayout.NORTH);
setMapListener();
}
refreshMap();
@@ -237,7 +238,9 @@
</cell>
</row>
</Table>
- <fr.ifremer.isisfish.map.IsisMapBean id='portMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ <JPanel id='map' layout='{new BorderLayout()}'>
+ <fr.ifremer.isisfish.map.IsisMapBean id='portMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' constraints='BorderLayout.CENTER'/>
+ </JPanel>
</JSplitPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-19 16:17:44 UTC (rev 1708)
@@ -103,11 +103,12 @@
fieldZoneComment.setText("");
}
zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- if (zoneMap == null){
+ if (mapListener == null){
zoneMap.setActiveMouseMode(new SelectMouseMode(false));
zoneMap.setSelectionMode(CellSelectionLayer.MULT_SELECTION);
toolSet.setupListeners(zoneMap);
toolMap.add((Component)toolSet);
+ map.add(toolMap, BorderLayout.NORTH);
setMapListener();
}
refreshMap();
@@ -250,7 +251,9 @@
</cell>
</row>
</Table>
- <fr.ifremer.isisfish.map.IsisMapBean id='zoneMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ <JPanel id='map' layout='{new BorderLayout()}'>
+ <fr.ifremer.isisfish.map.IsisMapBean id='zoneMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
+ </JPanel>
</JSplitPane>
</cell>
</row>
1
0
r1707 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/datastore java/fr/ifremer/isisfish/logging java/fr/ifremer/isisfish/logging/console java/fr/ifremer/isisfish/logging/io java/fr/ifremer/isisfish/ui/script resources/i18n
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: chatellier
Date: 2008-12-19 16:14:28 +0000 (Fri, 19 Dec 2008)
New Revision: 1707
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogMail.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/FileOffsetReader.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/LineReader.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
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:
Update script menu actions
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java 2008-12-19 16:14:28 UTC (rev 1707)
@@ -155,10 +155,7 @@
}
public String diff() throws VCSException, IOException {
-
return getVCS().getDiff(getFile());
-
-
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2008-12-19 16:14:28 UTC (rev 1707)
@@ -255,7 +255,7 @@
* <p/>
* It category is null, we use the rootLogger.
*
- * @param category cateogry of appender to remove, it null use rootLogger
+ * @param category category of appender to remove, it null use rootLogger
* @param name name of appender to remove
*/
static void removeAppender(String category, String name) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogMail.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogMail.java 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/console/LogMail.java 2008-12-19 16:14:28 UTC (rev 1707)
@@ -20,41 +20,43 @@
package fr.ifremer.isisfish.logging.console;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.util.FileUtil;
-import org.codelutin.util.ZipUtil;
-import org.codelutin.widget.StatusBar;
-import org.apache.commons.logging.Log;
-import static org.apache.commons.logging.LogFactory.getLog;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.Message;
-import javax.mail.BodyPart;
-import javax.mail.Part;
-import javax.mail.Transport;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.internet.MimeBodyPart;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.BufferedInputStream;
+import java.io.BufferedWriter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
-import java.io.ByteArrayOutputStream;
-import java.io.BufferedWriter;
-import java.io.OutputStreamWriter;
import java.io.InputStream;
-import java.io.ByteArrayInputStream;
import java.io.OutputStream;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
+import java.io.OutputStreamWriter;
+import java.util.Date;
import java.util.Properties;
-import java.util.Date;
+import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
-import java.util.zip.ZipEntry;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.mail.BodyPart;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Part;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.FileUtil;
+import org.codelutin.util.ZipUtil;
+import org.codelutin.widget.StatusBar;
+
import fr.ifremer.isisfish.ui.logging.console.LogMailUI;
/**
@@ -65,8 +67,11 @@
public class LogMail extends LogMailUI {
- static private final Log log = org.apache.commons.logging.LogFactory.getLog(LogMail.class);
+ /** serialVersionUID */
+ private static final long serialVersionUID = 1L;
+ static private final Log log = LogFactory.getLog(LogMail.class);
+
/** the simulation directory */
protected File simulationFile;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/FileOffsetReader.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/FileOffsetReader.java 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/FileOffsetReader.java 2008-12-19 16:14:28 UTC (rev 1707)
@@ -29,7 +29,7 @@
import java.io.RandomAccessFile;
/**
- * A simple implementaion of {@link OffsetReader} using a file for
+ * A simple implementation of {@link OffsetReader} using a file for
* dealing with offsets.
* <p/>
* The offset of lines are pre-computed in a file {@link #offsetFile}, generated
@@ -52,7 +52,7 @@
/** writer used while creation or update */
protected RandomAccessFile writer;
- public FileOffsetReader(File file) throws IOException {
+ public FileOffsetReader(File file) {
this.offsetFile = file;
}
@@ -76,8 +76,6 @@
offsetReader = new RandomAccessFile(this.offsetFile, "r");
} catch (FileNotFoundException e) {
throw new IllegalArgumentException(e);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
}
if (!needCreate()) {
// we know extacly the number of line from the size of offsets file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/LineReader.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/LineReader.java 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/logging/io/LineReader.java 2008-12-19 16:14:28 UTC (rev 1707)
@@ -182,7 +182,7 @@
*
* @param position position of the line in the file
* @return the line found, or null
- * @throws java.io.IOException if any problem while reading
+ * @throws IOException if any problem while reading
*/
public String readLine(long position) throws IOException {
ensureOpen();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-12-19 16:14:28 UTC (rev 1707)
@@ -1,45 +1,42 @@
package fr.ifremer.isisfish.ui.script;
-/**
- *
- * @author letellier
- */
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
-import fr.ifremer.isisfish.datastore.CodeSourceStorage;
-import fr.ifremer.isisfish.datastore.ExportStorage;
-import fr.ifremer.isisfish.datastore.FormuleStorage;
-import fr.ifremer.isisfish.datastore.JavaSourceStorage;
-import fr.ifremer.isisfish.datastore.RuleStorage;
-import fr.ifremer.isisfish.datastore.ScriptStorage;
-import fr.ifremer.isisfish.datastore.SimulatorStorage;
-import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
-import fr.ifremer.isisfish.vcs.VCSException;
+import static org.codelutin.i18n.I18n._;
+
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import static org.codelutin.i18n.I18n._;
import java.io.File;
import java.io.FileFilter;
+import java.io.IOException;
+import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.io.PrintStream;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+
import javax.swing.JOptionPane;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
+
import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.codelutin.util.FileUtil;
-import static org.apache.commons.logging.LogFactory.getLog;
-import static fr.ifremer.isisfish.equation.Language.JAVA;
-import static javax.swing.JOptionPane.showMessageDialog;
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.CodeSourceStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.JavaSourceStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import fr.ifremer.isisfish.vcs.VCSException;
+
class ScriptFileFilter implements FileFilter {
final FileFilter filter;
@@ -51,20 +48,32 @@
return !filter.accept(dir) || dir.getName().equals("data");
}
}
+
+/**
+ *
+ * @author letellier
+ */
public class ScriptAction {
- CodeSourceStorage code;
+
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = getLog(ScriptAction.class);
- File fileOpen= null;
- public ScriptAction(){
+ static private Log log = LogFactory.getLog(ScriptAction.class);
+
+ protected CodeSourceStorage code;
+
+ protected File fileOpen = null;
+ public ScriptAction() {
+
}
- protected void showMsgBox(Exception eee){
+
+ protected void showMsgBox(Exception eee) {
ErrorDialogUI.showError(eee);
}
- public CodeSourceStorage getCode(){
+
+ public CodeSourceStorage getCode() {
return code;
}
+
/** @return an array of all script's modules names managed by this screen */
public static String[] getScriptTypesNames() {
ScriptMapping[] values = ScriptMapping.values();
@@ -74,59 +83,72 @@
}
return result;
}
- public List<String> getScriptNames(){
+
+ public List<String> getScriptNames() {
return ScriptStorage.getScriptNames();
}
- public List<String> getSimulatorNames(){
+
+ public List<String> getSimulatorNames() {
return SimulatorStorage.getSimulatorNames();
}
- public List<String> getExportNames(){
+
+ public List<String> getExportNames() {
return ExportStorage.getExportNames();
}
- public List<String> getRuleNames(){
+
+ public List<String> getRuleNames() {
return RuleStorage.getRuleNames();
}
- public List<String> getAnalysePlanNames(){
+
+ public List<String> getAnalysePlanNames() {
return AnalysePlanStorage.getAnalysePlanNames();
}
- public List<String> getCategories(){
+
+ public List<String> getCategories() {
return FormuleStorage.getCategories();
}
- public List<String> getFormuleNames(String Categories){
+
+ public List<String> getFormuleNames(String Categories) {
return FormuleStorage.getFormuleNames(Categories);
}
- public File getScriptDirectory(){
+
+ public File getScriptDirectory() {
return ScriptStorage.getScriptDirectory();
}
- public File getSimulatorDirectory(){
+
+ public File getSimulatorDirectory() {
return SimulatorStorage.getSimulatorDirectory();
}
- public File getExportDirectory(){
+
+ public File getExportDirectory() {
return ExportStorage.getExportDirectory();
}
- public File getRuleDirectory(){
+
+ public File getRuleDirectory() {
return RuleStorage.getRuleDirectory();
}
- public File getAnalysePlanDirectory(){
+
+ public File getAnalysePlanDirectory() {
return AnalysePlanStorage.getAnalysePlanDirectory();
}
- public File getFormuleDirectory(){
+
+ public File getFormuleDirectory() {
return FormuleStorage.getFormuleDirectory();
}
+
/*
* JButton Action
*/
- /**
- * Creer un nouveau script, ici un script peut-etre un Script, un Simulator,
- * un Export.
- *
- * @param fileName
- * @param scriptType le type que l'on souhaite Script, Simulator,
- * ou Export.
- * @return TODO
- */
+ /**
+ * Creer un nouveau script, ici un script peut-etre un Script, un Simulator,
+ * un Export.
+ *
+ * @param fileName
+ * @param scriptType le type que l'on souhaite Script, Simulator,
+ * ou Export.
+ */
public void newScript(String fileName, String scriptType) {
-// log.info("newScript called [" + scriptType + "] " + uiContext);
+ // log.info("newScript called [" + scriptType + "] " + uiContext);
Exception e;
try {
@@ -137,26 +159,32 @@
String realFilename;
String category;
ScriptMapping mapping = ScriptMapping.valueOf(scriptType);
- if (mapping == null) {
+ if (mapping == null) {
e = new RuntimeException("ScriptType unknown: " + scriptType);
- returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create", fileName, e
+ .getMessage()), e);
}
-
+
int pos = fileName.lastIndexOf('/');
if (pos != -1) {
- if (mapping!= ScriptMapping.EquationModel) {
+ if (mapping != ScriptMapping.EquationModel) {
// interdit pour le moment ?
- String message = _("isisfish.error.invalid.file.name", fileName);
+ String message = _("isisfish.error.invalid.file.name",
+ fileName);
e = new RuntimeException(message);
- returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
- }
+ returnError(_("isisfish.error.script.create", fileName, e
+ .getMessage()), e);
+ }
// il y a un sous type à traiter
if (pos == fileName.length() - 1) {
- String message = _("isisfish.error.invalid.file.name", fileName);
+ String message = _("isisfish.error.invalid.file.name",
+ fileName);
e = new RuntimeException(message);
- returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create", fileName, e
+ .getMessage()), e);
}
- realFilename = fileName.substring(fileName.lastIndexOf('/') + 1);
+ realFilename = fileName
+ .substring(fileName.lastIndexOf('/') + 1);
category = fileName.substring(0, fileName.lastIndexOf('/'));
} else {
realFilename = fileName;
@@ -165,169 +193,201 @@
if (!realFilename.matches("[A-Z0-9_][a-zA-Z0-9_]*")) {
String message = _("isisfish.error.invalid.file.name", fileName);
e = new RuntimeException(message);
- returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create", fileName, e
+ .getMessage()), e);
}
//TODO do test on category
CodeSourceStorage script = null;
String template;
template = mapping.getDefaultContent();
switch (mapping) {
- case EquationModel:
- script = FormuleStorage.createFormule(category, realFilename, JAVA);
- break;
- case AnalysePlan:
- script = AnalysePlanStorage.getAnalysePlan(fileName);
- break;
- case Export:
- script = ExportStorage.getExport(fileName);
- break;
- case Rule:
- script = RuleStorage.getRule(fileName);
- break;
- case Script:
- script = ScriptStorage.getScript(fileName);
- break;
- case Simulator:
- script = SimulatorStorage.getSimulator(fileName);
- break;
- default:
- log.fatal("ScriptType unknown: " + scriptType);
+ case EquationModel:
+ script = FormuleStorage.createFormule(category, realFilename,
+ Language.JAVA);
+ break;
+ case AnalysePlan:
+ script = AnalysePlanStorage.getAnalysePlan(fileName);
+ break;
+ case Export:
+ script = ExportStorage.getExport(fileName);
+ break;
+ case Rule:
+ script = RuleStorage.getRule(fileName);
+ break;
+ case Script:
+ script = ScriptStorage.getScript(fileName);
+ break;
+ case Simulator:
+ script = SimulatorStorage.getSimulator(fileName);
+ break;
+ default:
+ log.fatal("ScriptType unknown: " + scriptType);
}
if (script.exists()) {
// Message d'erreur si le fichier existe en local.
- String message = _("isisfish.error.file.already.exists", fileName);
+ String message = _("isisfish.error.file.already.exists",
+ fileName);
e = new RuntimeException(message);
- returnError(_("isisfish.error.script.create",fileName, e.getMessage()),e);
+ returnError(_("isisfish.error.script.create", fileName, e
+ .getMessage()), e);
}
// add default script content
String content = MessageFormat.format(template,
- category.isEmpty() ? "" : '.' + category.replaceAll("\\/", "."),
- realFilename,
- new Date(),
- IsisFish.config.getUserName(),
- IsisFish.config.getUserMail());
+ category.isEmpty() ? "" : '.' + category.replaceAll("\\/",
+ "."), realFilename, new Date(), IsisFish.config
+ .getUserName(), IsisFish.config.getUserMail());
script.setContent(content);
- code = script;
+ code = script;
} catch (Exception eee) {
- returnError(_("isisfish.error.script.create",fileName, eee.getMessage()),eee);
+ returnError(_("isisfish.error.script.create", fileName, eee
+ .getMessage()), eee);
}
}
- protected void returnError(String s, Exception eee) {
- log.error(s,eee);
+
+ protected void returnError(String s, Exception eee) {
+ log.error(s, eee);
showMsgBox(eee);
}
- public void loadScript(GenericCell c, String fileName, String type){
+
+ public void loadScript(GenericCell c, String fileName, String type) {
ScriptMapping mapping = ScriptMapping.valueOf(type);
CodeSourceStorage script = null;
try {
-
+
switch (mapping) {
- case EquationModel:
- script = FormuleStorage.getFormule((String)c.getValue(), fileName);
- break;
- case Rule:
- script = RuleStorage.getRule(fileName);
- break;
- case AnalysePlan:
- script = AnalysePlanStorage.getAnalysePlan(fileName);
- break;
- case Export:
- script = ExportStorage.getExport(fileName);
- break;
- case Script:
- script = ScriptStorage.getScript(fileName);
- break;
- case Simulator:
- script = SimulatorStorage.getSimulator(fileName);
- break;
- default:
- log.fatal("ScriptType unknown: " + fileName);
+ case EquationModel:
+ script = FormuleStorage.getFormule((String) c.getValue(),
+ fileName);
+ break;
+ case Rule:
+ script = RuleStorage.getRule(fileName);
+ break;
+ case AnalysePlan:
+ script = AnalysePlanStorage.getAnalysePlan(fileName);
+ break;
+ case Export:
+ script = ExportStorage.getExport(fileName);
+ break;
+ case Script:
+ script = ScriptStorage.getScript(fileName);
+ break;
+ case Simulator:
+ script = SimulatorStorage.getSimulator(fileName);
+ break;
+ default:
+ log.fatal("ScriptType unknown: " + fileName);
}
//frame.setInfoText(_("isisfish.message.load.finished"));
} catch (Exception eee) {
- returnError(_("isisfish.error.script.load",fileName, eee.getMessage()),eee);
+ returnError(_("isisfish.error.script.load", fileName, eee
+ .getMessage()), eee);
- }
- finally {
+ } finally {
code = script;
}
}
- public boolean fileLoaded(){
+
+ public boolean fileLoaded() {
return code != null;
}
- public boolean isJavaScript(){
+
+ public boolean isJavaScript() {
return JavaSourceStorage.class.isInstance(code);
- }
+ }
+
public Object saveScript(String content) {
log.info("saveScript called [" + code.getName() + "] ");
try {
code.setContent(content);
} catch (Exception eee) {
- returnError(_("isisfish.error.script.save", code.getFile(), eee.getMessage()),eee);
+ returnError(_("isisfish.error.script.save", code.getFile(), eee
+ .getMessage()), eee);
}
return null;
}
+
public String commitScript(String content) {
String result = null;
try {
log.debug("commitScript called for ");
// save script before commit
code.setContent(content);
- String msg = JOptionPane.showInputDialog(_("Indiquez vos modifications"));
-// String msg = VCSUIHelper.getCommitMessage(script.getFile(), true);
+ String msg = JOptionPane
+ .showInputDialog(_("Indiquez vos modifications"));
if (msg == null) {
result = _("isisfish.message.commit.cancelled");
} else {
- code.commit(msg);
- code.reload();
- result = _("isisfish.message.commit.finished");
+
+ try {
+ code.commit(msg);
+ code.reload();
+ result = _("isisfish.message.commit.finished");
+ }
+ catch(VCSException e) {
+
+ // FIXME enable/disable button only
+ // if vcs can write
+ JOptionPane.showMessageDialog(null, e.getMessage(),
+ _("isisfish.common.error"), JOptionPane.ERROR_MESSAGE);
+ if(log.isWarnEnabled()) {
+ log.warn("Exception on commit", e);
+ }
+ }
}
return null;
} catch (Exception ex) {
- Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ if(log.isErrorEnabled()) {
+ log.error("Error on script commit", ex);
+ }
}
return result;
}
+
/**
- * Exporte le(s) script(s) sélectionnés dans l'arbe.
+ * Exporte le(s) script(s) sélectionnés dans l'arbre.
* <br>L'arbre doit avoir au moins un script de selectionne
*
- * @param TreePath selected path
- * @return <code>null</code> if everything is ok,
- * an <code>OutputVie<</code> with an error to display otherwise
+ * @param selectedPaths selected path
+ * @return <code>null</code> if everything is ok.
*/
public static String exportScript(TreePath[] selectedPaths) {
String message = null;
// first step : acquire list of files required
- int prefixLength = IsisFish.config.getDatabaseDirectory().getAbsolutePath().length() + 1;
+ int prefixLength = IsisFish.config.getDatabaseDirectory()
+ .getAbsolutePath().length() + 1;
List<String> listFiles = extractFiles(prefixLength, selectedPaths);
return message;
}
- protected static List<String> extractFiles(int prefixLength,TreePath[] selectedPaths) {
+
+ protected static List<String> extractFiles(int prefixLength,
+ TreePath[] selectedPaths) {
List<String> result = new ArrayList<String>();
List<File> dirFound = new ArrayList<File>();
List<File> dirWithFileFound = new ArrayList<File>();
for (TreePath selectedPath : selectedPaths) {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectedPath.getPathComponent(1);
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectedPath
+ .getPathComponent(1);
String moduleDisplayName = String.valueOf(node.getUserObject());
File file = ScriptMapping.valueOf(moduleDisplayName).getModule();
int nbPaths = selectedPath.getPathCount();
if (nbPaths > 2)
for (int i = 2; i < nbPaths; i++) {
- node = (DefaultMutableTreeNode) selectedPath.getPathComponent(i);
+ node = (DefaultMutableTreeNode) selectedPath
+ .getPathComponent(i);
String pathName = String.valueOf(node.getUserObject());
file = new File(file, pathName);
}
if (file.isFile()) {
File parentFile = file.getParentFile();
- if (!dirFound.contains(parentFile)) dirFound.add(parentFile);
+ if (!dirFound.contains(parentFile))
+ dirFound.add(parentFile);
dirWithFileFound.add(parentFile);
result.add(file.getAbsolutePath().substring(prefixLength));
} else {
@@ -346,6 +406,7 @@
for (File dir : dirFound) {
FileFilter filter = new FileFilter() {
FileFilter excludeFilter = getSCRIPT_FILE_FILTER();
+
public boolean accept(File pathname) {
return !excludeFilter.accept(pathname);
}
@@ -359,33 +420,38 @@
dirFound.clear();
return result;
}
-
+
public static FileFilter SCRIPT_FILE_FILTER;
+
public static FileFilter getSCRIPT_FILE_FILTER() {
if (SCRIPT_FILE_FILTER == null) {
SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.vcs);
}
return SCRIPT_FILE_FILTER;
}
+
//public static Object updateScript()
- public void updateScript() {
- try {
- log.debug("updateScript called for ");
- //TODO Use VCS UI dialog
- //TODO Use FileState new mecanism to obtain state
- code.update();
- code.reload();
- } catch (VCSException ex) {
- Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ public void updateScript() {
+ try {
+ log.debug("updateScript called for ");
+ //TODO Use VCS UI dialog
+ //TODO Use FileState new mecanism to obtain state
+ code.update();
+ code.reload();
+ } catch (VCSException ex) {
+ if(log.isErrorEnabled()) {
+ log.error("Error on script update", ex);
}
}
- public String checkScript(String content) {
+ }
+
+ public String checkScript(String content) {
String resultLog = "";
try {
log.debug("checkScript called");
// save script before commit
code.setContent(content);
- JavaSourceStorage javaCode = (JavaSourceStorage)code;
+ JavaSourceStorage javaCode = (JavaSourceStorage) code;
StringWriter result = new StringWriter();
PrintWriter out = new PrintWriter(result);
int compileResult = 0;
@@ -394,7 +460,7 @@
compileResult = javaCode.compile(false, out);
} catch (Exception eee) {
compileResult = -1;
- e=eee;
+ e = eee;
}
if (compileResult != 0) {
out.flush();
@@ -402,20 +468,19 @@
if (e == null) {
e = new RuntimeException("there is some problem in script");
}
- }
- else{
+ } else {
resultLog = "ok";
}
} catch (IOException ex) {
- Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ if(log.isErrorEnabled()) {
+ log.error("Error on script check", ex);
+ }
}
return resultLog;
- }
- public String evaluateScript(String content) {
-
- // FIXME disabled huge error box :)
- //showMsgBox("Error.xml" + "test" + content);
+ }
+ public String evaluateScript(String content) {
+
log.debug("evaluateScript called");
String msg = "";
try {
@@ -435,28 +500,33 @@
Class clazz = javaCode.getCodeClass();
Method main = clazz.getMethod("main", String[].class);
//noinspection RedundantArrayCreation
- main.invoke(null, new Object[]{new String[]{}});
+ main.invoke(null, new Object[] { new String[] {} });
System.setOut(oldOut);
System.setErr(oldErr);
msg = result.toString();
} catch (Exception ex) {
- Logger.getLogger(ScriptAction.class.getName()).log(Level.SEVERE, null, ex);
+ if(log.isErrorEnabled()) {
+ log.error("Error on script evaluation", ex);
+ }
}
return msg;
}
- public String importScript(){
- String msg = null;
- log.debug("importScript ");
- // TODO : a reimplanter
- try {
- msg = _("isisfish.message.import.scripts.file.cancelled");
- } catch (Exception eee) {
- returnError(_("isisfish.error.script.import", eee.getMessage()), eee);
- }
- return msg;
- }
- public String deleteScript(int resp, boolean remote) {
- String msg = "";
+
+ public String importScript() {
+ String msg = null;
+ log.debug("importScript ");
+ // TODO : a reimplanter
+ try {
+ msg = _("isisfish.message.import.scripts.file.cancelled");
+ } catch (Exception eee) {
+ returnError(_("isisfish.error.script.import", eee.getMessage()),
+ eee);
+ }
+ return msg;
+ }
+
+ public String deleteScript(int resp, boolean remote) {
+ String msg = "";
log.debug("deleteScript called");
try {
@@ -468,29 +538,33 @@
code.delete(remote);
if (code.getFile().exists()) {
- RuntimeException exception = new RuntimeException("file could not be deleted");
- returnError(_("isisfish.error.script.delete",code.getFile(), exception.getMessage()), exception);
+ RuntimeException exception = new RuntimeException(
+ "file could not be deleted");
+ returnError(_("isisfish.error.script.delete", code
+ .getFile(), exception.getMessage()), exception);
}
msg = _("isisfish.message.delete.finished");
} else {
msg = _("isisfish.message.delete.canceled");
}
} catch (Exception eee) {
- returnError(_("isisfish.error.script.delete",code==null?null:code.getFile(), eee.getMessage()),eee);
+ returnError(_("isisfish.error.script.delete", code == null ? null
+ : code.getFile(), eee.getMessage()), eee);
}
return msg;
}
- public String diffScript(String content) {
+ public String diffScript(String content) {
log.debug("commitScript called");
-// TODO a refaire
+ // TODO a refaire
throw new UnsupportedOperationException("En reparation");
}
- /** enum to encapsulate a script module */
+ /** enum to encapsulate a script module */
enum ScriptMapping {
- Script(ScriptStorage.getScriptDirectory(),
+ Script(
+ ScriptStorage.getScriptDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -498,37 +572,38 @@
* 3 = author name,
* 4 = author email
*/
- "package scripts{0};\n" +
- "\n" +
- "import org.apache.commons.logging.Log;\n" +
- "import org.apache.commons.logging.LogFactory;\n" +
- "\n" +
- "import fr.ifremer.isisfish.util.Doc;\n" +
- "\n" +
- "import org.codelutin.math.matrix.*;\n" +
- "\n" +
- "import fr.ifremer.isisfish.entities.*;\n" +
- "\n" +
- "/**\n" +
- " * {0}.{1}.java\n" +
- " *\n" +
- " * Created: {2,date, long}\n" +
- " *\n" +
- " * @author {3} <{4}>\n" +
+ "package scripts{0};\n"
+ + "\n"
+ + "import org.apache.commons.logging.Log;\n"
+ + "import org.apache.commons.logging.LogFactory;\n"
+ + "\n"
+ + "import fr.ifremer.isisfish.util.Doc;\n"
+ + "\n"
+ + "import org.codelutin.math.matrix.*;\n"
+ + "\n"
+ + "import fr.ifremer.isisfish.entities.*;\n"
+ + "\n"
+ + "/**\n"
+ + " * {1}.java\n"
+ + " *\n"
+ + " * Created: {2,date, long}\n"
+ + " *\n"
+ + " * @author {3} <{4}>\n"
+ +
//" * @version $Revision: 1545 $\n" +
- " *\n" +
+ " *\n"
+ +
//" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
//" * by : $Author: sletellier $\n" +
- " */\n" +
- "public class {1} '{'\n" +
- "\n" +
- " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
- " static private Log log = LogFactory.getLog({1}.class);\n" +
- "\n" +
- " // add your method here\n" +
- "'}'\n"),
+ " */\n"
+ + "public class {1} '{'\n"
+ + "\n"
+ + " /** to use log facility, just put in your code: log.info(\"...\"); */\n"
+ + " static private Log log = LogFactory.getLog({1}.class);\n"
+ + "\n" + " // add your method here\n" + "'}'\n"),
- Simulator(SimulatorStorage.getSimulatorDirectory(),
+ Simulator(
+ SimulatorStorage.getSimulatorDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -536,40 +611,40 @@
* 3 = author name,
* 4 = author email
*/
- "package simulators{0};\n" +
- "\n" +
- "import org.apache.commons.logging.Log;\n" +
- "import org.apache.commons.logging.LogFactory;\n" +
- "\n" +
- "import org.codelutin.math.matrix.*;\n" +
- "\n" +
- "import fr.ifremer.isisfish.util.Doc;\n" +
- "import fr.ifremer.isisfish.entities.*;\n" +
- "import fr.ifremer.isisfish.simulator.Simulator;\n" +
- "import fr.ifremer.isisfish.simulator.SimulationContext;\n" +
- "\n" +
- "/**\n" +
- " * {1}.java\n" +
- " *\n" +
- " * Created: {2,date, long}\n" +
- " *\n" +
- " * @author {3} <{4}>\n" +
+ "package simulators{0};\n"
+ + "\n"
+ + "import org.apache.commons.logging.Log;\n"
+ + "import org.apache.commons.logging.LogFactory;\n"
+ + "\n"
+ + "import org.codelutin.math.matrix.*;\n"
+ + "\n"
+ + "import fr.ifremer.isisfish.util.Doc;\n"
+ + "import fr.ifremer.isisfish.entities.*;\n"
+ + "import fr.ifremer.isisfish.simulator.Simulator;\n"
+ + "import fr.ifremer.isisfish.simulator.SimulationContext;\n"
+ + "\n"
+ + "/**\n"
+ + " * {1}.java\n"
+ + " *\n"
+ + " * Created: {2,date, long}\n"
+ + " *\n"
+ + " * @author {3} <{4}>\n"
+ +
//" * @version $Revision: 1545 $\n" +
- " *\n" +
+ " *\n"
+ +
//" * Last update$\n" +
//" * by : $Author: sletellier $\n" +
- " */\n" +
- "public class {1} implements Simulator '{'\n" +
- "\n" +
- " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
- " static private Log log = LogFactory.getLog({1}.class);\n" +
- "\n" +
- " public void simulate(SimulationContext context) throws Exception '{'\n" +
- " // put your code here\n" +
- " '}'\n" +
- "\n" +
- "'}'\n"),
- Export(ExportStorage.getExportDirectory(),
+ " */\n"
+ + "public class {1} implements Simulator '{'\n"
+ + "\n"
+ + " /** to use log facility, just put in your code: log.info(\"...\"); */\n"
+ + " static private Log log = LogFactory.getLog({1}.class);\n"
+ + "\n"
+ + " public void simulate(SimulationContext context) throws Exception '{'\n"
+ + " // put your code here\n" + " '}'\n"
+ + "\n" + "'}'\n"), Export(
+ ExportStorage.getExportDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -577,69 +652,70 @@
* 3 = author name,
* 4 = author email
*/
- "package exports{0};\n" +
- "\n" +
- "import org.apache.commons.logging.Log;\n" +
- "import org.apache.commons.logging.LogFactory;\n" +
- "\n" +
- "import java.io.Writer;\n" +
- "\n" +
+ "package exports{0};\n"
+ + "\n"
+ + "import org.apache.commons.logging.Log;\n"
+ + "import org.apache.commons.logging.LogFactory;\n"
+ + "\n"
+ + "import java.io.Writer;\n"
+ + "\n"
+ +
- "import static org.codelutin.i18n.I18n._;\n" +
- "import org.codelutin.math.matrix.*;\n" +
- "\n" +
- "import fr.ifremer.isisfish.util.Doc;\n" +
- "import fr.ifremer.isisfish.entities.*;\n" +
- "import fr.ifremer.isisfish.export.Export;\n" +
- "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" +
- "import fr.ifremer.isisfish.datastore.ResultStorage;\n" +
- "\n" +
- "/**\n" +
- " * {1}.java\n" +
- " *\n" +
- " * Created: {2,date, long}\n" +
- " *\n" +
- " * @author {3} <{4}>\n" +
+ "import static org.codelutin.i18n.I18n._;\n"
+ + "import org.codelutin.math.matrix.*;\n"
+ + "\n"
+ + "import fr.ifremer.isisfish.util.Doc;\n"
+ + "import fr.ifremer.isisfish.entities.*;\n"
+ + "import fr.ifremer.isisfish.export.Export;\n"
+ + "import fr.ifremer.isisfish.datastore.SimulationStorage;\n"
+ + "import fr.ifremer.isisfish.datastore.ResultStorage;\n"
+ + "\n"
+ + "/**\n"
+ + " * {1}.java\n"
+ + " *\n"
+ + " * Created: {2,date, long}\n"
+ + " *\n"
+ + " * @author {3} <{4}>\n"
+ +
//" * @version $Revision: 1545 $\n" +
- " *\n" +
+ " *\n"
+ +
//" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
//" * by : $Author: sletellier $\n" +
- " */\n" +
- "public class {1} implements Export '{'\n" +
- "\n" +
- " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
- " static private Log log = LogFactory.getLog({1}.class);\n" +
- "\n" +
- " public String [] necessaryResult = '{'\n" +
- " // put here all necessary result for this rule\n" +
- " // example: \n" +
- " // ResultName.MATRIX_BIOMASS,\n" +
- " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" +
- " '}';\n" +
- "\n" +
- " public String[] getNecessaryResult() '{'\n" +
- " return this.necessaryResult;\n" +
- " '}'\n" +
- "\n" +
- " public String getExportFilename() '{'\n" +
- " // remove _(...) if you don''t want translation on filename\n" +
- " return _(\"{0}\");\n" +
- " '}'\n" +
- "\n" +
- " public String getExtensionFilename() '{'\n" +
- " return \".csv\";\n" +
- " '}'\n" +
- "\n" +
- " public String getDescription() '{'\n" +
- " return _(\"TODO export description\");\n" +
- " '}'\n" +
- "\n" +
- " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n" +
- " // put your code here, and write export with: out.write(\"...\")\n" +
- " '}'\n" +
- "\n" +
- "'}'\n"),
- Rule(RuleStorage.getRuleDirectory(),
+ " */\n"
+ + "public class {1} implements Export '{'\n"
+ + "\n"
+ + " /** to use log facility, just put in your code: log.info(\"...\"); */\n"
+ + " static private Log log = LogFactory.getLog({1}.class);\n"
+ + "\n"
+ + " public String [] necessaryResult = '{'\n"
+ + " // put here all necessary result for this rule\n"
+ + " // example: \n"
+ + " // ResultName.MATRIX_BIOMASS,\n"
+ + " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n"
+ + " '}';\n"
+ + "\n"
+ + " public String[] getNecessaryResult() '{'\n"
+ + " return this.necessaryResult;\n"
+ + " '}'\n"
+ + "\n"
+ + " public String getExportFilename() '{'\n"
+ + " // remove _(...) if you don''t want translation on filename\n"
+ + " return _(\"{0}\");\n"
+ + " '}'\n"
+ + "\n"
+ + " public String getExtensionFilename() '{'\n"
+ + " return \".csv\";\n"
+ + " '}'\n"
+ + "\n"
+ + " public String getDescription() '{'\n"
+ + " return _(\"TODO export description\");\n"
+ + " '}'\n"
+ + "\n"
+ + " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n"
+ + " // put your code here, and write export with: out.write(\"...\")\n"
+ + " '}'\n" + "\n" + "'}'\n"), Rule(
+ RuleStorage.getRuleDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -648,101 +724,100 @@
* 4 = author email,
* 5 = region name
*/
- "package rules{0};\n" +
- "\n" +
- "import static org.codelutin.i18n.I18n._;\n" +
- "\n" +
- "import org.apache.commons.logging.Log;\n" +
- "import org.apache.commons.logging.LogFactory;\n" +
- "\n" +
- "import scripts.ResultName;\n" +
- "\n" +
- "import java.io.Writer;\n" +
- "\n" +
- "import org.codelutin.math.matrix.*;\n" +
- "\n" +
- "import fr.ifremer.isisfish.util.Doc;\n" +
- "import fr.ifremer.isisfish.simulator.SimulationContext;\n" +
- "import fr.ifremer.isisfish.types.Date;\n" +
- "import fr.ifremer.isisfish.entities.*;\n" +
- "import fr.ifremer.isisfish.rule.AbstractRule;\n" +
- "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" +
- "import fr.ifremer.isisfish.datastore.ResultStorage;\n" +
- "\n" +
- "/**\n" +
- " * {1}.java\n" +
- " *\n" +
- " * Created: {2,date, long}\n" +
- " *\n" +
- " * @author {3} <{4}>\n" +
+ "package rules{0};\n"
+ + "\n"
+ + "import static org.codelutin.i18n.I18n._;\n"
+ + "\n"
+ + "import org.apache.commons.logging.Log;\n"
+ + "import org.apache.commons.logging.LogFactory;\n"
+ + "\n"
+ + "import scripts.ResultName;\n"
+ + "\n"
+ + "import java.io.Writer;\n"
+ + "\n"
+ + "import org.codelutin.math.matrix.*;\n"
+ + "\n"
+ + "import fr.ifremer.isisfish.util.Doc;\n"
+ + "import fr.ifremer.isisfish.simulator.SimulationContext;\n"
+ + "import fr.ifremer.isisfish.types.Date;\n"
+ + "import fr.ifremer.isisfish.entities.*;\n"
+ + "import fr.ifremer.isisfish.rule.AbstractRule;\n"
+ + "import fr.ifremer.isisfish.datastore.SimulationStorage;\n"
+ + "import fr.ifremer.isisfish.datastore.ResultStorage;\n"
+ + "\n"
+ + "/**\n"
+ + " * {1}.java\n"
+ + " *\n"
+ + " * Created: {2,date, long}\n"
+ + " *\n"
+ + " * @author {3} <{4}>\n"
+ +
//" * @version $Revision: 1545 $\n" +
- " *\n" +
+ " *\n"
+ +
//" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
//" * by : $Author: sletellier $\n" +
- " */\n" +
- "public class {1} extends AbstractRule '{'\n" +
- "\n" +
- " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
- " static private Log log = LogFactory.getLog({1}.class);\n" +
- "\n" +
- " public String [] necessaryResult = '{'\n" +
- " // put here all necessary result for this rule\n" +
- " // example: \n" +
- " // ResultName.MATRIX_BIOMASS,\n" +
- " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" +
- " '}';\n" +
- "\n" +
- " public String[] getNecessaryResult() '{'\n" +
- " return this.necessaryResult;\n" +
- " '}'\n" +
- "\n" +
- " /**\n" +
- " * Permet d''afficher a l''utilisateur une aide sur la regle.\n" +
- " * @return L''aide ou la description de la regle\n" +
- " */\n" +
- " public String getDescription() throws Exception '{'\n" +
- " // TODO\n" +
- " return _(\"TODO description rule\");\n" +
- " '}'\n" +
- " \n" +
- " /**\n" +
- " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" +
- " * des valeurs\n" +
- " * @param simulation La simulation pour lequel on utilise cette regle\n" +
- " */\n" +
- " public void init(SimulationContext context) throws Exception '{'\n" +
- " // TODO\n" +
- " '}'\n" +
- " /**\n" +
- " * La condition qui doit etre vrai pour faire les actions\n" +
- " * @param simulation La simulation pour lequel on utilise cette regle\n" +
- " * @return vrai si on souhaite que les actions soit faites\n" +
- " */\n" +
- " public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" +
- " // TODO\n" +
- " return false;\n" +
- " '}'\n" +
- " \n" +
- " /**\n" +
- " * Si la condition est vrai alors cette action est executée avant le pas\n" +
- " * de temps de la simulation.\n" +
- " * @param simulation La simulation pour lequel on utilise cette regle\n" +
- " */\n" +
- " public void preAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" +
- " // TODO\n" +
- " '}'\n" +
- " \n" +
- " /**\n" +
- " * Si la condition est vrai alors cette action est executée apres le pas\n" +
- " * de temps de la simulation.\n" +
- " * @param simulation La simulation pour lequel on utilise cette regle\n" +
- " */\n" +
- " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n" +
- " // TODO\n" +
- " '}'\n" +
- "\n" +
- "'}'\n"),
- AnalysePlan(AnalysePlanStorage.getAnalysePlanDirectory(),
+ " */\n"
+ + "public class {1} extends AbstractRule '{'\n"
+ + "\n"
+ + " /** to use log facility, just put in your code: log.info(\"...\"); */\n"
+ + " static private Log log = LogFactory.getLog({1}.class);\n"
+ + "\n"
+ + " public String [] necessaryResult = '{'\n"
+ + " // put here all necessary result for this rule\n"
+ + " // example: \n"
+ + " // ResultName.MATRIX_BIOMASS,\n"
+ + " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n"
+ + " '}';\n"
+ + "\n"
+ + " public String[] getNecessaryResult() '{'\n"
+ + " return this.necessaryResult;\n"
+ + " '}'\n"
+ + "\n"
+ + " /**\n"
+ + " * Permet d''afficher a l''utilisateur une aide sur la regle.\n"
+ + " * @return L''aide ou la description de la regle\n"
+ + " */\n"
+ + " public String getDescription() throws Exception '{'\n"
+ + " // TODO\n"
+ + " return _(\"TODO description rule\");\n"
+ + " '}'\n"
+ + " \n"
+ + " /**\n"
+ + " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n"
+ + " * des valeurs\n"
+ + " * @param simulation La simulation pour lequel on utilise cette regle\n"
+ + " */\n"
+ + " public void init(SimulationContext context) throws Exception '{'\n"
+ + " // TODO\n"
+ + " '}'\n"
+ + " /**\n"
+ + " * La condition qui doit etre vrai pour faire les actions\n"
+ + " * @param simulation La simulation pour lequel on utilise cette regle\n"
+ + " * @return vrai si on souhaite que les actions soit faites\n"
+ + " */\n"
+ + " public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception '{'\n"
+ + " // TODO\n"
+ + " return false;\n"
+ + " '}'\n"
+ + " \n"
+ + " /**\n"
+ + " * Si la condition est vrai alors cette action est executée avant le pas\n"
+ + " * de temps de la simulation.\n"
+ + " * @param simulation La simulation pour lequel on utilise cette regle\n"
+ + " */\n"
+ + " public void preAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n"
+ + " // TODO\n"
+ + " '}'\n"
+ + " \n"
+ + " /**\n"
+ + " * Si la condition est vrai alors cette action est executée apres le pas\n"
+ + " * de temps de la simulation.\n"
+ + " * @param simulation La simulation pour lequel on utilise cette regle\n"
+ + " */\n"
+ + " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n"
+ + " // TODO\n" + " '}'\n" + "\n" + "'}'\n"), AnalysePlan(
+ AnalysePlanStorage.getAnalysePlanDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -751,111 +826,105 @@
* 4 = author email,
* 5 = region name
*/
- "package analyseplans{0};\n" +
- "\n" +
- "import static org.codelutin.i18n.I18n._;\n" +
- "\n" +
- "import org.apache.commons.logging.Log;\n" +
- "import org.apache.commons.logging.LogFactory;\n" +
- "\n" +
- "import scripts.ResultName;\n" +
- "\n" +
- "import java.io.Writer;\n" +
- "\n" +
- "import org.codelutin.math.matrix.*;\n" +
- "import org.codelutin.util.*;\n" +
- "import org.codelutin.topia.*;\n" +
- "\n" +
- "import fr.ifremer.isisfish.util.Doc;\n" +
- "import fr.ifremer.isisfish.*;\n" +
- "import fr.ifremer.isisfish.simulator.SimulationContext;\n" +
- "import fr.ifremer.isisfish.types.Date;\n" +
- "import fr.ifremer.isisfish.entities.*;\n" +
- "import fr.ifremer.isisfish.simulator.AnalysePlan;\n" +
- "import fr.ifremer.isisfish.simulator.AnalysePlanContext;\n" +
- "import fr.ifremer.isisfish.simulator.SimulationParameter;\n" +
- "import fr.ifremer.isisfish.datastore.SimulationStorage;\n" +
- "import fr.ifremer.isisfish.datastore.ResultStorage;\n" +
- "\n" +
- "/**\n" +
- " * {1}.java\n" +
- " *\n" +
- " * Created: {2,date, long}\n" +
- " *\n" +
- " * @author {3} <{4}>\n" +
+ "package analyseplans{0};\n"
+ + "\n"
+ + "import static org.codelutin.i18n.I18n._;\n"
+ + "\n"
+ + "import org.apache.commons.logging.Log;\n"
+ + "import org.apache.commons.logging.LogFactory;\n"
+ + "\n"
+ + "import scripts.ResultName;\n"
+ + "\n"
+ + "import java.io.Writer;\n"
+ + "\n"
+ + "import org.codelutin.math.matrix.*;\n"
+ + "import org.codelutin.util.*;\n"
+ + "import org.codelutin.topia.*;\n"
+ + "\n"
+ + "import fr.ifremer.isisfish.util.Doc;\n"
+ + "import fr.ifremer.isisfish.*;\n"
+ + "import fr.ifremer.isisfish.simulator.SimulationContext;\n"
+ + "import fr.ifremer.isisfish.types.Date;\n"
+ + "import fr.ifremer.isisfish.entities.*;\n"
+ + "import fr.ifremer.isisfish.simulator.AnalysePlan;\n"
+ + "import fr.ifremer.isisfish.simulator.AnalysePlanContext;\n"
+ + "import fr.ifremer.isisfish.simulator.SimulationParameter;\n"
+ + "import fr.ifremer.isisfish.datastore.SimulationStorage;\n"
+ + "import fr.ifremer.isisfish.datastore.ResultStorage;\n"
+ + "\n"
+ + "/**\n"
+ + " * {1}.java\n"
+ + " *\n"
+ + " * Created: {2,date, long}\n"
+ + " *\n"
+ + " * @author {3} <{4}>\n"
+ +
//" * @version $Revision: 1545 $\n" +
- " *\n" +
+ " *\n"
+ +
//" * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $\n" +
//" * by : $Author: sletellier $\n" +
- " */\n" +
- "public class {1} implements AnalysePlan '{'\n" +
- "\n" +
- " /** to use log facility, just put in your code: log.info(\"...\"); */\n" +
- " static private Log log = LogFactory.getLog({1}.class);\n" +
- "\n" +
- " public String [] necessaryResult = '{'\n" +
- " // put here all necessary result for this rule\n" +
- " // example: \n" +
- " // ResultName.MATRIX_BIOMASS,\n" +
- " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n" +
- " '}';\n" +
- "\n" +
- " public String[] getNecessaryResult() '{'\n" +
- " return this.necessaryResult;\n" +
- " '}'\n" +
- "\n" +
- " /**\n" +
- " * Permet d''afficher a l''utilisateur une aide sur le plan.\n" +
- " * @return L''aide ou la description du plan\n" +
- " */\n" +
- " public String getDescription() throws Exception '{'\n" +
- " // TODO\n" +
- " return _(\"TODO description plan\");\n" +
- " '}'\n" +
- " \n" +
- " /**\n" +
- " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n" +
- " * des valeurs\n" +
- " * @param simulation La simulation pour lequel on utilise cette regle\n" +
- " */\n" +
- " public void init(AnalysePlanContext context) throws Exception '{'\n" +
- " // TODO\n" +
- " '}'\n" +
- " \n" +
- " /**\n" +
- " * Call before each simulation\n" +
- " * @param context plan context\n" +
- " * @param nextSimulation storage used for next simulation\n" +
- " * @return true if we must do next simulation, false to stop plan\n" +
- " * @throws Exception\n" +
- " */\n" +
- " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n" +
- " return false; // TODO\n" +
- " '}'\n" +
- "\n" +
- "'}'\n"),
- EquationModel(FormuleStorage.getFormuleDirectory(),
- /**
- * 0 = package name,
- * 1 = class name,
- * 2 = current date,
- * 3 = author name,
- * 4 = author email
- */
- "/**\n" +
- " * {1}.java\n" +
- " *\n" +
- " * Created: {2,date, long}\n" +
- " *\n" +
- " * @author {3} <{4}>\n" +
- //" * @version $Revision: 1545 $\n" +
- " *\n" +
- //" * Last update: $7 $\n" +
- //" * by : $Author: sletellier $\n" +
- //" */\n" +
- "\n" +
- "// put your code here\n" +
- "\n");
+ " */\n"
+ + "public class {1} implements AnalysePlan '{'\n"
+ + "\n"
+ + " /** to use log facility, just put in your code: log.info(\"...\"); */\n"
+ + " static private Log log = LogFactory.getLog({1}.class);\n"
+ + "\n"
+ + " public String [] necessaryResult = '{'\n"
+ + " // put here all necessary result for this rule\n"
+ + " // example: \n"
+ + " // ResultName.MATRIX_BIOMASS,\n"
+ + " // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,\n"
+ + " '}';\n"
+ + "\n"
+ + " public String[] getNecessaryResult() '{'\n"
+ + " return this.necessaryResult;\n"
+ + " '}'\n"
+ + "\n"
+ + " /**\n"
+ + " * Permet d''afficher a l''utilisateur une aide sur le plan.\n"
+ + " * @return L''aide ou la description du plan\n"
+ + " */\n"
+ + " public String getDescription() throws Exception '{'\n"
+ + " // TODO\n"
+ + " return _(\"TODO description plan\");\n"
+ + " '}'\n"
+ + " \n"
+ + " /**\n"
+ + " * Appelé au démarrage de la simulation, cette méthode permet d''initialiser\n"
+ + " * des valeurs\n"
+ + " * @param simulation La simulation pour lequel on utilise cette regle\n"
+ + " */\n"
+ + " public void init(AnalysePlanContext context) throws Exception '{'\n"
+ + " // TODO\n"
+ + " '}'\n"
+ + " \n"
+ + " /**\n"
+ + " * Call before each simulation\n"
+ + " * @param context plan context\n"
+ + " * @param nextSimulation storage used for next simulation\n"
+ + " * @return true if we must do next simulation, false to stop plan\n"
+ + " * @throws Exception\n"
+ + " */\n"
+ + " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n"
+ + " return false; // TODO\n" + " '}'\n"
+ + "\n" + "'}'\n"), EquationModel(FormuleStorage
+ .getFormuleDirectory(),
+ /**
+ * 0 = package name,
+ * 1 = class name,
+ * 2 = current date,
+ * 3 = author name,
+ * 4 = author email
+ */
+ "/**\n" + " * {1}.java\n" + " *\n" + " * Created: {2,date, long}\n"
+ + " *\n" + " * @author {3} <{4}>\n" +
+ //" * @version $Revision: 1545 $\n" +
+ " *\n" +
+ //" * Last update: $7 $\n" +
+ //" * by : $Author: sletellier $\n" +
+ //" */\n" +
+ "\n" + "// put your code here\n" + "\n");
private File module;
private String defaultContent;
@@ -864,7 +933,7 @@
this.module = module;
this.defaultContent = defaultContent;
}
-
+
File getModule() {
return module;
}
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 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-12-19 16:14:28 UTC (rev 1707)
@@ -33,6 +33,7 @@
<JPanel id="script" layout='{new BorderLayout()}'>
<script><![CDATA[
+ import static org.codelutin.i18n.I18n._;
import jaxx.runtime.swing.Item;
import javax.swing.event.TreeSelectionListener;
import jaxx.runtime.swing.JAXXTree;
@@ -41,8 +42,8 @@
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;
- import static org.codelutin.i18n.I18n._;
import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import fr.ifremer.isisfish.IsisFishRuntimeException;
setContextValue(new ScriptAction());
setButton();
@@ -143,16 +144,18 @@
boolean isJavaScript = getContextValue(ScriptAction.class).isJavaScript();
buttonScriptExport.setEnabled(tree.getSelectionValue() != null);
miExport.setEnabled(tree.getSelectionValue() != null);
-// buttonScriptCommit
-// buttonScriptUpdate
+ buttonScriptCommit.setEnabled(fileLoaded);
+ miCommitVCS.setEnabled(fileLoaded);
+ //buttonScriptUpdate.setEnabled(fileLoaded);
buttonScriptSave.setEnabled(fileLoaded);
miSave.setEnabled(fileLoaded);
- buttonScriptCut.setEnabled(fileLoaded);
- miCut.setEnabled(fileLoaded);
- buttonScriptCopy.setEnabled(fileLoaded);
- miCopy.setEnabled(fileLoaded);
- buttonScriptPaste.setEnabled(fileLoaded);
- miPaste.setEnabled(fileLoaded);
+ // FIXME use jaxx binding
+ //buttonScriptCut.setEnabled(fileLoaded);
+ //miCut.setEnabled(fileLoaded);
+ //buttonScriptCopy.setEnabled(fileLoaded);
+ //miCopy.setEnabled(fileLoaded);
+ //buttonScriptPaste.setEnabled(fileLoaded);
+ //miPaste.setEnabled(fileLoaded);
buttonScriptCheck.setEnabled(isJavaScript);
miCheckSyntax.setEnabled(isJavaScript);
buttonScriptEval.setEnabled(isJavaScript);
@@ -210,12 +213,16 @@
setInfoText(_("isisfish.message.save.finished"));
}
protected void exportScript(){
+ new IsisFishRuntimeException("Not yet implemented");
getContextValue(ScriptAction.class).exportScript(tree.getSelectionPaths());
}
protected void commitScript(){
- setInfoText(_(getContextValue(ScriptAction.class).commitScript(editor.getText())));
+ new IsisFishRuntimeException("Not yet implemented");
+ getContextValue(ScriptAction.class).commitScript(editor.getText());
+ setInfoText(_("isisfish.message.commit.finished"));
}
protected void updateScript(){
+ new IsisFishRuntimeException("Not yet implemented");
getContextValue(ScriptAction.class).updateScript();
setInfoText(_("isisfish.message.update.finished"));
}
@@ -237,7 +244,8 @@
setInfoText(getContextValue(ScriptAction.class).importScript());
}
protected void deleteScript(boolean b){
- int resp = JOptionPane.showConfirmDialog(this,_("isisfish.message.confirm.remove.script" , getContextValue(ScriptAction.class).getCode().getName()));
+ int resp = JOptionPane.showConfirmDialog(this,_("isisfish.message.confirm.remove.script" ,
+ getContextValue(ScriptAction.class).getCode().getName()), null, JOptionPane.YES_NO_OPTION);
setInfoText(getContextValue(ScriptAction.class).deleteScript(resp,b));
}
protected void diffScript(){
@@ -272,16 +280,16 @@
<JMenuItem id="miDelete" text="isisfish.script.menu.deleteLocaly" onActionPerformed='deleteScript(false)' accelerator="accDelete"/>
</JMenu>
<JMenu id="scriptTxtEdit" text="isisfish.script.menu.edit">
- <JMenuItem id="miCut" text="isisfish.script.menu.cut" onActionPerformed="cut()" accelerator="accCut"/>
- <JMenuItem id="miCopy" text="isisfish.script.menu.copy" onActionPerformed="copy()" accelerator="accCopy"/>
- <JMenuItem id="miPaste" text="isisfish.script.menu.paste" onActionPerformed="paste()" accelerator="accPaste"/>
+ <JMenuItem id="miCut" text="isisfish.script.menu.cut" enabled='false' onActionPerformed="cut()" accelerator="accCut"/>
+ <JMenuItem id="miCopy" text="isisfish.script.menu.copy" enabled='false' onActionPerformed="copy()" accelerator="accCopy"/>
+ <JMenuItem id="miPaste" text="isisfish.script.menu.paste" enabled='false' onActionPerformed="paste()" accelerator="accPaste"/>
</JMenu>
<JMenu id="scriptTxtVCS" text="isisfish.script.menu.txtVCS">
- <JMenuItem id="miCommitVCS" text="isisfish.script.menu.commit" accelerator="accCommitVCS" onActionPerformed="commitScript()"/>
- <JMenuItem id="miDiffVCS" text="isisfish.script.menu.diff" accelerator="mnDiffVCS" onActionPerformed="diffScript()"/>
- <JMenuItem id="miUpdateVCS" text="isisfish.script.menu.update" accelerator="accUpdateVCS" onActionPerformed="updateScript()"/>
+ <JMenuItem id="miCommitVCS" enabled='false' text="isisfish.script.menu.commit" accelerator="accCommitVCS" onActionPerformed="commitScript()"/>
+ <JMenuItem id="miDiffVCS" enabled='false' text="isisfish.script.menu.diff" accelerator="mnDiffVCS" onActionPerformed="diffScript()"/>
+ <JMenuItem id="miUpdateVCS" enabled='false' text="isisfish.script.menu.update" accelerator="accUpdateVCS" onActionPerformed="updateScript()"/>
<JSeparator/>
- <JMenuItem id="miDeleteVCS" text="isisfish.script.menu.deleteLocalyServer" onActionPerformed='deleteScript(true)' accelerator="accDeleteVCS"/>
+ <JMenuItem id="miDeleteVCS" enabled='false' text="isisfish.script.menu.deleteLocalyServer" onActionPerformed='deleteScript(true)' accelerator="accDeleteVCS"/>
</JMenu>
<JMenu id="scriptTxtCode" text="isisfish.script.menu.code">
<JMenuItem id="miCheckSyntax" text="isisfish.script.menu.checkSyntax" accelerator="accCheckSyntax" onActionPerformed="checkScript()"/>
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-19 16:14:28 UTC (rev 1707)
@@ -50,6 +50,7 @@
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
Your\ database\ repository\:\ %s\\n\ don't\ use\ correct=
+cant\ start\ nimbus=
could\ not\ close\ reader\ %1$s=could not close reader %1$s
could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
could\ not\ filter\ on\ simulations=could not filter on simulations
@@ -513,7 +514,7 @@
isisfish.message.compilation.time=Compilation time %1$ss
isisfish.message.confirm.delete.object=Do you really want delete object %1$s
isisfish.message.confirm.remove.region=Do you really want to remove the region %1$s ?
-isisfish.message.confirm.remove.script=Do you want to remove script ? '%1$s'
+isisfish.message.confirm.remove.script=Do you want to remove script '%1$s' ?
isisfish.message.copy.finished=Copy finished
isisfish.message.copy.region=Copy region to %1$s
isisfish.message.creating.region=Creating region %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 2008-12-19 15:52:49 UTC (rev 1706)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-19 16:14:28 UTC (rev 1707)
@@ -50,6 +50,7 @@
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
Your\ database\ repository\:\ %s\\n\ don't\ use\ correct=
+cant\ start\ nimbus=
could\ not\ close\ reader\ %1$s=could not close reader %1$s
could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
could\ not\ filter\ on\ simulations=could not filter on simulations
@@ -513,7 +514,7 @@
isisfish.message.compilation.time=Temps de compilation %1$ss
isisfish.message.confirm.delete.object=Voulez-vous vraiment supprimer l'objet %1$s
isisfish.message.confirm.remove.region=Voulez-vous vraiement supprimer la r\u00E9gion %1$s ?
-isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script ? '%1$s'
+isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script '%1$s' ?
isisfish.message.copy.finished=Copie termin\u00E9e
isisfish.message.copy.region=Copier la r\u00E9gion vers %1$s
isisfish.message.creating.region=En train de cr\u00E9er la r\u00E9gion %1$s
@@ -921,11 +922,11 @@
isisfish.vcs.updateconfirm.ok=confirmer
isisfish.vcs.updateconfirm.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts que vous voulez traiter
isisfish.vcs.updaterepository.confirm=Votre d\u00E9p\u00F4t des scripts n'est pas \u00E0 jour.\nVoulez-vous mettre \u00E0 jour votre d\u00E9p\u00F4t ?\n\nLes fichiers modifi\u00E9s sont \:\n%s
-isisfish.vcs.vcssvn.add.error=Can't add file
-isisfish.vcs.vcssvn.add.errorreadonly=You can't add file, this repository is readonly
-isisfish.vcs.vcssvn.checkProtocol.error=Can't get address on serveur of local repository
-isisfish.vcs.vcssvn.checkProtocol.relocate=Relocate repository %s from %s to %s
-isisfish.vcs.vcssvn.checkout.error=Checkout impossible
+isisfish.vcs.vcssvn.add.error=Impossible d'ajouter un fichier
+isisfish.vcs.vcssvn.add.errorreadonly=Vous ne pouver pas ajouter de fichier, ce d\u00E9p\u00F4t est en lecture seule \!
+isisfish.vcs.vcssvn.checkProtocol.error=Impossible d'obtenir l'adresse correspondant au d\u00E9p\u00F4t local
+isisfish.vcs.vcssvn.checkProtocol.relocate=Transfert du d\u00E9p\u00F4t %s de %s vers %s
+isisfish.vcs.vcssvn.checkout.error=Impossible de mettre \u00E0 jour
isisfish.vcs.vcssvn.commit.error=Impossible de commiter
isisfish.vcs.vcssvn.commit.errorreadonly=Vous ne pouvez pas commiter, le d\u00E9p\u00F4t est en lecture seule
isisfish.vcs.vcssvn.delete.error=Impossible de supprimer des fichiers
1
0
Author: chatellier
Date: 2008-12-19 15:52:49 +0000 (Fri, 19 Dec 2008)
New Revision: 1706
Modified:
isis-fish/trunk/README.txt
Log:
Replace maven readme by isis fish one.
Modified: isis-fish/trunk/README.txt
===================================================================
--- isis-fish/trunk/README.txt 2008-12-19 14:14:23 UTC (rev 1705)
+++ isis-fish/trunk/README.txt 2008-12-19 15:52:49 UTC (rev 1706)
@@ -1,117 +1,4 @@
-maven target
-------------
+IsisFish
+========
-genapp
- pour generer le skelette du répertoire de projet
-
-jar
- pour compiler et générer un jar
-
-uberjar
- pour générer un jar qui contient toutes ses dépendances que l'on peut
- exécuter avec un java -jar ...
-
-site:deploy
- pour mettre à jour les pages web du site
-
-jar:deploy
- pour mettre à jour la version dans le repository
-
-jar:deploy-snapshot
- pour mettre en place une nouvelle version snapshot dans le repository
-
-dist:deploy
- pour generer des tar.gz de binaire et de sources et les mettre dans le
- repository
-
-Installation d'un plugin
-------------------------
-
-::
-
- maven -DartifactId=maven-lutinprocessor-plugin -DgroupId=lutinlib -Dversion=0.1 plugin:download
-
-Installation de maven
----------------------
-
-Récupérer la dernière version de maven sur http://maven.apache.org
-Installer le en le décompressant dans un répertoire, par exemple /opt
-
-Ajouter le répertoire de bin maven dans votre PATH (peut-etre dans le
-fichier /etc/profile ou ~/.bash_profile)::
-
- export PATH=$PATH:/opt/maven/bin
-
-modifier les droits du répertoire /opt/maven/plugin si vous souhaitez
-installer de nouveau plugin en tant qu'uilisateur normal et non pas
-seulement en root.
-
-Par exemple créez un group dev dans lequel vous mettrez tous les
-développeurs qui devront pouvoir ajouter des plugins à votre installation
-maven.
-
-ensuite::
-
- chown .dev /opt/maven/plugin
- chmod g+w /opt/maven/plugin
- chmod go+s /opt/maven/plugin
-
-Maven décompresse les plugins et download les librairies dans un répertoire.
-Normalement ce répertoire est dans le HOME de chaque utilisateur, mais il
-peut très bien être partagé, et cela permet de ne pas avoir un répertoire de
-plusieurs méga dans son HOME.
-
-Pour cela ajouté dans votre fichier ~/build.properties ceci::
-
- maven.home.local=/var/cache/maven
-
-Il faut ensuite créer ce répertoire et lui mettre les bons droits::
-
- mkdir -p /var/cache/maven
- chown .dev /var/cache/maven
- chmod g+w /var/cache/maven
- chmod go+s /var/cache/maven
-
-Exemple de fichier build.properties
------------------------------------
-
-::
-
- maven.repo.remote=http://www.ibiblio.org/maven/,http://lutinbuilder.labs.li…
-
- maven.checkstyle.format=sun
-
- # pour que le home ne soit pas submerger de .jar énorme
- maven.home.local=/var/cache/maven
-
- # pour la creation de nouveau projet
- maven.genapp.template=topia
- maven.genapp.default.id=lutinApp
- maven.genapp.default.name=Code Lutin Application
- maven.genapp.default.package=org.codelutin
-
- # login sur les sites de deployement
- maven.username=bpoussin
-
-Installation d'un template
---------------------------
-
-On voit dans l'exemple de fichier build.properties ci-dessus que le template
-utilisé est topia. Pour créer ou ajouter un template il faut le faire dans
-le répertoire ~/.maven/template/nom_du_template
-
-par exemple vous pouvez récuperer le template topia et l'installer
-(http://lutinbuilder.labs.libre-entreprise.org/maven/template/topia-0.1.tar.gz)
-
-TODO
-----
-
-labs:register
- pour enregistrer le projet sur labs (declaration des mailings lists,
- fermeture des forums, ...)
-
-labs:release
- pour publier une nouvelle version sur labs (mise à jour du site web,
- enregistrement des fichiers dowloads, ajout du jar dans le repository
- maven, update du XXX-last.jar pointant vers cette derniere version.
-
+Simulateur de pêcherie complexe.
\ No newline at end of file
1
0
r1705 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: chatellier
Date: 2008-12-19 14:14:23 +0000 (Fri, 19 Dec 2008)
New Revision: 1705
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
Log:
Replace i18n _ method
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-12-19 14:03:17 UTC (rev 1704)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-12-19 14:14:23 UTC (rev 1705)
@@ -585,7 +585,7 @@
"import java.io.Writer;\n" +
"\n" +
- "import static org.codelutin.i18n.I18nf._;\n" +
+ "import static org.codelutin.i18n.I18n._;\n" +
"import org.codelutin.math.matrix.*;\n" +
"\n" +
"import fr.ifremer.isisfish.util.Doc;\n" +
@@ -622,7 +622,7 @@
" '}'\n" +
"\n" +
" public String getExportFilename() '{'\n" +
- " // remove _(...) if you don''t want translation on filename" +
+ " // remove _(...) if you don''t want translation on filename\n" +
" return _(\"{0}\");\n" +
" '}'\n" +
"\n" +
@@ -650,7 +650,7 @@
*/
"package rules{0};\n" +
"\n" +
- "import static org.codelutin.i18n.I18nf._;\n" +
+ "import static org.codelutin.i18n.I18n._;\n" +
"\n" +
"import org.apache.commons.logging.Log;\n" +
"import org.apache.commons.logging.LogFactory;\n" +
@@ -753,7 +753,7 @@
*/
"package analyseplans{0};\n" +
"\n" +
- "import static org.codelutin.i18n.I18nf._;\n" +
+ "import static org.codelutin.i18n.I18n._;\n" +
"\n" +
"import org.apache.commons.logging.Log;\n" +
"import org.apache.commons.logging.LogFactory;\n" +
1
0
r1704 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: chatellier
Date: 2008-12-19 14:03:17 +0000 (Fri, 19 Dec 2008)
New Revision: 1704
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx
Log:
Remove useless separator
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 2008-12-19 13:50:18 UTC (rev 1703)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2008-12-19 14:03:17 UTC (rev 1704)
@@ -275,7 +275,6 @@
<JMenuItem id="miCut" text="isisfish.script.menu.cut" onActionPerformed="cut()" accelerator="accCut"/>
<JMenuItem id="miCopy" text="isisfish.script.menu.copy" onActionPerformed="copy()" accelerator="accCopy"/>
<JMenuItem id="miPaste" text="isisfish.script.menu.paste" onActionPerformed="paste()" accelerator="accPaste"/>
- <JSeparator/>
</JMenu>
<JMenu id="scriptTxtVCS" text="isisfish.script.menu.txtVCS">
<JMenuItem id="miCommitVCS" text="isisfish.script.menu.commit" accelerator="accCommitVCS" onActionPerformed="commitScript()"/>
1
0
Author: sletellier
Date: 2008-12-19 13:50:18 +0000 (Fri, 19 Dec 2008)
New Revision: 1703
Modified:
isis-fish/trunk/pom.xml
Log:
Debug final !
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-19 13:45:22 UTC (rev 1702)
+++ isis-fish/trunk/pom.xml 2008-12-19 13:50:18 UTC (rev 1703)
@@ -414,6 +414,11 @@
<artifactId>lutinmatrix</artifactId>
<version>${lutinmatrix.version}</version>
</dependency>
+ <dependency>
+ <groupId>openmap</groupId>
+ <artifactId>openmap</artifactId>
+ <version>4.6.4</version>
+ </dependency>
</dependencies>
</plugin>
1
0
r1702 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: input simulator
by sletellier@users.labs.libre-entreprise.org 19 Dec '08
by sletellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: sletellier
Date: 2008-12-19 13:45:22 +0000 (Fri, 19 Dec 2008)
New Revision: 1702
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/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/SimulAction.java
Log:
Debug final !
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -63,7 +63,6 @@
import org.codelutin.topia.TopiaException;
-protected IsisMapBean cellMap = null;
protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
protected OpenMapEvents mapListener = null;
@@ -92,16 +91,13 @@
Cell cell = action.getCell();
setBean((CellImpl) cell);
jaxx.runtime.swing.Utils.fillComboBox(fieldCell,action.getFisheryRegion().getCell(), cell);
+ cellMap.setFisheryRegion(action.getFisheryRegion());
if (cellMap == null){
- cellMap = new IsisMapBean();
cellMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
cellMap.setActiveMouseMode(new SelectMouseMode());
- cellMap.setFisheryRegion(action.getFisheryRegion());
toolSet.setupListeners(cellMap);
toolMap.add((Component)toolSet);
setMapListener();
- cellMapPanel.add(toolMap, BorderLayout.NORTH);
- cellMapPanel.add(cellMap, BorderLayout.CENTER);
}
if (cell != null){
@@ -212,7 +208,7 @@
</cell>
</row>
</Table>
- <JPanel id="cellMapPanel" layout='{new BorderLayout()}'/>
+ <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
</JSplitPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -40,6 +40,7 @@
<Boolean id='changed' javaBean='false'/>
+
<script>
<![CDATA[
import fr.ifremer.isisfish.entities.FisheryRegion;
@@ -51,7 +52,6 @@
import fr.ifremer.isisfish.ui.WelcomePanelUI;
protected FisheryRegion region = null;
- protected IsisMapBean cellMap = null;
protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
@@ -60,34 +60,34 @@
setContextValue(action);
}
protected void init(){
- cellMap = new IsisMapBean();
- cellMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
- cellMap.setActiveMouseMode(new SelectMouseMode());
- toolSet.setupListeners(cellMap);
- toolMap.add((Component)toolSet);
- fisheryRegionMapPanel.add(toolMap, BorderLayout.NORTH);
- fisheryRegionMapPanel.add(cellMap, BorderLayout.CENTER);
-
+ region = getContextValue(InputAction.class).getFisheryRegion();
+ if (region != null){
+ cellMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
+ cellMap.setActiveMouseMode(new SelectMouseMode());
+ cellMap.setFisheryRegion(region);
+ toolSet.setupListeners(cellMap);
+ toolMap.add((Component)toolSet);
+ }
}
public void refresh(){
- jaxx.runtime.Util.assignment(region = getContextValue(InputAction.class).getFisheryRegion(), "region", fr.ifremer.isisfish.ui.input.FisheryRegionUI.this);
- fieldRegion.setText(region.getName());
- fieldLatMin.setText(region.getMinLatitude() + "");
- fieldLatMax.setText(region.getMaxLatitude() + "");
- fieldLongMin.setText(region.getMinLongitude() + "");
- fieldLongMax.setText(region.getMaxLongitude() + "");
- fieldCellLengthLatitude.setText(region.getCellLengthLatitude() + "");
- fieldCellLengthLongitude.setText(region.getCellLengthLongitude() + "");
- setFieldMapfilesModel(region);
- fieldComment.setText(region.getComment());
- refreshMap();
+ if (region != getContextValue(InputAction.class).getFisheryRegion()){
+ init();
+ }
+ if (region != null){
+ fieldRegion.setText(region.getName());
+ fieldLatMin.setText(region.getMinLatitude() + "");
+ fieldLatMax.setText(region.getMaxLatitude() + "");
+ fieldLongMin.setText(region.getMinLongitude() + "");
+ fieldLongMax.setText(region.getMaxLongitude() + "");
+ fieldCellLengthLatitude.setText(region.getCellLengthLatitude() + "");
+ fieldCellLengthLongitude.setText(region.getCellLengthLongitude() + "");
+ setFieldMapfilesModel(region);
+ fieldComment.setText(region.getComment());
+ refreshMap();
+ }
}
protected void refreshMap(){
-// cellMap = new IsisMapBean();
-// cellMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
-// cellMap.setActiveMouseMode(new SelectMouseMode());
- cellMap.setFisheryRegion(region);
- cellMap.repaint();
+// cellMap.repaint();
}
protected void setFieldMapfilesModel(FisheryRegion region){
DefaultListModel model = new DefaultListModel();
@@ -166,7 +166,8 @@
setMsg(_("isisfish.message.checking.cell"));
getContextValue(InputAction.class).saveFisheryRegion("FisheryRegion");
valueChanged(false);
- getParentContainer(InputUI.class).repaintNode("$root");
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setFieldCurrentRegionModel();
setMsg(_("isisfish.message.save.finished"));
refresh();
}
@@ -331,7 +332,8 @@
</cell>
</row>
</Table>
- <JPanel id="fisheryRegionMapPanel" layout='{new BorderLayout()}'/>
+ <!--JPanel id="fisheryRegionMapPanel" layout='{new BorderLayout()}'/-->
+ <fr.ifremer.isisfish.map.IsisMapBean id='cellMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
</JSplitPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -96,6 +96,9 @@
setContextValue(action);
}
+ protected void setFieldCurrentRegionModel(){
+ fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ }
protected DefaultComboBoxModel getFieldCurrentRegionModel(){
return new DefaultComboBoxModel(Common.getRegionItem());
}
@@ -110,138 +113,20 @@
}
});
}
-/* protected void setTreeModel(){
- tree.setModel(getTreeModel());
- }
- protected DefaultTreeModel getTreeModel(){
- String regionName = getContextValue(InputAction.class).getFisheryRegionName();
- DefaultTreeModel treeModel = null;
- if (regionName != null){
- try {
- DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(new GenericCell(regionName, null, null));
- treeModel = new DefaultTreeModel(rootNode);
- DefaultMutableTreeNode cellsTreeNode = new DefaultMutableTreeNode(new GenericCell("Cells", null, Cell.class));
- DefaultMutableTreeNode zonesTreeNode = new DefaultMutableTreeNode(new GenericCell("Zones", null, Zone.class));
- DefaultMutableTreeNode ports = new DefaultMutableTreeNode(new GenericCell("Ports", null, Port.class));
- DefaultMutableTreeNode species = new DefaultMutableTreeNode(new GenericCell("Species", null, Species.class));
- DefaultMutableTreeNode gears = new DefaultMutableTreeNode(new GenericCell("Gears", null, Gear.class));
- DefaultMutableTreeNode metiers = new DefaultMutableTreeNode(new GenericCell("Metiers", null, Metier.class));
- DefaultMutableTreeNode tripTypes = new DefaultMutableTreeNode(new GenericCell("TripTypes", null, TripType.class));
- DefaultMutableTreeNode vesselTypes = new DefaultMutableTreeNode(new GenericCell("VesselTypes", null, VesselType.class));
- DefaultMutableTreeNode setOfVessels = new DefaultMutableTreeNode(new GenericCell("SetOfVessels", null, SetOfVessels.class));
- DefaultMutableTreeNode strategies = new DefaultMutableTreeNode(new GenericCell("Strategies", null, Strategy.class));
-
- setNode(cellsTreeNode, getContextValue(InputAction.class).getFisheryRegion().getCell().toArray(), Cell.class);
- setNode(zonesTreeNode, getContextValue(InputAction.class).getFisheryRegion().getZone().toArray(), Zone.class);
- setNode(ports, getContextValue(InputAction.class).getFisheryRegion().getPort().toArray(), Port.class);
- setSpeciesNode(species, getContextValue(InputAction.class).getFisheryRegion().getSpecies().toArray(), Species.class);
- setNode(gears, getContextValue(InputAction.class).getFisheryRegion().getGear().toArray(), Gear.class);
- setNode(metiers, getContextValue(InputAction.class).getFisheryRegion().getMetier().toArray(), Metier.class);
- setNode(tripTypes, getContextValue(InputAction.class).getFisheryRegion().getTripType().toArray(), TripType.class);
- setNode(vesselTypes, getContextValue(InputAction.class).getFisheryRegion().getVesselType().toArray(), VesselType.class);
- setNode(setOfVessels, getContextValue(InputAction.class).getFisheryRegion().getSetOfVessels().toArray(), SetOfVessels.class);
- setNode(strategies, getContextValue(InputAction.class).getFisheryRegion().getStrategy().toArray(), Strategy.class);
-
- treeModel.insertNodeInto(cellsTreeNode, rootNode, 0);
- treeModel.insertNodeInto(zonesTreeNode, rootNode, 1);
- treeModel.insertNodeInto(ports, rootNode, 2);
- treeModel.insertNodeInto(species, rootNode, 3);
- treeModel.insertNodeInto(gears, rootNode, 4);
- treeModel.insertNodeInto(metiers, rootNode, 5);
- treeModel.insertNodeInto(tripTypes, rootNode, 6);
- treeModel.insertNodeInto(vesselTypes, rootNode, 7);
- treeModel.insertNodeInto(setOfVessels, rootNode, 8);
- treeModel.insertNodeInto(strategies, rootNode, 9);
- } catch (Exception ex) {
- Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- return treeModel;
- }
- protected void setSpeciesNode (DefaultMutableTreeNode node, Object[] values, Class type){
- for (Object value : values){
- DefaultMutableTreeNode population = new DefaultMutableTreeNode(new GenericCell("Population", null, Population.class));
- DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new GenericCell(value.toString(), value, type));
- setNode(population, ((Species)value).getPopulation().toArray(), Population.class);
- childNode.add(population);
- node.add(childNode);
- }
- }
- protected void setNode (DefaultMutableTreeNode node, Object[] values, Class type) {
- for (Object value : values){
- DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new GenericCell(value.toString(), value, type));
- node.add(childNode);
- }
- }
- protected void setTreeSelection(TopiaEntity topia, Class type){
- String name = null;
- if (topia != null){
- if (type == Zone.class){
- name = ((Zone) topia).getName();
- } else if (type == Cell.class){
- name = ((Cell) topia).getName();
- } else if (type == Port.class){
- name = ((Port) topia).getName();
- } else if (type == Species.class){
- name = ((Species) topia).getName();
- } else if (type == Population.class){
- name = ((Population) topia).getName();
- } else if (type == Gear.class){
- name = ((Gear) topia).getName();
- } else if (type == Metier.class){
- name = ((Metier) topia).getName();
- } else if (type == TripType.class){
- name = ((TripType) topia).getName();
- } else if (type == VesselType.class){
- name = ((VesselType) topia).getName();
- } else if (type == SetOfVessels.class){
- name = ((SetOfVessels) topia).getName();
- } else if (type == Strategy.class){
- name = ((Strategy) topia).getName();
- }
- }
- DefaultMutableTreeNode element = null;
- element = findNode((DefaultMutableTreeNode) tree.getModel().getRoot(), type, name);
- TreeNode[] path = element.getPath();
- if (log.isDebugEnabled()) {
- log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
- }
- TreePath newSelectionPath = new TreePath(path);
- tree.setSelectionPath(newSelectionPath);
- }
- protected DefaultMutableTreeNode findNode(DefaultMutableTreeNode root, Class type, String name){
- DefaultMutableTreeNode result = null;
- for (Enumeration e = root.children(); e.hasMoreElements();){
- DefaultMutableTreeNode node = (DefaultMutableTreeNode)e.nextElement();
- GenericCell g = (GenericCell)node.getUserObject();
- if (type == g.getType()){
- result = node;
- if (name != null){
- for (e = result.children(); e.hasMoreElements();){
- node = (DefaultMutableTreeNode)e.nextElement();
- g = (GenericCell)node.getUserObject();
- if (name.equals(g.getName())){
- result = node;
- break;
- }
- }
- }
- }
- }
- return result;
- } */
protected void setTreeModel(){
String regionName = getContextValue(InputAction.class).getFisheryRegionName();
FisheryRegion fisheryRegion = getContextValue(InputAction.class).getFisheryRegion();
- setContextValue(fisheryRegion);
- NavigationTreeModel model = InputNavigationTreeSelectionAdapter.getTreeModel(regionName, fisheryRegion);
- navigation.setSelectionModel(navigationSelectionModel);
- navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
+ if (fisheryRegion != null){
+ setContextValue(fisheryRegion);
+ NavigationTreeModel model = InputNavigationTreeSelectionAdapter.getTreeModel(regionName, fisheryRegion);
+ navigation.setSelectionModel(navigationSelectionModel);
+ navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
- setContextValue(model);
- navigation.setModel(model);
- new InputNavigationTreeSelectionAdapter(this, true);
- setTreeSelection("$root");
+ setContextValue(model);
+ navigation.setModel(model);
+ new InputNavigationTreeSelectionAdapter(this, true);
+ setTreeSelection("$root");
+ }
}
public void repaintNode(String path){
@@ -264,7 +149,7 @@
setInfoText(_("isisfish.message.creating.region", name));
getContextValue(InputAction.class).newRegion(name);
setInfoText(_("isisfish.message.creating.region", name));
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
fieldCurrentRegion.setSelectedItem(name);
JButtonNewRegion.setEnabled(false);
setInfoText(_("isisfish.message.creation.finished"));
@@ -274,17 +159,17 @@
}
protected void importRegion(){
setInfoText(_("isisfish.message.import.zip" + getContextValue(InputAction.class).importRegion()));
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.import.finished"));
}
protected void importRegionAndRename(){
setInfoText(_("isisfish.message.import.zip" + getContextValue(InputAction.class).importRegionAndRename()));
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.import.finished"));
}
protected void importV2Region(){
setInfoText(_("isisfish.message.import.xml.v2.file") + getContextValue(InputAction.class).importV2Region());
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.import.finished"));
}
protected void importRegionFromSimulation(){
@@ -292,17 +177,17 @@
}
protected void exportRegion(){
setInfoText(_("isisfish.message.export.zip", getContextValue(InputAction.class).exportRegion()));
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.export.done"));
}
protected void copyRegion(){
setInfoText(_("isisfish.message.copy.region", getContextValue(InputAction.class).copyRegion()));
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.copy.finished"));
}
protected void removeRegion(){
setInfoText(_("isisfish.message.removing.region" + getContextValue(InputAction.class).getRegionStorage().getName()));
- fieldCurrentRegion.setModel(getFieldCurrentRegionModel());
+ setFieldCurrentRegionModel();
setInfoText(getContextValue(InputAction.class).removeRegion(false));
}
protected void commitRegionInCVS(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -77,7 +77,6 @@
growthReverseChanged();
basicsGrowthChanged();
setTableAgeLengthModel();
- valueChanged(false);
}
else{
// pop = (Population) getContextValue(InputAction.class).create("Population");
@@ -91,7 +90,6 @@
basicsGrowthChanged();
DefaultTableModel tableModel = new DefaultTableModel();
tableAgeLength.setModel(tableModel);
- valueChanged(false);
}
}
@@ -198,6 +196,7 @@
} else {
wizard.setCard("beginGroupLength");
}
+ valueChanged(true);
refresh();
}
}
@@ -217,26 +216,30 @@
}
}
protected void saveGrowthModel(){
- Equation e = getEquation();
- if (e != null){
- getContextValue(InputAction.class).saveAsModel(e.getCategory(), e.getLanguage(), e.getContent());
- }
+ getContextValue(InputAction.class).saveAsModel("Population", "Java", editor.getText());
+ setFieldPopulationBasicsGrowthModel();
+ setInfoText(_("isisfish.message.saveModel.finished"));
+// Equation e = getEquation();
+// if (e != null){
+// getContextValue(InputAction.class).saveAsModel(e.getCategory(), e.getLanguage(), e.getContent());
+// }
}
protected void openGrowthEditor(){
- Equation e = getEquation();
- if (e != null){
- getContextValue(InputAction.class).openEditor(e.getCategory(), e.getName(), fr.ifremer.isisfish.equation.PopulationGrowth.class, e.getContent(), editor);
- }
+ getContextValue(InputAction.class).openEditor("PopulationGrowth","new",fr.ifremer.isisfish.equation.PopulationGrowth.class, editor.getText(), editor);
+// Equation e = getEquation();
+// if (e != null){
+// getContextValue(InputAction.class).openEditor(e.getCategory(), e.getName(), fr.ifremer.isisfish.equation.PopulationGrowth.class, e.getContent(), editor);
+// }
}
protected void growthReverseChanged(){
- Equation f = getEquation();
+ Equation f = getReverseEquation();
if (f != null){
editorReverse.setText(f.getContent());
}
}
protected void saveGrowthReverseModel(){
-
getContextValue(InputAction.class).saveAsModel("Population", "Java", editor.getText());
+ setfieldPopulationBasicsGrowthReverseModel();
setInfoText(_("isisfish.message.saveModel.finished"));
// Equation e = getEquation();
// if (e != null){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -56,9 +56,8 @@
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.topia.TopiaException;
- protected IsisMapBean portMap = null;
- protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
+ protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OpenMapEvents mapListener = null;
public PortUI (InputAction action){
@@ -93,16 +92,13 @@
}
+ portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
if(portMap == null){
- portMap = new IsisMapBean();
portMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
portMap.setActiveMouseMode(new SelectMouseMode());
- portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
toolSet.setupListeners(portMap);
toolMap.add((Component)toolSet);
setMapListener();
- portMapPanel.add(toolMap, BorderLayout.NORTH);
- portMapPanel.add(portMap, BorderLayout.CENTER);
}
refreshMap();
}
@@ -110,7 +106,6 @@
java.util.List<Cell> cells = new ArrayList<Cell>();
cells.add((Cell)portCell.getSelectedValue());
portMap.setSelectedCells(cells);
- portMap.setSelectedCells(cells);
}
protected void setMapListener(){
if (mapListener == null){
@@ -242,7 +237,7 @@
</cell>
</row>
</Table>
- <JPanel id="portMapPanel" layout='{new BorderLayout()}'/>
+ <fr.ifremer.isisfish.map.IsisMapBean id='portMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
</JSplitPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -56,9 +56,9 @@
protected double step = 1;
protected PopulationBasicsUI popBasic;
-
+// setCard("endInputGroupLength");
public WizardGroupCreationUI(InputAction action, PopulationBasicsUI p){
-
+
setContextValue(action);
popBasic = p;
}
@@ -341,11 +341,83 @@
setSameSizeType(beginGroupLengthTypeSameSize.isSelected());
setGrowthCurveType(beginGroupLengthTypeGrowthCurve.isSelected());
}
+ protected void stepChanged(){
+ if (!fieldStep.getText().equals("")){
+ setStep(Double.parseDouble(fieldStep.getText()));
+ }
+ }
+ protected void firstAgeChanged(){
+ if (!firstAge.getText().equals("")){
+ setFirst(Double.parseDouble(firstAge.getText()));
+ }
+ }
+ protected void lastAgeChanged(){
+ if(!lastAge.getText().equals("")){
+ setLast(Double.parseDouble(lastAge.getText()));
+ }
+ }
+ protected void firstInputLengthChanged(){
+ if(!firstInputLength.getText().equals("")){
+ setFirst(Double.parseDouble(firstInputLength.getText()));
+ }
+ }
+ protected void maximalGroupsLengthChanged(){
+ if(!maximalGroupsLength.getText().equals("")){
+ setMaxLength(maximalGroupsLength.getText());
+ }
+ }
+ protected void firstSizeLengthChanged(){
+ if(!firstSizeLength.getText().equals("")){
+ setFirst(Double.parseDouble(firstSizeLength.getText()));
+ }
+ }
+ protected void sameSizeNumberOfGroupChanged(){
+ if(!sameSizeNumberOfGroup.getText().equals("")){
+ setNumberOfGroup(Integer.parseInt(sameSizeNumberOfGroup.getText()));
+ }
+ }
+ protected void groupWidthChanged(){
+ if(!groupWidth.getText().equals("")){
+ setGroupSize(Double.parseDouble(groupWidth.getText()));
+ }
+ }
+ protected void growthCurveFirstGroupChanged(){
+ if(!growthCurveFirstGroup.getText().equals("")){
+ setFirst(Double.parseDouble(growthCurveFirstGroup.getText()));
+ }
+ }
+ protected void fieldNumberOfGroupChanged(){
+ if(!fieldNumberOfGroup.getText().equals("")){
+ setNumberOfGroup(Integer.parseInt(fieldNumberOfGroup.getText()));
+ }
+ }
]]>
</script>
<JPanel id="wizardPanels" layout='{new CardLayout()}' constraints='BorderLayout.CENTER'>
- <Table constraints='"singleGroupAge"'>
+ <Table constraints='"beginGroupLength"'>
<row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JLabel text="isisfish.wizardGroupCreation.selectGroupLengthType" horizontalAlignment="CENTER"/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JRadioButton id="beginGroupLengthTypeInput" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.allValues" onActionPerformed='refreshChoice()'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JRadioButton id="beginGroupLengthTypeSameSize" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.allGroupsSameSize" onActionPerformed='refreshChoice()'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JRadioButton id="beginGroupLengthTypeGrowthCurve" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.computedGrowthCurve" onActionPerformed='refreshChoice()'/>
+ </cell>
+ </row>
+ </Table>
+ <Table constraints='"singleGroupAge"'>
+ <row>
<cell fill='horizontal' weightx='1.0' columns='2'>
<JLabel text="isisfish.wizardGroupCreation.populationCharacteristics" horizontalAlignment="CENTER"/>
</cell>
@@ -355,7 +427,7 @@
<JLabel text="isisfish.wizardGroupCreation.firstAge"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="firstAge" onKeyTyped='setFirst(Double.parseDouble(firstAge.getText()))'/>
+ <JTextField id="firstAge" onFocusLost=''/>
</cell>
</row>
<row>
@@ -363,7 +435,7 @@
<JLabel text="isisfish.wizardGroupCreation.lastAge"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="lastAge" onFocusLost='setLast(Double.parseDouble(lastAge.getText()))'/>
+ <JTextField id="lastAge" onFocusLost='lastAgeChanged()'/>
</cell>
</row>
<row>
@@ -382,28 +454,6 @@
</cell>
</row>
</Table>
- <Table constraints='"beginGroupLength"'>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JLabel text="isisfish.wizardGroupCreation.selectGroupLengthType" horizontalAlignment="CENTER"/>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JRadioButton id="beginGroupLengthTypeInput" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.allValues" onActionPerformed='refreshChoice()'/>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JRadioButton id="beginGroupLengthTypeSameSize" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.allGroupsSameSize" onActionPerformed='refreshChoice()'/>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JRadioButton id="beginGroupLengthTypeGrowthCurve" buttonGroup="groupLengthType" text="isisfish.wizardGroupCreation.computedGrowthCurve" onActionPerformed='refreshChoice()'/>
- </cell>
- </row>
- </Table>
<Table constraints='"endInputGroupLength"'>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
@@ -415,7 +465,7 @@
<JLabel text="isisfish.wizardGroupCreation.firstLength"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="firstInputLength" onFocusLost='setFirst(Double.parseDouble(firstInputLength.getText()))'/>
+ <JTextField id="firstInputLength" onFocusLost='firstInputLengthChanged()'/>
</cell>
</row>
<row>
@@ -423,7 +473,7 @@
<JLabel text="isisfish.wizardGroupCreation.maxGroupsLength"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="maximalGroupsLength" onKeyTyped='setMaxLength(maximalGroupsLength.getText())'/>
+ <JTextField id="maximalGroupsLength" onFocusLost='maximalGroupsLengthChanged()'/>
</cell>
</row>
<row>
@@ -443,7 +493,7 @@
<JLabel text="isisfish.wizardGroupCreation.firstLength"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="firstSizeLength" onFocusLost='setFirst(Double.parseDouble(firstSizeLength.getText()))'/>
+ <JTextField id="firstSizeLength" onFocusLost='firstSizeLengthChanged()'/>
</cell>
</row>
<row>
@@ -451,7 +501,7 @@
<JLabel text="isisfish.wizardGroupCreation.numberGroup"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="sameSizeNumberOfGroup" onFocusLost='setNumberOfGroup(Integer.parseInt(sameSizeNumberOfGroup.getText()))'/>
+ <JTextField id="sameSizeNumberOfGroup" onFocusLost='sameSizeNumberOfGroupChanged()'/>
</cell>
</row>
<row>
@@ -459,7 +509,7 @@
<JLabel text="isisfish.wizardGroupCreation.groupWidth"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="groupWidth" onFocusLost='setGroupSize(Double.parseDouble(groupWidth.getText()))'/>
+ <JTextField id="groupWidth" onFocusLost='groupWidthChanged()'/>
</cell>
</row>
<row>
@@ -489,7 +539,7 @@
<JLabel text="isisfish.wizardGroupCreation.firstGroup"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="growthCurveFirstGroup" onFocusLost='setFirst(Double.parseDouble(growthCurveFirstGroup.getText()))'/>
+ <JTextField id="growthCurveFirstGroup" onFocusLost='growthCurveFirstGroupChanged()'/>
</cell>
</row>
<row>
@@ -497,7 +547,7 @@
<JLabel text="isisfish.wizardGroupCreation.numberGroups"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldNumberOfGroup" onFocusLost='setNumberOfGroup(Integer.parseInt(fieldNumberOfGroup.getText()))'/>
+ <JTextField id="fieldNumberOfGroup" onFocusLost='fieldNumberOfGroupChanged()'/>
</cell>
</row>
<row>
@@ -505,7 +555,7 @@
<JLabel text="isisfish.wizardGroupCreation.timeStep"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldStep" onFocusLost='setStep(Double.parseDouble(fieldStep.getText()))'/>
+ <JTextField id="fieldStep" onFocusLost='stepChanged()'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -58,7 +58,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
- protected IsisMapBean zoneMap = null;
protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
protected MapMouseListener mapListener = null;
@@ -103,16 +102,13 @@
fieldZoneName.setText("");
fieldZoneComment.setText("");
}
+ zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
if (zoneMap == null){
- zoneMap = new IsisMapBean();
zoneMap.setActiveMouseMode(new SelectMouseMode(false));
zoneMap.setSelectionMode(CellSelectionLayer.MULT_SELECTION);
- zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
toolSet.setupListeners(zoneMap);
toolMap.add((Component)toolSet);
setMapListener();
- zoneMapPanel.add(toolMap, BorderLayout.NORTH);
- zoneMapPanel.add(zoneMap, BorderLayout.CENTER);
}
refreshMap();
}
@@ -254,7 +250,7 @@
</cell>
</row>
</Table>
- <JPanel enabled='{isActif()}' id="zoneMapPanel" layout='{new BorderLayout()}'/>
+ <fr.ifremer.isisfish.map.IsisMapBean id='zoneMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()'/>
</JSplitPane>
</cell>
</row>
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 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -33,6 +33,7 @@
<Table>
<script><![CDATA[
+ import jaxx.runtime.swing.Item;
refresh();
public ExportUI (SimulAction action){
@@ -40,10 +41,20 @@
}
public void refresh(){
fieldSimulExportFolder.setText(getContextValue(SimulAction.class).getSimulationParameter().getExportDirectory());
- listSimulExportChoose.setModel(getListSimulExportChooseModel());
+ setListSimulExportChooseModel();
}
- protected DefaultComboBoxModel getListSimulExportChooseModel(){
- return new DefaultComboBoxModel(getContextValue(SimulAction.class).getExportNames().toArray());
+ protected void setListSimulExportChooseModel(){
+ java.util.List<String> values = getContextValue(SimulAction.class).getExportNames();
+ java.util.List<String> selectedValue = getContextValue(SimulAction.class).getSimulationParameter().getExportNames();
+ java.util.List<Item> items = new ArrayList<Item>();
+ for (String s : values){
+ boolean selected = false;
+ for (String sv : selectedValue){
+ selected = sv.equals(s);
+ }
+ items.add(new Item(s, s, s, selected));
+ }
+ listSimulExportChoose.setItems(items);
}
protected void exportChanged(){
if (listSimulExportChoose.getSelectedIndex() > -1){
@@ -60,7 +71,7 @@
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="1.0">
<JScrollPane>
- <JList id="listSimulExportChoose" selectionMode="2" model='{getListSimulExportChooseModel()}' onValueChanged='exportChanged()'/>
+ <JList id="listSimulExportChoose" selectionMode="2" onValueChanged='exportChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -564,4 +564,4 @@
</Table>
</cell>
</row>
-</Table>
\ No newline at end of file
+</Table>
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 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2008-12-19 13:45:22 UTC (rev 1702)
@@ -33,15 +33,26 @@
<JPanel id="ResultChoice" name="isisfish.resultChoice.title" layout='{new BorderLayout()}'>
<script><![CDATA[
import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import jaxx.runtime.swing.Item;
public ResultChoiceUI (SimulAction action){
setContextValue(action);
}
public void refresh(){
- listResultNames.setModel(getListResultNameModel());
+ setListSimulExportChooseModel();
}
- protected DefaultComboBoxModel getListResultNameModel(){
- return new DefaultComboBoxModel(getContextValue(SimulAction.class).getResultNames().toArray());
+ protected void setListSimulExportChooseModel(){
+ java.util.List<String> values = getContextValue(SimulAction.class).getResultNames();
+ java.util.List<String> selectedValue = getContextValue(SimulAction.class).getDefaultResultNames();
+ java.util.List<Item> items = new ArrayList<Item>();
+ for (String s : values){
+ boolean selected = false;
+ for (String sv : selectedValue){
+ selected = sv.equals(s);
+ }
+ items.add(new Item(s, s, s, selected));
+ }
+ listResultNames.setItems(items);
}
protected void saveResultNames(){
if (listResultNames.getSelectedIndex() != -1){
@@ -57,7 +68,7 @@
</script>
<JLabel text="isisfish.resultChoice.save" horizontalAlignment="0" constraints='BorderLayout.NORTH'/>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JList id="listResultNames" selectionMode="2" model='{getListResultNameModel()}'/>
+ <JList id="listResultNames" selectionMode="2"/>
</JScrollPane>
<JButton constraints='BorderLayout.SOUTH' text="isisfish.common.saveNextSimulation" onActionPerformed='saveResultNames()'/>
</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-19 13:42:41 UTC (rev 1701)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-19 13:45:22 UTC (rev 1702)
@@ -463,7 +463,7 @@
*/
// Gestion des TagValues
-
+
public void addTagValue(String tag, String value) {
param.getTagValue().put(tag, value);
}
@@ -509,7 +509,10 @@
resultNamesString.add(o.toString());
}
IsisFish.config.setDefaultResultNames(resultNamesString);
- }
+ }
+ public List<String> getDefaultResultNames(){
+ return IsisFish.config.getDefaultResultNamesAsList();
+ }
/**
************
1
0
r1701 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
by chatellier@users.labs.libre-entreprise.org 19 Dec '08
19 Dec '08
Author: chatellier
Date: 2008-12-19 13:42:41 +0000 (Fri, 19 Dec 2008)
New Revision: 1701
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
Log:
Re enable stop simulation binding
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2008-12-18 17:31:10 UTC (rev 1700)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2008-12-19 13:42:41 UTC (rev 1701)
@@ -61,6 +61,13 @@
Binding binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_WRITE, SimulationService.getService(), ELProperty.create("${autoLaunch}"),autoLaunchButton, BeanProperty.create("selected"));
bindingGroup.addBinding(binding);
+ // binding for stop simulation button
+ binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ,queueTable, ELProperty.create("${selectedElement != null}"),stopSimuButton, BeanProperty.create("enabled"));
+ binding.setSourceNullValue(false);
+ binding.setSourceUnreadableValue(false);
+ bindingGroup.addBinding(binding);
+
+ // binding for view log button
binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, queueTableDone, ELProperty.create("${selectedElement != null}"), showLogButton, BeanProperty.create("enabled"));
binding.setSourceNullValue(false);
binding.setSourceUnreadableValue(false);
1
0
r1700 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 18 Dec '08
by chatellier@users.labs.libre-entreprise.org 18 Dec '08
18 Dec '08
Author: chatellier
Date: 2008-12-18 17:31:10 +0000 (Thu, 18 Dec 2008)
New Revision: 1700
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx
Log:
Use i18n _ for translation
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 2008-12-18 17:08:40 UTC (rev 1699)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2008-12-18 17:31:10 UTC (rev 1700)
@@ -46,7 +46,7 @@
protected void saveResultNames(){
if (listResultNames.getSelectedIndex() != -1){
getContextValue(SimulAction.class).saveResultNames(listResultNames.getSelectedValues());
- setInfoText("isisfish.resultChoice.saved");
+ setInfoText(_("isisfish.resultChoice.saved"));
}
}
protected void setInfoText(String txt){
1
0