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
December 2008
- 3 participants
- 82 discussions
r1652 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 09 Dec '08
by chatellier@users.labs.libre-entreprise.org 09 Dec '08
09 Dec '08
Author: chatellier
Date: 2008-12-09 16:35:11 +0000 (Tue, 09 Dec 2008)
New Revision: 1652
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Erreur i18n
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-09 16:23:12 UTC (rev 1651)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-09 16:35:11 UTC (rev 1652)
@@ -216,6 +216,7 @@
isisfish.error.add.tray=Impossible d'ajouter une icone de notification
isisfish.error.change.classloader=Can't change classloader because can't create URL from file %1$s
isisfish.error.change.equation=Can't change equation
+isisfish.error.check.region=
isisfish.error.compile.script=Can't compile script\: %1$s
isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
@@ -318,6 +319,7 @@
isisfish.error.remove.directory=Can't remove directory %1$s
isisfish.error.rename.region=Can't rename region to %1$s
isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: %1$s
+isisfish.error.save.region=
isisfish.error.save.script.compilation=Can't save script to compilation\: %1$s
isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
isisfish.error.script.create=isisfish.error.script.create
@@ -516,7 +518,10 @@
isisfish.message.backup.database.progress=backup database in progress
isisfish.message.cancel.finished=Cancel finished
isisfish.message.check.finished=v\u00E9rification termin\u00E9e
+isisfish.message.check.region=
+isisfish.message.checking.cell=
isisfish.message.choose.archive=choose archive file or directory
+isisfish.message.commit=
isisfish.message.commit.cancelled=commit annul\u00E9
isisfish.message.commit.finished=commit termin\u00E9
isisfish.message.commit.region.canceled=Commit de la r\u00E9gion annul\u00E9
@@ -558,7 +563,7 @@
isisfish.message.new.filename=Entrer le nom du nouveau du fichier.\n\t (utiliser uniquemment des caract\u00E8res et _ en commencant avec une majuscule)
isisfish.message.new.region.name=Entrer le nom de la nouvell r\u00E9gion
isisfish.message.no.diff=Pas de diff\u00E9rences trouv\u00E9s pour le fichier %1$s, \u00E9tant un '%2$s'
-isisfish.message.old.simulation.loaded=Anicenne simulation charg\uE009e
+isisfish.message.old.simulation.loaded=Ancienne simulation charg\u00E9e
isisfish.message.page.modified=Cette page a \u00E9t\u00E9 modifi\u00E9, voulez-vous la sauvegarder ?
isisfish.message.presimulation.script.execution=Ex\u00E9cution des scripts de Presimulation
isisfish.message.recruitment.number.month=Input the number of month of recruitment
@@ -568,6 +573,7 @@
isisfish.message.region.removed=R\u00E9gion supprim\u00E9e
isisfish.message.remove.canceled=Suppression annul\u00E9e
isisfish.message.remove.finished=Suppresison termin\u00E9
+isisfish.message.remove.unnecessary.cells=
isisfish.message.removing.region=Suppression de lar\u00E9gion %1$s ...
isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
isisfish.message.save.finished=sauvegarde termin\u00E9e
1
0
Author: chatellier
Date: 2008-12-09 16:23:12 +0000 (Tue, 09 Dec 2008)
New Revision: 1651
Modified:
isis-fish/trunk/go.sh
Log:
Correct go.sh
Modified: isis-fish/trunk/go.sh
===================================================================
--- isis-fish/trunk/go.sh 2008-12-09 15:42:41 UTC (rev 1650)
+++ isis-fish/trunk/go.sh 2008-12-09 16:23:12 UTC (rev 1651)
@@ -1,7 +1,6 @@
#!/bin/sh
-#JAVA="/opt/repository/jdk1.6.0/bin/java -splash:src/resources/images/splash2.jpg"
-#JAVA="java -Djava.library.path=lib -splash:src/resources/images/splash2.jpg"
+# Java executable
JAVA=java
TEMP=`getopt -o dnt:: --long debug,nosuspend,trace:: \
@@ -27,7 +26,7 @@
-t|--trace)
echo "Trace mode"
case "$2" in
- "") TRACE_FILE="-Daspectwerkz.definition.file=$rep/src/resources/trace-aop.xml" # -Daspectwerkz.transform.verbose=true" # -Daspectwerkz.transform.details=true"
+ "") TRACE_FILE="-Daspectwerkz.definition.file=$rep/src/main/resources/trace-aop.xml" # -Daspectwerkz.transform.verbose=true" # -Daspectwerkz.transform.details=true"
;;
*) TRACE_FILE="-Daspectwerkz.definition.file=$2" # -Daspectwerkz.transform.verbose=true" # -Daspectwerkz.transform.details=true"
esac
@@ -59,7 +58,7 @@
fi
aspectwerkz=""
-CL=$rep/target/classes #:$rep/target/isis-fish-3.0.0.jar
+CL=$rep/target/classes #:$rep/target/$RELEASE.jar
for f in $rep/target/lib/*.jar; do
CL=$CL:$f
if [ -n "$(echo $f | grep aspectwerkz-jdk5)" ]; then
1
0
Author: chatellier
Date: 2008-12-09 15:42:41 +0000 (Tue, 09 Dec 2008)
New Revision: 1650
Modified:
isis-fish/trunk/go.sh
Log:
Correct go.sh
Modified: isis-fish/trunk/go.sh
===================================================================
--- isis-fish/trunk/go.sh 2008-12-09 14:19:46 UTC (rev 1649)
+++ isis-fish/trunk/go.sh 2008-12-09 15:42:41 UTC (rev 1650)
@@ -67,7 +67,7 @@
fi
done
-LOG="-Dlog4j.configuration=file:$rep/src/resources/log4j.properties" # -Dlog4j.debug"
+LOG="-Dlog4j.configuration=file:$rep/src/main/resources/log4j.properties" # -Dlog4j.debug"
echo $JAVA -Xmx$MX -Xms$MX -classpath $CL $NOaspectwerkz $TRACE_FILE $LOG $JVM_OPT $DEBUG fr.ifremer.isisfish.IsisFish "$@"
$JAVA -Xmx$MX -Xms$MX -classpath $CL $NOaspectwerkz $TRACE_FILE $LOG $JVM_OPT $DEBUG fr.ifremer.isisfish.IsisFish "$@"
#$JAVA -Xmx$MX -Xms$MX -classpath $CL $NOaspectwerkz $TRACE_FILE $LOG $JVM_OPT $DEBUG fr.ifremer.isisfish.ui.update.Counter "$@"
1
0
Author: chatellier
Date: 2008-12-09 14:19:46 +0000 (Tue, 09 Dec 2008)
New Revision: 1649
Modified:
isis-fish/trunk/go.sh
Log:
Correct go.sh
Modified: isis-fish/trunk/go.sh
===================================================================
--- isis-fish/trunk/go.sh 2008-12-09 13:49:41 UTC (rev 1648)
+++ isis-fish/trunk/go.sh 2008-12-09 14:19:46 UTC (rev 1649)
@@ -54,13 +54,13 @@
mvn -o compile jar:jar
fi
-if [ ! -d $rep/target/dependency ]; then
+if [ ! -d $rep/target/lib ]; then
mvn -o dependency:copy-dependencies
fi
aspectwerkz=""
CL=$rep/target/classes #:$rep/target/isis-fish-3.0.0.jar
-for f in $rep/target/dependency/*.jar; do
+for f in $rep/target/lib/*.jar; do
CL=$CL:$f
if [ -n "$(echo $f | grep aspectwerkz-jdk5)" ]; then
aspectwerkz="-javaagent:$f"
@@ -68,5 +68,6 @@
done
LOG="-Dlog4j.configuration=file:$rep/src/resources/log4j.properties" # -Dlog4j.debug"
+echo $JAVA -Xmx$MX -Xms$MX -classpath $CL $NOaspectwerkz $TRACE_FILE $LOG $JVM_OPT $DEBUG fr.ifremer.isisfish.IsisFish "$@"
$JAVA -Xmx$MX -Xms$MX -classpath $CL $NOaspectwerkz $TRACE_FILE $LOG $JVM_OPT $DEBUG fr.ifremer.isisfish.IsisFish "$@"
#$JAVA -Xmx$MX -Xms$MX -classpath $CL $NOaspectwerkz $TRACE_FILE $LOG $JVM_OPT $DEBUG fr.ifremer.isisfish.ui.update.Counter "$@"
1
0
r1648 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish resources/i18n
by chatellier@users.labs.libre-entreprise.org 09 Dec '08
by chatellier@users.labs.libre-entreprise.org 09 Dec '08
09 Dec '08
Author: chatellier
Date: 2008-12-09 13:49:41 +0000 (Tue, 09 Dec 2008)
New Revision: 1648
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Update vcs update messages and switch
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2008-12-09 13:49:16 UTC (rev 1647)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2008-12-09 13:49:41 UTC (rev 1648)
@@ -193,26 +193,29 @@
public boolean canDoAction(VCS vcs, VCSActionEvent action, File... files) {
boolean result = true;
if (action == VCSActionEvent.SWITCH_PROTOCOL) {
- result = ask(_("Protocol to access repository script has changed.\n" +
- "Do you want to switch your repository ?"));
+ result = ask(_("isisfish.vcs.switchprotocol.confirm"));
if (!result) {
// l'utilisateur ne souhaite pas changer de protocol,
// on force le repo en read-only pour eviter les erreurs
vcs.setWriteable(false);
}
} else if (action == VCSActionEvent.SWITCH) {
- result = ask(_("You don't use correction repository script for" +
- " your application version %s.\nDo you want to switch" +
- " your repository ?", IsisConfig.getVersion()));
+ result = ask(_("isisfish.vcs.switchversion.confirm", IsisConfig.getVersion()));
if (!result) {
// l'utilisateur ne souhaite pas changer de branche,
// on force le repo en read-only pour eviter les erreurs
vcs.setWriteable(false);
}
} else if (action == VCSActionEvent.UPDATE_REPOSITORY) {
- result = ask(_("Your repository is not up to date.\n" +
- "Do you want to update your repository ?\n\n" +
- "Remote modified file is\n%s", Arrays.toString(files)));
+
+ // consctuit une chaine plutot qu'un Arrays.toString() qui
+ // est illisible
+ String modifiedFiles = "";
+ for(File file : files) {
+ modifiedFiles += " - " + file.toString() + "\n";
+ }
+
+ result = ask(_("isisfish.vcs.updaterepository.confirm", modifiedFiles));
}
return result;
}
@@ -224,7 +227,7 @@
* quit l'application
*
* @param msg
- * @return
+ * @return true if user confirm question
*/
public static boolean ask(String msg) {
boolean result = true;
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-09 13:49:16 UTC (rev 1647)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-09 13:49:41 UTC (rev 1648)
@@ -46,7 +46,6 @@
No\ database\ version\ %s\ found\ and\ can't\ get\ it.\\n=
Normal\ stop\ thread,\ this\ is\ not\ an\ error=
Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
-Protocol\ to\ access\ repository\ script\ has\ changed.\\n=
Region\ %s\ allready\ exist\ in\ repository.\ Cant\ import=
Region\ %s\ already\ inited=
Rename\ data\ directory\ to\ %s=
@@ -62,9 +61,7 @@
The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
-You\ don't\ use\ correction\ repository\ script\ for=
Your\ database\ repository\:\ %s\\n\ don't\ use\ correct=
-Your\ repository\ is\ not\ up\ to\ date.\\n=
add\ %s\ as\ updated\ file=
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
@@ -902,6 +899,8 @@
isisfish.vcs.commit.cancel=vcs.commit.cancel
isisfish.vcs.commit.label=vcs.commit.label
isisfish.vcs.commit.ok=vcs.commit.ok
+isisfish.vcs.switchprotocol.confirm=Protocol to access repository script has changed.\nDo you want to switch your repository ?
+isisfish.vcs.switchversion.confirm=You don't use correct repository script for your application version %s.\nDo you want to switch your repository ?
isisfish.vcs.update=vcs.update
isisfish.vcs.update.cancel=cancel
isisfish.vcs.update.checkAll=checkAll
@@ -928,6 +927,7 @@
isisfish.vcs.updateconfirm.label2=
isisfish.vcs.updateconfirm.ok=ok
isisfish.vcs.updateconfirm.tooltip.checkAll=
+isisfish.vcs.updaterepository.confirm=Your repository is not up to date.\nDo you want to update your repository ?\n\nRemote modified file is \:\n%s
isisfish.versionStorage.removed=Removed
isisfish.vesselType.activityRange=Activity range
isisfish.vesselType.comments=Comments
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-09 13:49:16 UTC (rev 1647)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-09 13:49:41 UTC (rev 1648)
@@ -46,7 +46,6 @@
No\ database\ version\ %s\ found\ and\ can't\ get\ it.\\n=
Normal\ stop\ thread,\ this\ is\ not\ an\ error=
Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
-Protocol\ to\ access\ repository\ script\ has\ changed.\\n=
Region\ %s\ allready\ exist\ in\ repository.\ Cant\ import=
Region\ %s\ already\ inited=La r\u00E9gion %s a d\u00E9j\u00E0 \u00E9t\u00E9 initialis\u00E9e
Rename\ data\ directory\ to\ %s=
@@ -62,9 +61,7 @@
The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
Use\ branches,\ switch\ not\ needed=
User\ stop\ simulation\ %s=
-You\ don't\ use\ correction\ repository\ script\ for=
Your\ database\ repository\:\ %s\\n\ don't\ use\ correct=
-Your\ repository\ is\ not\ up\ to\ date.\\n=
add\ %s\ as\ updated\ file=Ajout du fichier %s
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
@@ -902,6 +899,8 @@
isisfish.vcs.commit.cancel=annuler
isisfish.vcs.commit.label=Entrer quelques mots concernant la modification des scripts
isisfish.vcs.commit.ok=confirmer
+isisfish.vcs.switchprotocol.confirm=Le protocole d'acc\u00E8s au d\u00E9p\u00F4t des scripts a chang\u00E9.\nVoulez-vous changer vers le nouveau d\u00E9p\u00F4t ?
+isisfish.vcs.switchversion.confirm=Vous n'utilisez pas le d\u00E9p\u00F4t correct pour votre version d'Isis-Fish \: %s.\nVoulez-vous changer de d\u00E9p\u00F4t ?
isisfish.vcs.update=R\u00E9sultats de la synchronisation avec le serveur
isisfish.vcs.update.cancel=annuler
isisfish.vcs.update.checkAll=(de)-select tout
@@ -928,6 +927,7 @@
isisfish.vcs.updateconfirm.label2='Etes vous sur de vouloir effectuer ces op\u00E9rations ?'
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.versionStorage.removed=Surim\u00E9
isisfish.vesselType.activityRange=Intervalle d'activit\u00E9
isisfish.vesselType.comments=Commentaires
1
0
r1647 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 09 Dec '08
by sletellier@users.labs.libre-entreprise.org 09 Dec '08
09 Dec '08
Author: sletellier
Date: 2008-12-09 13:49:16 +0000 (Tue, 09 Dec 2008)
New Revision: 1647
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/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
FisheryRegionUI
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-09 13:48:54 UTC (rev 1646)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-09 13:49:16 UTC (rev 1647)
@@ -34,122 +34,341 @@
+ FisheryRegion
+-->
<JPanel id="inputFisheryRegion" layout='{new BorderLayout()}'>
+ <script>
+ <![CDATA[
+ import fr.ifremer.isisfish.entities.FisheryRegion;
+ import com.bbn.openmap.gui.OMToolSet;
+ import fr.ifremer.isisfish.map.IsisMapBean;
+ import fr.ifremer.isisfish.map.OpenMapToolPanel;
+ import fr.ifremer.isisfish.ui.WelcomePanelUI;
+
+ protected boolean changed = false;
+ protected FisheryRegion region = null;
+ protected IsisMapBean cellMap = null;
+ protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
+ protected OMToolSet toolSet = new OMToolSet();
+
+ public FisheryRegionUI(InputAction action){
+ setContextValue(action);
+ }
+ 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();
+ }
+ protected void refreshMap(){
+ cellMap = new IsisMapBean();
+ cellMap.setFisheryRegion(region);
+ cellMap.setSelectionMode(0);
+ toolSet.setupListeners(cellMap);
+ toolMap.add((Component)toolSet);
+ fisheryRegionMapPanel.add(toolMap, BorderLayout.NORTH);
+ fisheryRegionMapPanel.add(cellMap, BorderLayout.CENTER);
+ cellMap.repaint();
+// cellMap.setSelectedCells(cell);
+ }
+ protected void setFieldMapfilesModel(FisheryRegion region){
+ DefaultListModel model = new DefaultListModel();
+ java.util.List<String> mapList = region.getMapFileList();
+ if (mapList != null){
+ int cnt = 0;
+ for (String map : mapList){
+ model.add(cnt, map);
+ cnt++;
+ }
+ }
+ fieldMapfiles.setModel(model);
+ }
+ protected void valueChanged(boolean b){
+ jaxx.runtime.Util.assignment(changed = b, "changed", fr.ifremer.isisfish.ui.input.FisheryRegionUI.this);
+ save.setEnabled(b);
+ cancel.setEnabled(b);
+ }
+ protected void regionChanged(){
+ region.setName(fieldRegion.getText());
+ refreshMap();
+ }
+ protected void latMinChanged(){
+ region.setMinLatitude(Float.parseFloat(fieldLatMin.getText()));
+ refreshMap();
+ }
+ protected void latMaxChanged(){
+ region.setMaxLatitude(Float.parseFloat(fieldLatMax.getText()));
+ refreshMap();
+ }
+ protected void longMinChanged(){
+ region.setMinLongitude(Float.parseFloat(fieldLongMin.getText()));
+ refreshMap();
+ }
+ protected void longMaxChanged(){
+ region.setMaxLongitude(Float.parseFloat(fieldLongMax.getText()));
+ refreshMap();
+ }
+ protected void cellLenghtLatChanged(){
+ region.setCellLengthLatitude(Float.parseFloat(fieldCellLengthLatitude.getText()));
+ refreshMap();
+ }
+ protected void cellLenghtLongChanged(){
+ region.setCellLengthLongitude(Float.parseFloat(fieldCellLengthLongitude.getText()));
+ refreshMap();
+ }
+ protected void mapFieldChanged(){
+ Object[] values = fieldMapfiles.getSelectedValues();
+ java.util.List<String> valuesList = new ArrayList<String>();
+ if (values != null){
+ for (Object o : values){
+ valuesList.add((String)o);
+ }
+ }
+ region.setMapFileList(valuesList);
+ refreshMap();
+ }
+ protected void addMap(){
+ getContextValue(InputAction.class).addMap();
+ refreshMap();
+ }
+ protected void delMap(){
+ getContextValue(InputAction.class).removeMap(fieldMapfiles.getSelectedValues());
+ refreshMap();
+ }
+ protected void commentChanged(){
+ region.setComment(fieldComment.getText());
+ refreshMap();
+ }
+ protected void cellFillChanged(){
+ }
+ protected void cellFile(){
+ getContextValue(InputAction.class).loadCellFile(fieldCellFile.getText());
+ refreshMap();
+ }
+ protected void save(){
+ setMsg(_("isisfish.message.checking.cell"));
+ getContextValue(InputAction.class).saveFisheryRegion("FisheryRegion");
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root");
+ valueChanged(false);
+ setMsg(_("isisfish.message.save.finished"));
+ }
+ protected void cancel(){
+ getContextValue(InputAction.class).cancel("FisheryRegion");
+ valueChanged(false);
+ }
+ protected void check(){
+ getContextValue(InputAction.class).checkFisheryRegion();
+ setMsg(_("isisfish.message.check.region"));
+ }
+ protected void goToCell(){
+ getParentContainer(InputUI.class).setTreeSelection("$root/$cells");
+ }
+ protected void setMsg(String msg){
+ getParentContainer(WelcomePanelUI.class).setInfoText(msg);
+ }
+ ]]>
+ </script>
<JSplitPane id="FisheryRegionTab" name="FisheryRegion"
- oneTouchExpandable="true" dividerLocation="200" orientation="VERTICAL">
- <JPanel name="isisfish.fisheryRegion.title">
-
-<!-- Fixme : ContextDataSource
-<ContextDataSource id="FisheryRegion" context="current" source="FisheryRegion"/>
--->
-
-
+ oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'>
+ <Table>
<!-- Widget -->
- <JLabel text="isisfish.fisheryRegion.name"/>
- <JTextField id="fieldRegion">
+ <row>
+ <cell columns='3'>
+ <JLabel text="isisfish.fisheryRegion.name"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldRegion" onKeyTyped='valueChanged(true)' onFocusLost='regionChanged()'/>
<!-- Fixme : DocumentEvents
origin="$RegionStorage/name"
<DocumentEvents id="updateRegion" onChangedUpdate="Update($fieldRegion/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.fisheryRegion.area"/>
- <JLabel text="isisfish.fisheryRegion.latitude.min"/>
- <JTextField id="fieldLatMin">
+ </cell>
+ </row>
+ <row>
+ <cell columns='3'>
+ <JLabel text="isisfish.fisheryRegion.area"/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.fisheryRegion.latitude.min"/>
+ </cell>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldLatMin" onKeyTyped='valueChanged(true)' onFocusLost='latMinChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/minLatitude"
<DocumentEvents onModified="Update($fieldLatMin/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.fisheryRegion.latitude.max"/>
- <JTextField id="fieldLatMax">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.fisheryRegion.latitude.max"/>
+ </cell>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldLatMax" onKeyTyped='valueChanged(true)' onFocusLost='latMaxChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/maxLatitude"
<DocumentEvents onModified="Update($fieldLatMax/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.fisheryRegion.longitude.min"/>
- <JTextField id="fieldLongMin">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.fisheryRegion.longitude.min"/>
+ </cell>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldLongMin" onKeyTyped='valueChanged(true)' onFocusLost='longMinChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/minLongitude"
<DocumentEvents onModified="Update($fieldLongMin/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.fisheryRegion.longitude.max"/>
- <JTextField id="fieldLongMax">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.fisheryRegion.longitude.max"/>
+ </cell>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldLongMax" onKeyTyped='valueChanged(true)' onFocusLost='longMaxChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/maxLongitude"
<DocumentEvents onModified="Update($fieldLongMax/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.fisheryRegion.spatial"/>
- <JLabel text="isisfish.fisheryRegion.latitude"/>
- <JTextField id="fieldCellLengthLatitude">
+ </cell>
+ </row>
+ <row>
+ <cell columns='3'>
+ <JLabel text="isisfish.fisheryRegion.spatial"/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.fisheryRegion.latitude"/>
+ </cell>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldCellLengthLatitude" onKeyTyped='valueChanged(true)' onFocusLost='cellLenghtLatChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/cellLengthLatitude"
<DocumentEvents onModified="Update($fieldCellLengthLatitude/text)"/>
-->
- </JTextField>
- <JLabel text="isisfish.fisheryRegion.longitude"/>
- <JTextField id="fieldCellLengthLongitude">
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel text="isisfish.fisheryRegion.longitude"/>
+ </cell>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldCellLengthLongitude" onKeyTyped='valueChanged(true)' onFocusLost='cellLenghtLongChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/cellLengthLongitude"
<DocumentEvents onModified="Update($fieldCellLengthLongitude/text)"/>
-->
- </JTextField>
- <JScrollPane>
- <JList id="fieldMapfiles">
-<!-- Fixme : ListModel
- <ListModel origin="$FisheryRegion/mapFileList"/>
--->
- </JList>
- </JScrollPane>
- <JPanel>
- <JButton id="buttonAddMap" text="isisfish.fisheryRegion.addMap"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3' fill='both' weightx='1.0' weighty='0.6'>
+ <JScrollPane>
+ <JList id="fieldMapfiles" onMouseClicked='mapFieldChanged()'/>
+ <!-- Fixme : ListModel
+ <ListModel origin="$FisheryRegion/mapFileList"/>
+ -->
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3' fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id="buttonAddMap" text="isisfish.fisheryRegion.addMap" onActionPerformed='addMap()'/>
<!--
actionCommand="input.InputFisheryRegion.addMap($FisheryRegion, $fieldMapfiles)"
-->
- <JButton id="buttonRemoveMap" text="isisfish.fisheryRegion.delMap"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id="buttonRemoveMap" text="isisfish.fisheryRegion.delMap" onActionPerformed='delMap()'/>
<!--
actionCommand="input.InputFisheryRegion.removeMap($FisheryRegion, $fieldMapfiles)"
-->
- </JPanel>
- <JLabel text="isisfish.fisheryRegion.comments"/>
- <JScrollPane>
- <JTextArea id="fieldComment">
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3'>
+ <JLabel text="isisfish.fisheryRegion.comments"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3' fill='both' weightx='1.0' weighty='0.4'>
+ <JScrollPane>
+ <JTextArea id="fieldComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
<!-- Fixme : DocumentEvents
origin="$FisheryRegion/comment"
<DocumentEvents onModified="Update($fieldComment/text)"/>
-->
- </JTextArea>
- </JScrollPane>
- <JLabel text="isisfish.fisheryRegion.selectFile"/>
- <JLabel text="isisfish.fisheryRegion.ofCells"/>
- <JPanel>
- <JTextField id="fieldCellFile"/>
- <JButton id="buttonCellFile" text="isisfish.common.ellipsis"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3'>
+ <JLabel text="isisfish.fisheryRegion.selectFile"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3'>
+ <JLabel text="isisfish.fisheryRegion.ofCells"/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3' fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell columns='4' fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldCellFile" onKeyTyped='valueChanged(true)' onFocusLost='cellFillChanged()'/>
+ </cell>
+ <cell>
+ <JButton id="buttonCellFile" text="isisfish.common.ellipsis" onActionPerformed='cellFile()'/>
<!--
actionCommand="input.InputFisheryRegion.loadCellFile($fieldCellFile)"
-->
- </JPanel>
- <JPanel id="panelRegionButtonAction">
- <JButton text="isisfish.common.save"/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.3'>
+ <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/>
<!--
origin="$EntityModified"
actionCommand='thread:input.InputFisheryRegion.save("FisheryRegion", $FisheryRegion);refreshView($inputFisheryRegion)'
-->
- <JButton text="isisfish.common.cancel"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.3'>
+ <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
<!--
origin="$EntityModified"
actionCommand='input.Input.cancel("FisheryRegion", $FisheryRegion);refreshView($inputFisheryRegion)'
-->
- <JButton text="isisfish.common.check"/>
+ </cell>
+ <cell fill='horizontal' weightx='0.3'>
+ <JButton id='check' text="isisfish.common.check" onActionPerformed='check()'/>
<!--
actionCommand='thread:input.InputFisheryRegion.check($FisheryRegion)'
-->
- </JPanel>
- </JPanel>
-<!--
- <xpanel xml="input/FisheryRegion.xml"/>
--->
+ </cell>
+ </row>
+ </Table>
<JPanel id="fisheryRegionMapPanel" layout='{new BorderLayout()}'>
<!--
<OpenMapToolPanel constraints='"BorderLayout.NORTH"' id="fisheryRegionMapTool">
@@ -162,7 +381,7 @@
-->
</JPanel>
</JSplitPane>
- <JButton text="isisfish.input.continueCells"/>
+ <JButton text="isisfish.input.continueCells" constraints='BorderLayout.SOUTH' onActionPerformed='goToCell()'/>
<!--
actionCommand="UIHelper.setTreeSelection('Cells')"
-->
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-09 13:48:54 UTC (rev 1646)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-09 13:49:16 UTC (rev 1647)
@@ -44,6 +44,7 @@
import fr.ifremer.isisfish.datastore.StorageException;
import fr.ifremer.isisfish.datastore.update.ImportFromV2;
import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.CellDAO;
import fr.ifremer.isisfish.entities.EffortDescription;
import fr.ifremer.isisfish.entities.EffortDescriptionDAO;
import fr.ifremer.isisfish.entities.Equation;
@@ -69,10 +70,16 @@
import fr.ifremer.isisfish.entities.VesselType;
import fr.ifremer.isisfish.entities.Zone;
import fr.ifremer.isisfish.types.Month;
+import fr.ifremer.isisfish.ui.input.check.CheckRegion;
+import fr.ifremer.isisfish.ui.input.check.CheckResult;
+import fr.ifremer.isisfish.ui.input.check.CheckResultFrame;
import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+import fr.ifremer.isisfish.util.CellPointcomparator;
+import java.awt.geom.Point2D;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
@@ -984,4 +991,177 @@
}
return null;
}
+// FisheryRegion
+ /**
+ * @param list la list dans lequel il faut ajouter la carte
+ */
+ public Object addMap(){
+ log.debug("AddMap called");
+
+ File shp = FileUtil.getFile(".*\\.shp", "shp file");
+ try {
+ if (shp != null) {
+ // copy shp and ssx to region map directory
+ String basename = FileUtil.basename(shp, ".shp");
+
+ String srcMap = shp.getPath();
+ srcMap = srcMap.substring(0, srcMap.length() - ".shp".length());
+ File ssx = new File(srcMap + ".ssx");
+
+ RegionStorage regionStorage = RegionStorage.getRegion(fisheryRegion.getName());
+ File destDir = regionStorage.getMapRepository();
+
+ // copy shp file
+ File destShp = new File(destDir, basename + ".shp");
+ FileUtil.copy(shp, destShp);
+
+ // copy ssx file
+ File destSsx = new File(destDir, basename + ".ssx");
+ if (ssx.exists()) {
+ FileUtil.copy(ssx, destSsx);
+ } else {
+ log.info("Ssx file don't exist, try to generate it");
+ }
+
+ List<String> maps = fisheryRegion.getMapFileList();
+ maps.add(basename);
+ fisheryRegion.setMapFileList(maps);
+ }
+ }catch(Exception eee){
+ log.error("Can't copy .shp or .ssx file for: " + shp, eee);
+ showMsgBox(eee);
+ }
+ return null;
+ }
+
+ /**
+ * @param list la list dans lequel il faut retirer la carte
+ */
+ public Object removeMap(Object[] selectedMaps){
+ log.debug("removeMap called");
+ try {
+
+ List<String> maps = fisheryRegion.getMapFileList();
+
+ RegionStorage regionStorage = RegionStorage.getRegion(fisheryRegion.getName());
+ File mapDir = regionStorage.getMapRepository();
+
+ for (Object map : selectedMaps) {
+ maps.remove(map);
+ // remove on disk too, if possible
+ File shp = new File(mapDir, map + ".shp");
+ shp.delete();
+ File ssx = new File(mapDir, map + ".ssx");
+ ssx.delete();
+ }
+
+ fisheryRegion.setMapFileList(maps);
+
+ }catch(Exception eee){
+ log.error("Can't remove map", eee);
+ showMsgBox(eee);
+ }
+ return null;
+ }
+
+ /**
+ * Affiche une boite de dialogue demandant a l'utilisateur de rentrer
+ * un nom de fichier, et met ce nom dans la textField.
+ * Passe le saveButton en enabled pour marque que la region a ete modifié
+ */
+ public void loadCellFile(String cellFile){
+ log.debug("loadCell called");
+ // FIXME todo loadCellFile
+ }
+
+ public Object saveFisheryRegion(String type){
+ log.debug("save called");
+ try{
+ TopiaContext isisContext = fisheryRegion.getTopiaContext();
+
+// frame.setInfoText(_("isisfish.message.checking.cell"));
+ int latNumber = (int)Math.round((fisheryRegion.getMaxLatitude() - fisheryRegion.getMinLatitude()) / fisheryRegion.getCellLengthLatitude());
+ int lonNumber = (int)Math.round((fisheryRegion.getMaxLongitude() - fisheryRegion.getMinLongitude()) / fisheryRegion.getCellLengthLongitude());
+
+// frame.setProgressMin(0);
+// frame.setProgressMax(latNumber * lonNumber);
+ int progresscpt = 0;
+
+ // il faut peut-etre creer ou supprimer des mailles
+ CellPointcomparator cellPointcomparator = new CellPointcomparator();
+ CellDAO cellPS = IsisFishDAOHelper.getCellDAO(isisContext);
+ List<Cell> cells = cellPS.findAll();
+ Collections.sort(cells, cellPointcomparator);
+ Point2D.Float point = new Point2D.Float();
+
+ for(float lati = fisheryRegion.getMinLatitude();lati<fisheryRegion.getMaxLatitude();lati+=fisheryRegion.getCellLengthLatitude()){
+ lati = Math.round(lati*1000f);
+ lati= lati / 1000.0f;
+ for(float longi = fisheryRegion.getMinLongitude();longi<fisheryRegion.getMaxLongitude();longi+=fisheryRegion.getCellLengthLongitude()){
+ longi = Math.round(longi*1000f) / 1000.0f;
+ point.setLocation(lati, longi);
+ int position = Collections.binarySearch(cells, point, cellPointcomparator);
+ if(position >= 0){
+ // deja existant on l'enleve de la liste, et on ne cree rien
+ cells.remove(position);
+ } else {
+ // n'existe pas on la cree
+ Cell cell = cellPS.create();
+ cell.setName("La"+lati+"Lo"+longi);
+ cell.setLatitude(lati);
+ cell.setLongitude(longi);
+ cell.setLand(false);
+ cell.update();
+ }
+// frame.setProgressValue(++progresscpt);
+ }
+ }
+
+ // on est pas en autoUpdate donc il faut faire le update avant le commit
+ fisheryRegion.update();
+
+ // toutes les mailles restantes dans la liste sont des mailles en trop
+ // on les supprimes
+// frame.setInfoText(_("isisfish.message.remove.unnecessary.cells"));
+// frame.setProgressMin(0);
+// frame.setProgressMax(cells.size());
+ progresscpt = 0;
+ for(Cell cell:cells){
+ // FIXME il faudrait aussi rechercher les objets dependants
+ // des mailles que l'on va supprimer et demander confirmation
+ // a l'utilisateur qu'il souhaite reellement supprimer tous
+ // ces objets. Si ce n'est pas le cas, on sort tout de suite
+ // avant le commit
+ cellPS.delete(cell);
+// frame.setProgressValue(++progresscpt);
+ }
+
+// frame.setInfoText(_("isisfish.message.commit"));
+ isisContext.commitTransaction();
+// frame.refreshView("inputFisheryRegion");
+
+// frame.setInfoText(_("isisfish.message.save.finished"));
+ }catch(Exception eee){
+ log.error(_("isisfish.error.save.region"), eee);
+ showMsgBox(eee);
+ }
+ return null;
+ }
+
+ public Object checkFisheryRegion(){
+ try {
+ log.debug("check called: ");
+// frame.setInfoText(_("isisfish.message.check.region"));
+ CheckResult result = new CheckResult();
+ CheckRegion.check(fisheryRegion, result);
+ CheckResultFrame dialog = new CheckResultFrame();
+ dialog.setCheckResult(result);
+ dialog.setVisible(true);
+ }catch(Exception eee){
+ log.error(_("isisfish.error.check.region"), eee);
+ showMsgBox(eee);
+ }
+ return null;
+ }
+
}
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-09 13:48:54 UTC (rev 1646)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-09 13:49:16 UTC (rev 1647)
@@ -232,7 +232,7 @@
NavigationTreeModelBuilder builder = new NavigationTreeModelBuilder("/");
FisheryRegion fisheryRegion = getContextValue(InputAction.class).getFisheryRegion();
setContextValue(fisheryRegion);
- NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", NoneUI.class, null);
+ NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", FisheryRegionUI.class, null);
NavigationTreeNode cells = builder.build(root, "Cells", "../cell", "$cells", CellUI.class, null);
NavigationTreeNode zones = builder.build(root, "Zones", "../zone", "$zones", ZoneUI.class, null);
NavigationTreeNode ports = builder.build(root, "Ports", "../port", "$ports", PortUI.class, null);
1
0
Author: chatellier
Date: 2008-12-09 13:48:54 +0000 (Tue, 09 Dec 2008)
New Revision: 1646
Modified:
isis-fish/trunk/pom.xml
Log:
Update svnkit
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-08 18:13:52 UTC (rev 1645)
+++ isis-fish/trunk/pom.xml 2008-12-09 13:48:54 UTC (rev 1646)
@@ -264,7 +264,7 @@
<dependency>
<groupId>org.tmatesoft</groupId>
<artifactId>svnkit</artifactId>
- <version>1.2.0.4949</version>
+ <version>1.2.1.5297</version>
<scope>compile</scope>
</dependency>
<!-- fin svnkit pour communication subversion -->
1
0
r1645 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/widget resources/i18n
by sletellier@users.labs.libre-entreprise.org 08 Dec '08
by sletellier@users.labs.libre-entreprise.org 08 Dec '08
08 Dec '08
Author: sletellier
Date: 2008-12-08 18:13:52 +0000 (Mon, 08 Dec 2008)
New Revision: 1645
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.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/PopulationCapturabilityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.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/PopulationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.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/SelectivityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.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:
Debug vol1
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -45,16 +45,16 @@
]]>
</script>
<JTabbedPane id="simulTabs" tabPlacement='{JTabbedPane.LEFT}' constraints="BorderLayout.CENTER">
- <tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/simulation.gif"))}'>
+ <tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/simulation.gif"))}'>
<fr.ifremer.isisfish.ui.simulator.SimulUI id='simulUI' constructorParams='new SimulAction()'/>
</tab>
- <tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/calc.gif"))}'>
+ <tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/calc.gif"))}'>
<fr.ifremer.isisfish.ui.result.ResultView/>
</tab>
- <tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/book.gif"))}'>
+ <tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/book.gif"))}'>
<fr.ifremer.isisfish.ui.input.InputUI constructorParams='new InputAction()'/>
</tab>
- <tab title='isisfish.notitle' icon='{new ImageIcon(getClass().getResource("/images/bookPage.gif"))}'>
+ <tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/bookPage.gif"))}'>
<fr.ifremer.isisfish.ui.script.ScriptUI/>
</tab>
</JTabbedPane>
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -55,14 +55,13 @@
}
protected void refresh() {
Cell cell = getContextValue(InputAction.class).getCell();
+ DefaultComboBoxModel fieldCellModel = new DefaultComboBoxModel();
+ java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
+ for (Cell c : cells){
+ fieldCellModel.addElement(c);
+ }
+ fieldCell.setModel(fieldCellModel);
if (cell != null){
- DefaultComboBoxModel fieldCellModel = new DefaultComboBoxModel();
- java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
- for (Cell c : cells){
- fieldCellModel.addElement(c);
- }
- fieldCell.setModel(fieldCellModel);
-
fieldCellName.setText(cell.getName());
fieldCellLatitude.setText(cell.getLatitude()+"");
fieldCellLongitude.setText(cell.getLongitude()+"");
@@ -77,10 +76,24 @@
cellMap.setSelectedCells(cell);
valueChanged(false);
}
+ else {
+
+ fieldCellName.setText("");
+ fieldCellLatitude.setText("");
+ fieldCellLongitude.setText("");
+ fieldCellComment.setText("");
+
+ cellMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(cellMap);
+ toolMap.add((Component)toolSet);
+ cellMapPanel.add(toolMap, BorderLayout.NORTH);
+ cellMapPanel.add(cellMap, BorderLayout.CENTER);
+ valueChanged(false);
+ }
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Cell");
- getParentContainer(InputUI.class).setTreeSelection(topia, Cell.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
}
@@ -90,7 +103,7 @@
refresh();
}
protected void goToZone(){
- getParentContainer(InputUI.class).setTreeSelection(null, Zone.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
}
protected void valueChanged(boolean b){
changed=b;
@@ -104,7 +117,7 @@
protected void fieldCellChanged(){
Cell c = (Cell)fieldCell.getSelectedItem();
getContextValue(InputAction.class).setValue(c);
- getParentContainer(InputUI.class).setTreeSelection(c, Cell.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
refresh();
valueChanged(true);
}
@@ -140,7 +153,7 @@
<JLabel text="isisfish.cell.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellName" onActionPerformed='nameChanged()'/>
+ <JTextField id="fieldCellName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -169,13 +182,13 @@
</row>
<row>
<cell columns='2' fill='horizontal'>
- <JLabel text="isisfish.cell.comments" onFocusLost='commentChanged()'/>
+ <JLabel text="isisfish.cell.comments"/>
</cell>
</row>
<row>
<cell columns='2' fill='both' weighty='1.0' weightx='1.0'>
<JScrollPane>
- <JTextArea id="fieldCellComment" onKeyPressed='commentChanged()'/>
+ <JTextArea id="fieldCellComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -68,27 +68,47 @@
fieldEffortDescriptionLandingCosts.setText(effort.getLandingCosts() + "");
fieldEffortDescriptionOtherRunningCost.setText(effort.getOtherRunningCost() + "");
}
+ else{
+ DefaultListModel model = new DefaultListModel();
+ fieldEffortDescriptionEffortDescriptionList.setModel(model);
+ fieldEffortDescriptionFishingOperation.setText("");
+ fieldEffortDescriptionFishingOperationDuration.setText("");
+ fieldEffortDescriptionGearsNumberPerOperation.setText("");
+ fieldEffortDescriptionCrewSize.setText("");
+ fieldEffortDescriptionUnitCostOfFishing.setText("");
+ fieldEffortDescriptionFixedCrewSalary.setText("");
+ fieldEffortDescriptionCrewFoodCost.setText("");
+ fieldEffortDescriptionCrewShareRate.setText("");
+ fieldEffortDescriptionRepairAndMaintenanceGearCost.setText("");
+ fieldEffortDescriptionLandingCosts.setText("");
+ fieldEffortDescriptionOtherRunningCost.setText("");
+
+ }
}
}
protected void setEffortDescriptionMetierListModel(){
java.util.List<Metier> metiers = getContextValue(InputAction.class).getFisheryRegion().getMetier();
DefaultListModel model = new DefaultListModel();
- for (Metier m : metiers){
- model.addElement(new GenericCell(m.getName(), m, Metier.class));
+ if (metiers != null){
+ for (Metier m : metiers){
+ model.addElement(new GenericCell(m.getName(), m, Metier.class));
+ }
}
fieldEffortDescriptionMetierList.setModel(model);
}
protected void setEffortDescriptionEffortDescriptionListModel(fr.ifremer.isisfish.entities.SetOfVessels setOfVessels){
Collection<EffortDescription> possibleMetiers = setOfVessels.getPossibleMetiers();
DefaultListModel model = new DefaultListModel();
- for (EffortDescription m : possibleMetiers){
- model.addElement(new GenericCell(m.getPossibleMetiers().getName(), m, EffortDescription.class));
+ if (possibleMetiers != null){
+ for (EffortDescription m : possibleMetiers){
+ model.addElement(new GenericCell(m.getPossibleMetiers().getName(), m, EffortDescription.class));
+ }
}
fieldEffortDescriptionEffortDescriptionList.setModel(model);
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("SetOfVessles");
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.SetOfVessels.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -263,7 +283,7 @@
<JLabel text="isisfish.effortDescription.fishingOperation"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionFishingOperation" onKeyTyped='fishingOperationChanged()'/>
+ <JTextField id="fieldEffortDescriptionFishingOperation" onKeyTyped='valueChanged(true)' onFocusLost='fishingOperationChanged()'/>
</cell>
</row>
<row>
@@ -271,7 +291,7 @@
<JLabel text="isisfish.effortDescription.fishingOperationDuration"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionFishingOperationDuration" onKeyTyped='fishingOperationDurationChanged()'/>
+ <JTextField id="fieldEffortDescriptionFishingOperationDuration" onKeyTyped='valueChanged(true)' onFocusLost='fishingOperationDurationChanged()'/>
</cell>
</row>
<row>
@@ -279,7 +299,7 @@
<JLabel text="isisfish.effortDescription.gearsNumberPerOperation"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionGearsNumberPerOperation" onKeyTyped='gearsNumberPerOperationChanged()'/>
+ <JTextField id="fieldEffortDescriptionGearsNumberPerOperation" onKeyTyped='valueChanged(true)' onFocusLost='gearsNumberPerOperationChanged()'/>
</cell>
</row>
<row>
@@ -287,7 +307,7 @@
<JLabel text="isisfish.effortDescription.crewSize"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionCrewSize" onKeyTyped='descriptionCrewSizeChanged()'/>
+ <JTextField id="fieldEffortDescriptionCrewSize" onKeyTyped='valueChanged(true)' onFocusLost='descriptionCrewSizeChanged()'/>
</cell>
</row>
<row>
@@ -295,7 +315,7 @@
<JLabel text="isisfish.effortDescription.unitCostOfFishing"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionUnitCostOfFishing" onKeyTyped='costOfFishingChanged()'/>
+ <JTextField id="fieldEffortDescriptionUnitCostOfFishing" onKeyTyped='valueChanged(true)' onFocusLost='costOfFishingChanged()'/>
</cell>
</row>
<row>
@@ -303,7 +323,7 @@
<JLabel text="isisfish.effortDescription.fixedCrewSalary"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionFixedCrewSalary" onKeyTyped='fixedCrewSalaryChanged()'/>
+ <JTextField id="fieldEffortDescriptionFixedCrewSalary" onKeyTyped='valueChanged(true)' onFocusLost='fixedCrewSalaryChanged()'/>
</cell>
</row>
<row>
@@ -311,7 +331,7 @@
<JLabel text="isisfish.effortDescription.crewFoodCost"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionCrewFoodCost" onKeyTyped='crewFoodCostChanged()'/>
+ <JTextField id="fieldEffortDescriptionCrewFoodCost" onKeyTyped='valueChanged(true)' onFocusLost='crewFoodCostChanged()'/>
</cell>
</row>
<row>
@@ -319,7 +339,7 @@
<JLabel text="isisfish.effortDescription.crewShareRate"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionCrewShareRate" onKeyTyped='crewShareRateChanged()'/>
+ <JTextField id="fieldEffortDescriptionCrewShareRate" onKeyTyped='valueChanged(true)' onFocusLost='crewShareRateChanged()'/>
</cell>
</row>
<row>
@@ -327,7 +347,7 @@
<JLabel text="isisfish.effortDescription.repairAndMaintenanceGearCost"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionRepairAndMaintenanceGearCost" onKeyTyped='repairAndMaintenanceGearCostChanged()'/>
+ <JTextField id="fieldEffortDescriptionRepairAndMaintenanceGearCost" onKeyTyped='valueChanged(true)' onFocusLost='repairAndMaintenanceGearCostChanged()'/>
</cell>
</row>
<row>
@@ -335,7 +355,7 @@
<JLabel text="isisfish.effortDescription.landingCosts"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionLandingCosts" onKeyTyped='langdingCostsChanged()'/>
+ <JTextField id="fieldEffortDescriptionLandingCosts" onKeyTyped='valueChanged(true)' onFocusLost='langdingCostsChanged()'/>
</cell>
</row>
<row>
@@ -343,7 +363,7 @@
<JLabel text="isisfish.effortDescription.otherRunningCost"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionOtherRunningCost" onKeyTyped='otherRunningCostChanged()'/>
+ <JTextField id="fieldEffortDescriptionOtherRunningCost" onKeyTyped='valueChanged(true)' onFocusLost='otherRunningCostChanged()'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -51,21 +51,34 @@
fieldGearParamName.setText(gear.getParameterName());
DefaultComboBoxModel model = new DefaultComboBoxModel(fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes());
fieldGearParamType.setModel(model);
- fieldGearParamPossibleValue.setText(gear.getPossibleValue().getValues());
+ if (gear.getPossibleValue() != null){
+ fieldGearParamPossibleValue.setText(gear.getPossibleValue().getValues());
+ }
fieldGearComment.setText(gear.getComment());
}
+ else{
+ fieldGearName.setText("");
+ fieldGearEffortUnit.setText("");
+ fieldGearStandardisationFactor.setText("");
+ fieldGearParamName.setText("");
+ DefaultComboBoxModel model = new DefaultComboBoxModel(fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes());
+ fieldGearParamType.setModel(model);
+ fieldGearParamPossibleValue.setText("");
+ fieldGearComment.setText("");
+ }
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Gear");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Gear.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Gear");
- getParentContainer(InputUI.class).setTreeSelection(topia, Gear.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -129,7 +142,7 @@
<JLabel text="isisfish.gear.name"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldGearName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -137,7 +150,7 @@
<JLabel text="isisfish.gear.effortUnit"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearEffortUnit" onKeyTyped='effortUnitChanged()'/>
+ <JTextField id="fieldGearEffortUnit" onKeyTyped='valueChanged(true)' onFocusLost='effortUnitChanged()'/>
</cell>
</row>
<row>
@@ -145,7 +158,7 @@
<JLabel text="isisfish.gear.standardisationFactor"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearStandardisationFactor" onKeyTyped='standardisationFactorChanged()'/>
+ <JTextField id="fieldGearStandardisationFactor" onKeyTyped='valueChanged(true)' onFocusLost='standardisationFactorChanged()'/>
</cell>
</row>
<row>
@@ -153,7 +166,7 @@
<JLabel text="isisfish.gear.technicalParameter"/>
</cell>
<cell columns="2" fill='horizontal' weightx='1.0'>
- <JTextField id="fieldGearParamName" onKeyTyped='paramNameChanged()'/>
+ <JTextField id="fieldGearParamName" onKeyTyped='valueChanged(true)' onFocusLost='paramNameChanged()'/>
</cell>
</row>
<row>
@@ -164,7 +177,7 @@
<JComboBox id="fieldGearParamType" onActionPerformed='paramTypeChanged()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldGearParamPossibleValue" onKeyTyped='paramPossibleValueChanged()'/>
+ <JTextField id="fieldGearParamPossibleValue" onKeyTyped='valueChanged(true)' onFocusLost='paramPossibleValueChanged()'/>
</cell>
</row>
<row>
@@ -173,7 +186,7 @@
</cell>
<cell columns="2" fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldGearComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldGearComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -47,7 +47,7 @@
selectivityUI.refresh();
}
protected void goToMetier(){
- getParentContainer(InputUI.class).setTreeSelection(null, Metier.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
}
]]></script>
<JTabbedPane constraints='BorderLayout.CENTER' id="GearTab" name="Gear">
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-08 18:13:52 UTC (rev 1645)
@@ -54,6 +54,7 @@
import fr.ifremer.isisfish.entities.MetierSeasonInfo;
import fr.ifremer.isisfish.entities.MetierSeasonInfoDAO;
import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.PopulationDAO;
import fr.ifremer.isisfish.entities.PopulationGroup;
import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
import fr.ifremer.isisfish.entities.Port;
@@ -68,9 +69,12 @@
import fr.ifremer.isisfish.entities.VesselType;
import fr.ifremer.isisfish.entities.Zone;
import fr.ifremer.isisfish.types.Month;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@@ -81,6 +85,7 @@
import org.codelutin.math.matrix.MatrixFactory;
import org.codelutin.math.matrix.MatrixND;
import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.TopiaException;
import org.codelutin.topia.persistence.TopiaDAO;
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.util.FileUtil;
@@ -102,6 +107,7 @@
protected FisheryRegion fisheryRegion = null;
protected TopiaContext isisContext = null;
protected TopiaEntity selected;
+ protected String path = null;
protected Cell cell;
protected Zone zone;
protected Port port;
@@ -117,10 +123,8 @@
public InputAction() {
log.info("new instance");
}
- protected void showMsgBox(String txt){
- if (txt != null){
- showMessageDialog(null, txt);
- }
+ protected void showMsgBox(Exception eee){
+ ErrorDialogUI.showError(eee);
}
public void setValue(Object value) {
cell = null;
@@ -154,6 +158,7 @@
break;
case Population:
population = (Population) value;
+ species = population.getSpecies();
break;
case Metier:
metier = (Metier) value;
@@ -176,12 +181,25 @@
}
selected = (TopiaEntity) value;
}
+ public void setPath(String path){
+ this.path = path;
+ }
+ public String getPath(){
+ return path;
+ }
public TopiaContext getIsisContext(){
return isisContext;
}
public RegionStorage getRegionStorage(){
return regionStorage;
}
+ public void setSpecies(String topiaId){
+ try {
+ species = IsisFishDAOHelper.getSpeciesDAO(isisContext).findByTopiaId(topiaId);
+ } catch (TopiaException ex) {
+ Logger.getLogger(InputAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
/**
* Exporter la region dans un zip
@@ -197,7 +215,7 @@
}
} catch (Exception eee) {
log.error("Can't import region", eee);
- showMsgBox("error " + eee.getMessage());
+ showMsgBox(eee);
}
return file;
}
@@ -219,7 +237,7 @@
}
} catch (Exception eee) {
log.error("Can't import region", eee);
- showMsgBox("error" + eee.getMessage());
+ showMsgBox(eee);
}
return file;
}
@@ -241,7 +259,7 @@
}
} catch (Exception eee) {
log.error("Can't import region", eee);
- showMsgBox("error" + eee.getMessage());
+ showMsgBox(eee);
}
return file;
}
@@ -261,7 +279,6 @@
simulationName = selectSimulation(SimulationStorage.getSimulationNames());
if (simulationName == null) {
{
- showMsgBox("error" + _("isisfish.error.no.selected.simulation"));
return null;
}
}
@@ -270,7 +287,7 @@
String msg = _("isisfish.error.no.select.simulation");
log.warn(msg);
e.printStackTrace();
- showMsgBox("error " + msg);
+ showMsgBox(e);
return null;
}
@@ -279,11 +296,9 @@
// ask new region name
String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName);
if (regionName == null || "".equals(regionName)) {
- showMsgBox("error " + _("isisfish.error.region.name.empty"));
return null;
}
if (RegionStorage.getRegionNames().contains(regionName)) {
- showMsgBox("error " + _("isisfish.error.region.already.exists"));
return null;
}
@@ -294,7 +309,7 @@
SimulationStorage.getSimulation(simulationName).extractRegion(regionName);
} catch (StorageException e) {
log.error("Can't extract region", e);
- showMsgBox("error" + e.getMessage());
+ showMsgBox(e);
}
return regionName;
}
@@ -320,7 +335,7 @@
}
} catch (Exception eee) {
log.error("Can't export region", eee);
- showMsgBox("error" + eee.getMessage());
+ showMsgBox(eee);
}
return file;
}
@@ -340,7 +355,7 @@
} catch (Exception eee) {
log.error("Can't copy region", eee);
- showMsgBox("error" + eee.getMessage());
+ showMsgBox(eee);
}
return newName;
}
@@ -367,7 +382,7 @@
}
} catch (Exception eee) {
log.error("Can't remove region", eee);
- showMsgBox("error" + eee.getMessage());
+ showMsgBox(eee);
}
return result;
}
@@ -396,7 +411,7 @@
}
} catch (Exception eee) {
log.error("Can't export region", eee);
- showMsgBox("error " + eee.getMessage());
+ showMsgBox(eee);
}
return result;
}
@@ -418,14 +433,14 @@
regionStorage = null;
fisheryRegion = null;
isisContext = null;
- if (name != null && !"".equals(name)) {
+ if (name != null && !" ".equals(name)) {
regionStorage = RegionStorage.getRegion(name);
isisContext = regionStorage.getStorage().beginTransaction();
fisheryRegion = RegionStorage.getFisheryRegion(isisContext);
}
} catch (Exception eee) {
log.error("Can't load region", eee);
- showMsgBox("error " + eee.getMessage());
+ showMsgBox(eee);
}
}
@@ -441,15 +456,15 @@
try {
log.debug("newRegion called");
if ("".equals(name)) {
- showMsgBox("error " + _("isisfish.error.region.name.empty"));
+// showMsgBox("error " + _("isisfish.error.region.name.empty"));
}
if (RegionStorage.getRegionNames().contains(name)) {
- showMsgBox("Error " + _("isisfish.error.region.already.exists"));
+// showMsgBox("Error " + _("isisfish.error.region.already.exists"));
}
RegionStorage.create(name);
} catch (Exception eee) {
log.error("Can't create region", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
}
@@ -497,7 +512,7 @@
} catch (Exception eee) {
log.error("Can't create entity", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -523,7 +538,7 @@
selected.getTopiaContext().commitTransaction();
} catch (Exception eee) {
log.error("Can't save region", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return selected;
}
@@ -548,7 +563,7 @@
}
} catch (Exception eee) {
log.error("Can't cancel modification in region", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -595,7 +610,7 @@
}
} catch (Exception eee) {
log.error("Can't remove entity: " + selected, eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return msg;
}
@@ -612,7 +627,7 @@
if (eq != null) {
String name = showInputDialog("");
if ("".equals(name)) {
- showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
+// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
}
if (name != null) {
FormuleStorage storage = FormuleStorage.createFormule(eq
@@ -622,7 +637,7 @@
}
} catch (Exception eee) {
log.error("Can't save equation as model", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -641,7 +656,7 @@
try {
String name = showInputDialog("");
if ("".equals(name)) {
- showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
+// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
}
if (name != null) {
FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
@@ -650,7 +665,7 @@
} catch (Exception eee) {
log.error("Can't save equation as model", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -667,7 +682,7 @@
pane.dispose();
} catch (Exception eee) {
log.error("Can't open editor", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -751,7 +766,7 @@
} catch (Exception eee) {
log.error("Can't add selectivity", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -764,7 +779,7 @@
}
}catch(Exception eee){
log.error("Can't remove TargetSpecies", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -785,7 +800,7 @@
}catch(Exception eee){
log.error("Can't create MetierSeasonInfo", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -798,7 +813,7 @@
isisContext.commitTransaction();
}catch(Exception eee){
log.error("Can't create MetierSeasonInfo", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -815,7 +830,7 @@
m.addSpeciesTargetSpecies(targetSpecies);
}catch(Exception eee){
log.error("Can't add TargetSpecies", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -828,7 +843,7 @@
}
}catch(Exception eee){
log.error("Can't remove TargetSpecies", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -846,7 +861,7 @@
setOfVessels.update();
}catch(Exception eee){
log.error("Can't create EffortDescription", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
}
@@ -857,13 +872,38 @@
isisContext.commitTransaction();
} catch (Exception eee) {
log.error("Can't remove entity: " + effort, eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
// Population
+ public Population createPopulation() {
+ log.debug("create called");
+ try {
+ String name = "Population_new";
+
+ PopulationDAO dao = IsisFishDAOHelper.getPopulationDAO(isisContext);
+ Population pop = dao.create();
+ pop.setName(name);
+
+ species.addPopulation(pop);
+ pop.setSpecies(species);
+ pop.update();
+// population = pop;
+// population.update();
+ species.update();
+ isisContext.commitTransaction();
+ return pop;
+ } catch (Exception eee) {
+ log.error("Can't create Population", eee);
+ showMsgBox(eee);
+// return new OutputView("Error.xml", "error", eee.getMessage());
+ }
+ return null;
+ }
+
public Object createRecruitmentDistribution() {
log.debug("createRecruitmentDistributionontext called: " + population);
try {
@@ -895,7 +935,7 @@
}
} catch (Exception eee) {
log.error("Can't remove PopulationSeasonInfo", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -911,7 +951,7 @@
}catch(Exception eee){
log.error("Can't add migration", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -926,7 +966,7 @@
}catch(Exception eee){
log.error("Can't add emigration", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
@@ -940,7 +980,7 @@
}catch(Exception eee){
log.error("Can't add immigration", eee);
- showMsgBox("Error " + eee.getMessage());
+ showMsgBox(eee);
}
return null;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-08 18:13:52 UTC (rev 1645)
@@ -89,5 +89,6 @@
if (data != null) {
action.setValue(data);
}
+ action.setPath(node.getContextPath());
}
}
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -65,6 +65,7 @@
import jaxx.runtime.JAXXContextEntryDef;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder;
+ import jaxx.runtime.swing.navigation.NavigationUtil;
import fr.ifremer.isisfish.entities.FisheryRegion;
import jaxx.runtime.swing.navigation.NavigationTreeCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
@@ -231,7 +232,7 @@
NavigationTreeModelBuilder builder = new NavigationTreeModelBuilder("/");
FisheryRegion fisheryRegion = getContextValue(InputAction.class).getFisheryRegion();
setContextValue(fisheryRegion);
- NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", null, null);
+ NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", NoneUI.class, null);
NavigationTreeNode cells = builder.build(root, "Cells", "../cell", "$cells", CellUI.class, null);
NavigationTreeNode zones = builder.build(root, "Zones", "../zone", "$zones", ZoneUI.class, null);
NavigationTreeNode ports = builder.build(root, "Ports", "../port", "$ports", PortUI.class, null);
@@ -256,15 +257,19 @@
for (Species specie : fisheryRegion.getSpecies()){
TopiaEntity topiaEntity = (TopiaEntity)specie;
NavigationTreeNode speciesChild = builder.build(species, specie.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), SpeciesUI.class, null);
- NavigationTreeNode populations = builder.build(speciesChild, "Population", "../population", "$population", PopulationUI.class, null);
- setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class);
+ NavigationTreeNode populations = builder.build(speciesChild, "Population", "../population", "$populations", PopulationUI.class, null);
+ if (specie.getPopulation() != null){
+ setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class);
+ }
}
navigation.setSelectionModel(navigationSelectionModel);
navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
- NavigationTreeModel model = new jaxx.runtime.swing.navigation.NavigationTreeModel(root, "/");
+ NavigationTreeModel model = builder.getModel();
+ setContextValue(model);
navigation.setModel(model);
new InputNavigationTreeSelectionAdapter(this, true);
+ setTreeSelection("$root");
} catch (Exception ex) {
Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
}
@@ -276,7 +281,11 @@
builder.build(parent, o.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
}
}
- protected void setTreeSelection(TopiaEntity topia, Class type){
+ protected void setTreeSelection(String path){
+ System.out.println(path);
+ NavigationTreeNode node = NavigationUtil.findNode(this, null, path);
+ TreePath pathToRoot = new TreePath(getContextValue(NavigationTreeModel.class).getPathToRoot(node));
+ navigation.setSelectionPath(pathToRoot);
}
protected void setInfoText(String s){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -75,32 +75,44 @@
}
}
+ else{
+ DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
+ fieldMetierSeasonInfo.setModel(seasonModel);
+ setTargetSpeciesModel();
+ setTargetFactorEquationModel();
+ }
}
protected void setSeasonModel(){
Metier metier = getContextValue(InputAction.class).getMetier();
DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
java.util.List<MetierSeasonInfo> metierSeasonInfo = metier.getMetierSeasonInfo();
- seasonModel.addElement(new GenericCell(" ", null, null));
- for (MetierSeasonInfo m : metierSeasonInfo){
- seasonModel.addElement(new GenericCell(m.getFirstMonth().toString() + "-" + m.getLastMonth().toString(), m, MetierSeasonInfo.class));
+ if (metierSeasonInfo != null){
+ seasonModel.addElement(new GenericCell(" ", null, null));
+ for (MetierSeasonInfo m : metierSeasonInfo){
+ seasonModel.addElement(new GenericCell(m.getFirstMonth().toString() + "-" + m.getLastMonth().toString(), m, MetierSeasonInfo.class));
+ }
}
fieldMetierSeasonInfo.setModel(seasonModel);
}
protected void setTargetSpeciesModel(){
DefaultComboBoxModel fieldTargetSpeciesModel = new DefaultComboBoxModel();
java.util.List<Species> species = getContextValue(InputAction.class).getFisheryRegion().getSpecies();
- fieldTargetSpeciesModel.addElement(new GenericCell(" ", null, null));
- for (Species s : species){
- fieldTargetSpeciesModel.addElement(new GenericCell(s.getName(), s, Species.class));
+ if (species != null){
+ fieldTargetSpeciesModel.addElement(new GenericCell(" ", null, null));
+ for (Species s : species){
+ fieldTargetSpeciesModel.addElement(new GenericCell(s.getName(), s, Species.class));
+ }
}
fieldTargetSpecies.setModel(fieldTargetSpeciesModel);
}
protected void setTargetFactorEquationModel(){
java.util.List<Formule> formules = fr.ifremer.isisfish.datastore.FormuleStorage.getFormules(getContextValue(InputAction.class).getIsisContext(), "TargetFactor");
DefaultComboBoxModel fieldTargetFactorEquationModel = new DefaultComboBoxModel();
- fieldTargetFactorEquationModel.addElement(new GenericCell(" ", null, null));
- for (Formule f : formules){
- fieldTargetFactorEquationModel.addElement(new GenericCell(f.getName(), f, Formule.class));
+ if (formules != null){
+ fieldTargetFactorEquationModel.addElement(new GenericCell(" ", null, null));
+ for (Formule f : formules){
+ fieldTargetFactorEquationModel.addElement(new GenericCell(f.getName(), f, Formule.class));
+ }
}
fieldTargetFactorEquation.setModel(fieldTargetFactorEquationModel);
}
@@ -118,20 +130,22 @@
Object season = ((GenericCell)fieldMetierSeasonInfo.getSelectedItem()).getValue();
if (season != null){
Collection<TargetSpecies> targetSpecies = ((MetierSeasonInfo)season).getSpeciesTargetSpecies();
- ArrayList <GenericCell> species = new ArrayList <GenericCell>();
- ArrayList <Equation> equations = new ArrayList <Equation>();
- ArrayList <Boolean> primaryCatch = new ArrayList <Boolean>();
- for (TargetSpecies t : targetSpecies){
- Species s = t.getSpecies();
- Equation e = t.getTargetFactorEquation();
- Boolean b = t.getPrimaryCatch();
- species.add(new GenericCell(s.getName(),s,Species.class));
- equations.add(e);
- primaryCatch.add(b);
+ if (targetSpecies != null){
+ ArrayList <GenericCell> species = new ArrayList <GenericCell>();
+ ArrayList <Equation> equations = new ArrayList <Equation>();
+ ArrayList <Boolean> primaryCatch = new ArrayList <Boolean>();
+ for (TargetSpecies t : targetSpecies){
+ Species s = t.getSpecies();
+ Equation e = t.getTargetFactorEquation();
+ Boolean b = t.getPrimaryCatch();
+ species.add(new GenericCell(s.getName(),s,Species.class));
+ equations.add(e);
+ primaryCatch.add(b);
+ }
+ model.addColumn("Species", species.toArray());
+ model.addColumn("Target factor", equations.toArray());
+ model.addColumn("Main species for the metier", primaryCatch.toArray());
}
- model.addColumn("Species", species.toArray());
- model.addColumn("Target factor", equations.toArray());
- model.addColumn("Main species for the metier", primaryCatch.toArray());
tableTargetSpecies.setModel(model);
EquationTableEditor cellEditor = new EquationTableEditor();
tableTargetSpecies.getColumnModel().getColumn(1).setCellEditor(cellEditor);
@@ -173,7 +187,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Metier");
- getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -57,9 +57,11 @@
if (seasonInit){
DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
java.util.List<MetierSeasonInfo> metierSeasonInfo = metier.getMetierSeasonInfo();
- seasonModel.addElement(new GenericCell(" ", null, null));
- for (MetierSeasonInfo m : metierSeasonInfo){
- seasonModel.addElement(new GenericCell(m.getFirstMonth().toString() + "-" + m.getLastMonth().toString(), m, MetierSeasonInfo.class));
+ if (metierSeasonInfo != null){
+ seasonModel.addElement(new GenericCell(" ", null, null));
+ for (MetierSeasonInfo m : metierSeasonInfo){
+ seasonModel.addElement(new GenericCell(m.getFirstMonth().toString() + "-" + m.getLastMonth().toString(), m, MetierSeasonInfo.class));
+ }
}
fieldMetierSeasonChoice.setModel(seasonModel);
}
@@ -106,9 +108,11 @@
DefaultListModel zonesModel = new DefaultListModel();
java.util.List<Zone> metierZone = getContextValue(InputAction.class).getFisheryRegion().getZone();
- for (Zone z : metierZone ){
- zonesModel.addElement(z);
- // new GenericCell(z.getName(), z, Zone.class)
+ if (metierZone != null){
+ for (Zone z : metierZone ){
+ zonesModel.addElement(z);
+ // new GenericCell(z.getName(), z, Zone.class)
+ }
}
metierZones.setModel(zonesModel);
if (value != null){
@@ -123,19 +127,38 @@
fieldMetierSeasonZoneComment.setText(((MetierSeasonInfo)value).getSeasonZoneComment());
}
}
+ else{
+ // Model instanciation
+ Interval interval = new Interval();
+ interval.setMin(0);
+ interval.setMax(11);
+ interval.setFirst(0);
+ interval.setLast(2);
+ ip.setLabelRenderer(Month.MONTH);
+ ip.setModel(interval);
+ fieldMetierSeasonZoneComment.setText("");
+ DefaultListModel zonesModel = new DefaultListModel();
+ java.util.List<Zone> metierZone = getContextValue(InputAction.class).getFisheryRegion().getZone();
+ if (metierZone != null){
+ for (Zone z : metierZone ){
+ zonesModel.addElement(z);
+ // new GenericCell(z.getName(), z, Zone.class)
+ }
+ }
+ metierZones.setModel(zonesModel);
+ }
}
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Metier");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Metier");
- getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
setInfoText(_("isisfish.message.save.finished"));
refresh(false);
valueChanged(false);
@@ -222,7 +245,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.3'>
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTextArea id="fieldMetierSeasonZoneComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldMetierSeasonZoneComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -51,13 +51,18 @@
protected void refresh() {
try {
Metier metier = getContextValue(InputAction.class).getMetier();
+ DefaultComboBoxModel model = new DefaultComboBoxModel(getContextValue(InputAction.class).getFisheryRegion().getGear().toArray());
+ fieldMetierGear.setModel(model);
if (metier != null){
fieldMetierName.setText(metier.getName());
- DefaultComboBoxModel model = new DefaultComboBoxModel(getContextValue(InputAction.class).getFisheryRegion().getGear().toArray());
- fieldMetierGear.setModel(model);
fieldMetierParam.setText(metier.getGearParameterValue());
fieldMetierComment.setText(metier.getComment());
}
+ else{
+ fieldMetierName.setText("");
+ fieldMetierParam.setText("");
+ fieldMetierComment.setText("");
+ }
} catch (Exception ex) {
Logger.getLogger(MetierTabUI.class.getName()).log(Level.SEVERE, null, ex);
}
@@ -81,12 +86,13 @@
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Metier");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Metier");
- getParentContainer(InputUI.class).setTreeSelection(topia, Metier.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -108,7 +114,7 @@
}
protected void valueChanged(boolean b){
changed=b;
- create.setEnabled(b);
+ cancel.setEnabled(b);
save.setEnabled(b);
}
]]></script>
@@ -120,7 +126,7 @@
<JLabel text="isisfish.metier.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldMetierName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldMetierName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -136,7 +142,7 @@
<JLabel text="isisfish.metier.rangeValues"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldMetierParam" onKeyTyped='paramChanged()'/>
+ <JTextField id="fieldMetierParam" onKeyTyped='valueChanged(true)' onFocusLost='paramChanged()'/>
</cell>
</row>
<row>
@@ -145,7 +151,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTextArea id="fieldMetierComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldMetierComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -47,7 +47,7 @@
metierSeasonInfoUI.refresh(true);
}
protected void goToTripType(){
- getParentContainer(InputUI.class).setTreeSelection(null, TripType.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes");
}
]]></script>
<JTabbedPane id="MetierTab" name="Metier" constraints='BorderLayout.CENTER'>
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -0,0 +1,3 @@
+<JPanel layout='{new BorderLayout()}'>
+ <JLabel id='none' horizontalAlignment="0" text="isisfish.input.selectNodeTree" constraints='BorderLayout.CENTER'/>
+</JPanel>
\ No newline at end of file
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -36,6 +36,7 @@
import fr.ifremer.isisfish.entities.Equation;
import fr.ifremer.isisfish.entities.Formule;
+ import fr.ifremer.isisfish.entities.Species;
import fr.ifremer.isisfish.entities.PopulationGroup;
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
import fr.ifremer.isisfish.entities.Population;
@@ -59,29 +60,46 @@
} catch (IOException ex) {
Logger.getLogger(PopulationBasicsUI.class.getName()).log(Level.SEVERE, null, ex);
}
+ setFieldPopulationBasicsGrowthModel();
+ setfieldPopulationBasicsGrowthReverseModel();
if (pop != null){
fieldPopulationBasicsName.setText(pop.getName());
fieldPopulationBasicsGeographicID.setText(pop.getGeographicId());
fieldPopulationBasicsNbClasses.setText(pop.sizePopulationGroup() + "");
setFieldPopulationBasicsMatureClassModel();
fieldPopulationBasicsPlusGroup.setSelected(pop.getPlusGroup());
- setFieldPopulationBasicsGrowthModel();
- setfieldPopulationBasicsGrowthReverseModel();
fieldPopulationBasicsComment.setText(pop.getComment());
growthReverseChanged();
basicsGrowthChanged();
setTableAgeLengthModel();
valueChanged(false);
}
+ else{
+// pop = (Population) getContextValue(InputAction.class).create("Population");
+ fieldPopulationBasicsName.setText("");
+ fieldPopulationBasicsGeographicID.setText("");
+ fieldPopulationBasicsNbClasses.setText("");
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationBasicsMatureClass.setModel(model);
+ fieldPopulationBasicsComment.setText("");
+ growthReverseChanged();
+ basicsGrowthChanged();
+ DefaultTableModel tableModel = new DefaultTableModel();
+ tableAgeLength.setModel(tableModel);
+ valueChanged(false);
+
+ }
}
protected void setFieldPopulationBasicsMatureClassModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
PopulationGroup selected = null;
model.addElement(null);
- for (PopulationGroup p : pop.getPopulationGroup()){
- model.addElement(p);
- if (pop.getMaturityGroup() == p){
- selected = p;
+ if (pop.getPopulationGroup() != null){
+ for (PopulationGroup p : pop.getPopulationGroup()){
+ model.addElement(p);
+ if (pop.getMaturityGroup() == p){
+ selected = p;
+ }
}
}
fieldPopulationBasicsMatureClass.setModel(model);
@@ -96,8 +114,10 @@
for (Formule f : getContextValue(InputAction.class).getFormules("Growth")){
GenericCell c = new GenericCell(f.getName(), f, Formule.class);
model.addElement(c);
- if (((Equation)f).equals(pop.getGrowth())){
- selected = c;
+ if (pop != null){
+ if (((Equation)f).equals(pop.getGrowth())){
+ selected = c;
+ }
}
}
fieldPopulationBasicsGrowth.setModel(model);
@@ -110,11 +130,16 @@
DefaultComboBoxModel model = new DefaultComboBoxModel();
model.addElement(new GenericCell(" ", null, null));
GenericCell selected = null;
- for (Formule f : getContextValue(InputAction.class).getFormules("GrowthReverse")){
- GenericCell c = new GenericCell(f.getName(), f, Formule.class);
- model.addElement(c);
- if (((Equation)f).equals(pop.getGrowthReverse())){
- selected = c;
+ java.util.List<Formule> formules = getContextValue(InputAction.class).getFormules("GrowthReverse");
+ if (formules != null){
+ for (Formule f : formules){
+ GenericCell c = new GenericCell(f.getName(), f, Formule.class);
+ model.addElement(c);
+ if (pop != null){
+ if (((Equation)f).equals(pop.getGrowthReverse())){
+ selected = c;
+ }
+ }
}
}
fieldPopulationBasicsGrowthReverse.setModel(model);
@@ -149,7 +174,9 @@
pop.setName(fieldPopulationBasicsName.getText());
}
protected void geographicChanged(){
- pop.setGeographicId(fieldPopulationBasicsGeographicID.getText());
+ if (pop != null){
+ pop.setGeographicId(fieldPopulationBasicsGeographicID.getText());
+ }
}
protected void createClasses(){
if (pop != null){
@@ -219,29 +246,33 @@
}
protected void setTableAgeLengthModel(){
java.util.List<PopulationGroup> popGroup = pop.getPopulationGroup();
-
- DefaultTableModel model = new DefaultTableModel(2, popGroup.size() + 1);
- model.setValueAt("Age", 0, 0);
- model.setValueAt("Lengths", 1, 0);
- int cnt = 1;
- for (PopulationGroup pg : popGroup){
- model.setValueAt(pg.getAge(), 0, cnt);
- model.setValueAt(pg.getLength(), 1, cnt);
- cnt++;
+ if (popGroup != null){
+ DefaultTableModel model = new DefaultTableModel(2, popGroup.size() + 1);
+ model.setValueAt("Age", 0, 0);
+ model.setValueAt("Lengths", 1, 0);
+ int cnt = 1;
+ for (PopulationGroup pg : popGroup){
+ model.setValueAt(pg.getAge(), 0, cnt);
+ model.setValueAt(pg.getLength(), 1, cnt);
+ cnt++;
+ }
+ tableAgeLength.setModel(model);
}
- tableAgeLength.setModel(model);
}
protected void create(){
- TopiaEntity topia = getContextValue(InputAction.class).create("Population");
+ Species species = getContextValue(InputAction.class).getSpecies();
+ TopiaEntity topia = getContextValue(InputAction.class).createPopulation();
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ species.getTopiaId() +"/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ Population population = (Population) topia;
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ population.getSpecies().getTopiaId() +"/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -263,7 +294,7 @@
}
protected void valueChanged(boolean b){
changed=b;
- create.setEnabled(b);
+ cancel.setEnabled(b);
save.setEnabled(b);
}
]]>
@@ -279,7 +310,7 @@
<JLabel text="isisfish.populationBasics.name"/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldPopulationBasicsName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldPopulationBasicsName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -287,7 +318,7 @@
<JLabel text="isisfish.populationBasics.geographicID"/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldPopulationBasicsGeographicID" onKeyTyped='geographicChanged()'/>
+ <JTextField id="fieldPopulationBasicsGeographicID" onKeyTyped='valueChanged(true)' onFocusLost='geographicChanged()'/>
</cell>
</row>
<row>
@@ -391,8 +422,7 @@
</cell>
<cell columns='2' fill='both' weightx='1.0' weighty='0.2'>
<JScrollPane>
- <JTextArea id="fieldPopulationBasicsComment" onKeyTyped='commentChanged()'>
- </JTextArea>
+ <JTextArea id="fieldPopulationBasicsComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
@@ -410,15 +440,15 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -50,7 +50,9 @@
pop = getContextValue(InputAction.class).getPopulation();
if (pop != null){
fieldPopulationCapturabilityComment.setText(pop.getCapturabilityComment());
- fieldPopulationCapturability.setMatrix(pop.getCapturability().copy());
+ if (pop.getCapturability() != null){
+ fieldPopulationCapturability.setMatrix(pop.getCapturability().copy());
+ }
fieldPopulationCapturability.addMatrixListener(new MatrixPanelListener() {
@Override
@@ -61,6 +63,11 @@
});
valueChanged(false);
}
+ else{
+ fieldPopulationCapturabilityComment.setText("");
+ fieldPopulationCapturability.setMatrix(null);
+ valueChanged(false);
+ }
}
protected void commentChanged(){
pop.setCapturabilityComment(fieldPopulationCapturabilityComment.getText());
@@ -68,7 +75,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$population/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -108,7 +115,7 @@
<row>
<cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldPopulationCapturabilityComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldPopulationCapturabilityComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -55,7 +55,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -62,6 +62,17 @@
fieldPopulationGroupComment.setText(populationGroup.getComment());
setFieldPopulationGroupNaturalDeathRateModel();
}
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationGroupMeanWeight.setText("");
+ fieldPopulationGroupPrice.setText("");
+ fieldPopulationGroupReproductionRate.setText("");
+ fieldPopulationGroupAge.setText("");
+ fieldPopulationGroupMinLength.setText("");
+ fieldPopulationGroupMaxLength.setText("");
+ fieldPopulationGroupComment.setText("");
+ fieldPopulationGroupNaturalDeathRate.setMatrix(null);
+ }
}
protected void setFieldPopulationGroupNaturalDeathRateModel(){
fieldPopulationGroupNaturalDeathRate.setMatrix(pop.getNaturalDeathRateMatrix());
@@ -98,7 +109,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -156,7 +167,7 @@
<JLabel text="isisfish.populationGroup.reproductionRate"/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldPopulationGroupReproductionRate" onKeyTyped='reproductionRateChanged()'/>
+ <JTextField id="fieldPopulationGroupReproductionRate" onKeyTyped='valueChanged(true)' onFocusLost='reproductionRateChanged()'/>
</cell>
</row>
<row>
@@ -172,10 +183,10 @@
<JLabel text="isisfish.populationGroup.length"/>
</cell>
<cell fill='both' weightx='0.5'>
- <JTextField id="fieldPopulationGroupMinLength" onKeyTyped='groupMinLengthChanged()'/>
+ <JTextField id="fieldPopulationGroupMinLength" onKeyTyped='valueChanged(true)' onFocusLost='groupMinLengthChanged()'/>
</cell>
<cell fill='both' weightx='0.5'>
- <JTextField id="fieldPopulationGroupMaxLength" onKeyTyped='groupMaxLengthChanged()'/>
+ <JTextField id="fieldPopulationGroupMaxLength" onKeyTyped='valueChanged(true)' onFocusLost='groupMaxLengthChanged()'/>
</cell>
</row>
<row>
@@ -184,7 +195,7 @@
</cell>
<cell columns='2' fill='both' weightx='1.0' weighty='0.5'>
<JScrollPane>
- <JTextArea id="fieldPopulationGroupComment" onKeyTyped='groupCommentChanged()'/>
+ <JTextArea id="fieldPopulationGroupComment" onKeyTyped='valueChanged(true)' onFocusLost='groupCommentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -71,6 +71,12 @@
}
});
}
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationMigrationEmigrationGroupChooser.setModel(model);
+ fieldPopulationMigrationEmigrationDepartureZoneChooser.setModel(model);
+ populationMigrationEmigrationTable.setMatrix(null);
+ }
}
protected void setFieldPopulationMigrationMigrationGroupChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
@@ -86,7 +92,7 @@
for (Zone z : values){
model.addElement(z);
}
- fieldPopulationMigrationEmigrationGroupChooser.setModel(model);
+ fieldPopulationMigrationEmigrationDepartureZoneChooser.setModel(model);
}
protected void add(){
getContextValue(InputAction.class).addEmigration(
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -49,6 +49,11 @@
emigrationEquation.refresh(_("isisfish.common.emigration"), (Formule)popInfo.getEmigrationEquation(), "Emigration", fr.ifremer.isisfish.equation.EmigrationEquation.class);
immigrationEquation.refresh(_("isisfish.common.immigration"), (Formule)popInfo.getImmigrationEquation(), "Immigration", fr.ifremer.isisfish.equation.ImmigrationEquation.class);
}
+ else{
+ migrationEquation.refresh(_("isisfish.common.migration"), null, "Migration", fr.ifremer.isisfish.equation.MigrationEquation.class);
+ emigrationEquation.refresh(_("isisfish.common.emigration"), null, "Emigration", fr.ifremer.isisfish.equation.EmigrationEquation.class);
+ immigrationEquation.refresh(_("isisfish.common.immigration"), null, "Immigration", fr.ifremer.isisfish.equation.ImmigrationEquation.class);
+ }
}
]]>
</script>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -67,6 +67,12 @@
}
});
}
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationMigrationImmigrationArrivalZoneChooser.setModel(model);
+ fieldPopulationMigrationImmigrationArrivalZoneChooser.setModel(model);
+ populationMigrationImmigrationTable.setMatrix(null);
+ }
}
protected void setFieldPopulationMigrationMigrationGroupChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -67,6 +67,13 @@
}
});
}
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationMigrationMigrationGroupChooser.setModel(model);
+ fieldPopulationMigrationMigrationDepartureZoneChooser.setModel(model);
+ fieldPopulationMigrationMigrationArrivalZoneChooser.setModel(model);
+ populationMigrationMigrationTable.setMatrix(null);
+ }
}
protected void setFieldPopulationMigrationMigrationGroupChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -51,17 +51,24 @@
}
public void refresh(){
pop = getContextValue(InputAction.class).getPopulation();
- setFieldPopulationMigrationSeasonChooserModel();
- PopulationSeasonInfo selected = getPopulationSeasonInfo();
- if (selected != null){
- fieldUseEquationMigration.setSelected(selected.getUseEquationMigration());
- useEquationChanged();
- populationMigrationEquationUI.refresh(selected);
- populationMigrationMigrationUI.refresh(selected);
- populationMigrationImmigrationUI.refresh(selected);
- populationMigrationEmigrationUI.refresh(selected);
+ if (pop != null){
+ setFieldPopulationMigrationSeasonChooserModel();
+ PopulationSeasonInfo selected = getPopulationSeasonInfo();
+ if (selected != null){
+ fieldUseEquationMigration.setSelected(selected.getUseEquationMigration());
+ useEquationChanged();
+ populationMigrationEquationUI.refresh(selected);
+ populationMigrationMigrationUI.refresh(selected);
+ populationMigrationImmigrationUI.refresh(selected);
+ populationMigrationEmigrationUI.refresh(selected);
+ }
+ fieldPopulationMigrationComment.setText(pop.getMigrationComment());
}
- fieldPopulationMigrationComment.setText(pop.getMigrationComment());
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationMigrationSeasonChooser.setModel(model);
+ fieldPopulationMigrationComment.setText("");
+ }
}
protected void setFieldPopulationMigrationSeasonChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
@@ -100,7 +107,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -153,7 +160,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.3'>
<JScrollPane>
- <JTextArea id="fieldPopulationMigrationComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldPopulationMigrationComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -146,7 +146,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" onKeyTyped='valueChanged(true)'/>
+ <org.codelutin.widget.editor.Editor id='editor' askIfNotSaved="false" onKeyTyped='valueChanged(true)' onFocusLost='valueChanged(true)'/>
</JScrollPane>
</cell>
</row>
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -61,6 +61,13 @@
fieldPopulationRecruitmentComment.setText(pop.getRecruitmentComment());
valueChanged(false);
}
+ else{
+ fieldPopulationMonthGapBetweenReproRecrutement.setText("");
+ fieldPopulationRecruitmentComment.setText("");
+ valueChanged(false);
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationReproductionEquation.setModel(model);
+ }
}
protected void setFieldPopulationReproductionEquationModel() {
DefaultComboBoxModel model = new DefaultComboBoxModel();
@@ -123,7 +130,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -187,7 +194,7 @@
<JLabel text="Month Gap BetweenRepro Recruitment"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldPopulationMonthGapBetweenReproRecrutement" onKeyTyped='monthGapChanged()'/>
+ <JTextField id="fieldPopulationMonthGapBetweenReproRecrutement" onKeyTyped='valueChanged(true)' onFocusLost='monthGapChanged()'/>
</cell>
</row>
<row>
@@ -212,7 +219,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.5'>
<JScrollPane>
- <JTextArea id="fieldPopulationRecruitmentComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldPopulationRecruitmentComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -64,13 +64,27 @@
interval.setLast(2);
ip.setModel(interval);
}
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldPopulationSeasonInfoChooser.setModel(model);
+ fieldPopulationSeasonComment.setText("");
+ // Model instanciation
+ Interval interval = new Interval();
+ interval.setMin(0);
+ interval.setMax(11);
+ interval.setFirst(0);
+ interval.setLast(2);
+ ip.setModel(interval);
+ }
}
protected void setFieldPopulationSeasonInfoChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
- java.util.List<PopulationSeasonInfo> popSeasonInfo = pop.getPopulationSeasonInfo();
- for(PopulationSeasonInfo psi : popSeasonInfo){
- GenericCell cell = new GenericCell(psi.getFirstMonth().toString() + " - " + psi.getLastMonth().toString(),psi, PopulationSeasonInfo.class);
- model.addElement(cell);
+ if (pop.getPopulationSeasonInfo() != null){
+ java.util.List<PopulationSeasonInfo> popSeasonInfo = pop.getPopulationSeasonInfo();
+ for(PopulationSeasonInfo psi : popSeasonInfo){
+ GenericCell cell = new GenericCell(psi.getFirstMonth().toString() + " - " + psi.getLastMonth().toString(),psi, PopulationSeasonInfo.class);
+ model.addElement(cell);
+ }
}
fieldPopulationSeasonInfoChooser.setModel(model);
}
@@ -141,13 +155,11 @@
TopiaEntity topia = getContextValue(InputAction.class).create("Metier");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -215,8 +227,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldPopulationSeasonComment" onKeyTyped='commentChanged()'>
- </JTextArea>
+ <JTextArea id="fieldPopulationSeasonComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -41,23 +41,35 @@
import fr.ifremer.isisfish.entities.Gear;
public PopulationUI (InputAction action){
-
setContextValue(action);
}
public void refresh(){
- if (getContextValue(InputAction.class).getPopulation() != null){
- populationBasicsUI.refresh();
- populationGroupUI.refresh();
- populationEquationUI.refresh();
- populationZoneUI.refresh();
- populationSeasonsUI.refresh();
- populationCapturabilityUI.refresh();
- populationRecruitementUI.refresh();
- populationMigrationUI.refresh();
+ populationBasicsUI.refresh();
+ populationGroupUI.refresh();
+ populationEquationUI.refresh();
+ populationZoneUI.refresh();
+ populationSeasonsUI.refresh();
+ populationCapturabilityUI.refresh();
+ populationRecruitementUI.refresh();
+ populationMigrationUI.refresh();
+ setSpecies();
+ }
+ protected void setSpecies(){
+ String[] paths = getContextValue(InputAction.class).getPath().split("/");
+ String topiaId = null;
+ for (String path : paths){
+ if (!path.matches("^\\$.+$")){
+ if (path.matches("^fr\\.ifremer\\.isisfish\\.entities\\.Species\\#.+$")){
+ topiaId = path;
+ }
+ }
}
+ if (topiaId != null){
+ getContextValue(InputAction.class).setSpecies(topiaId);
+ }
}
protected void goToGear(){
- getParentContainer(InputUI.class).setTreeSelection(null, Gear.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$gears");
}
]]>
</script>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -65,13 +65,23 @@
});
valueChanged(false);
}
+ else{
+ DefaultListModel model = new DefaultListModel();
+ fieldPopulationZonesRecruitment.setModel(model);
+ populationZonesPresence.setModel(model);
+ fieldPopulationZonesReproduction.setModel(model);
+ fieldPopulationMappingZoneReproZoneRecru.setMatrix(null);
+ valueChanged(false);
+ }
}
protected void fieldPopulationMappingZoneReproZoneRecruChanged(){
pop.setMappingZoneReproZoneRecru(fieldPopulationMappingZoneReproZoneRecru.getMatrix());
valueChanged(true);
}
protected void setFieldPopulationMappingZoneReproZoneRecru(){
- fieldPopulationMappingZoneReproZoneRecru.setMatrix(pop.getMappingZoneReproZoneRecru().copy());
+ if (pop.getMappingZoneReproZoneRecru() != null){
+ fieldPopulationMappingZoneReproZoneRecru.setMatrix(pop.getMappingZoneReproZoneRecru().copy());
+ }
}
protected void setPopulationZonesPresenceModel(){
setModel(pop.getPopulationZone(), populationZonesPresence);
@@ -86,11 +96,15 @@
DefaultListModel model = new DefaultListModel();
java.util.List<Zone> zones = getContextValue(InputAction.class).getFisheryRegion().getZone();
java.util.List<GenericCell> selectedZones = new ArrayList<GenericCell>();
- for (Zone z : zones){
- GenericCell cell = new GenericCell(z.getName(), z, Zone.class);
- model.addElement(cell);
- if (selected.contains(z)){
- selectedZones.add(cell);
+ if (zones != null){
+ for (Zone z : zones){
+ GenericCell cell = new GenericCell(z.getName(), z, Zone.class);
+ model.addElement(cell);
+ if (selected != null){
+ if (selected.contains(z)){
+ selectedZones.add(cell);
+ }
+ }
}
}
componant.setModel(model);
@@ -109,31 +123,39 @@
}
}
protected void presenceChanged(){
- pop.setPopulationZone(getSelectedValue(populationZonesPresence));
- valueChanged(true);
+ if (pop != null){
+ pop.setPopulationZone(getSelectedValue(populationZonesPresence));
+ valueChanged(true);
+ }
}
protected void reproductionChanged(){
- pop.setReproductionZone(getSelectedValue(fieldPopulationZonesReproduction));
- valueChanged(true);
+ if (pop != null){
+ pop.setReproductionZone(getSelectedValue(fieldPopulationZonesReproduction));
+ valueChanged(true);
+ }
}
protected void recruitementChanged(){
- pop.setRecruitmentZone(getSelectedValue(fieldPopulationZonesRecruitment));
- valueChanged(true);
+ if (pop != null){
+ pop.setRecruitmentZone(getSelectedValue(fieldPopulationZonesRecruitment));
+ valueChanged(true);
+ }
}
protected java.util.List<Zone> getSelectedValue(JAXXList componant){
Object[] selected = componant.getSelectedValues();
java.util.List<Zone> selectedZone = new ArrayList<Zone>();
- for (Object i : selected){
- GenericCell cell = (GenericCell)i;
- if (cell.getValue() != null){
- selectedZone.add((Zone)cell.getValue());
+ if (selected != null){
+ for (Object i : selected){
+ GenericCell cell = (GenericCell)i;
+ if (cell.getValue() != null){
+ selectedZone.add((Zone)cell.getValue());
+ }
}
}
return selectedZone;
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Population");
- getParentContainer(InputUI.class).setTreeSelection(topia, Population.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -59,7 +59,6 @@
protected void refresh() {
Port port = getContextValue(InputAction.class).getPort();
if (port != null){
-
fieldPortName.setText(port.getName());
DefaultListModel portCellModel = new DefaultListModel();
@@ -79,6 +78,26 @@
portMapPanel.add(portMap, BorderLayout.CENTER);
refreshMap();
}
+ else{
+ fieldPortName.setText("");
+
+ DefaultListModel portCellModel = new DefaultListModel();
+ java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
+ for (Cell c : cells){
+ portCellModel.addElement(c);
+ }
+ portCell.setModel(portCellModel);
+
+ fieldPortComment.setText("");
+
+ portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(portMap);
+ toolMap.add((Component)toolSet);
+ portMapPanel.add(toolMap, BorderLayout.NORTH);
+ portMapPanel.add(portMap, BorderLayout.CENTER);
+ refreshMap();
+
+ }
}
protected void refreshMap(){
java.util.List<Cell> cells = new ArrayList<Cell>();
@@ -90,13 +109,14 @@
TopiaEntity topia = getContextValue(InputAction.class).create("Port");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Port.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Port");
- getParentContainer(InputUI.class).setTreeSelection(topia, Port.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -113,7 +133,7 @@
refresh();
}
protected void goToSpecies(){
- getParentContainer(InputUI.class).setTreeSelection(null, Species.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species");
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -152,7 +172,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0' >
- <JTextField id="fieldPortName" onActionPerformed='nameChanged()'/>
+ <JTextField id="fieldPortName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -171,19 +191,18 @@
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JLabel text="isisfish.port.comments"/>
-
</cell>
</row>
<row>
<cell columns='2' fill='both' weighty='0.3' weightx='1.0' >
<JScrollPane>
- <JTextArea id="fieldPortComment" onKeyPressed='commentChanged()'/>
+ <JTextArea id="fieldPortComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='create' enabled='false' text="isisfish.common.new" onActionPerformed='create()'/>
+ <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
@@ -191,7 +210,7 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='create' text="isisfish.common.new" onActionPerformed='create()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -54,11 +54,15 @@
setContextValue(action);
}
public void refresh(){
- if (getContextValue(InputAction.class).getGear() != null){
- fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
- fieldSelectivityEquation.setModel(getSelectivityEquationModel());
+ fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
+ fieldSelectivityEquation.setModel(getSelectivityEquationModel());
+ if (getContextValue(InputAction.class).getGear() != null){
setSelectivityTableModel();
}
+ else{
+ DefaultTableModel model = new DefaultTableModel();
+ selectivityTable.setModel(model);
+ }
try {
fieldSelectivityScript.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
} catch (IOException ex) {
@@ -79,9 +83,11 @@
Collection<Selectivity> selectivity = getContextValue(InputAction.class).getGear().getPopulationSelectivity();
java.util.List<Population> populations = new ArrayList<Population>();
java.util.List<Equation> equations = new ArrayList<Equation>();
- for (Selectivity s : selectivity){
- populations.add(s.getPopulation());
- equations.add(s.getEquation());
+ if (selectivity != null){
+ for (Selectivity s : selectivity){
+ populations.add(s.getPopulation());
+ equations.add(s.getEquation());
+ }
}
model.addColumn("Population", populations.toArray());
model.addColumn("Equation", equations.toArray());
@@ -93,10 +99,14 @@
protected DefaultComboBoxModel getSelectivityPopulationModel(){
java.util.List<Species> species = getContextValue(InputAction.class).getFisheryRegion().getSpecies();
DefaultComboBoxModel selectivityPopulationModel = new DefaultComboBoxModel();
- selectivityPopulationModel.addElement(new GenericCell(" ", null, null));
- for (Species s : species){
- for (Population p : s.getPopulation()){
- selectivityPopulationModel.addElement(new GenericCell(p.getName(), p, Population.class));
+ if (species != null){
+ selectivityPopulationModel.addElement(new GenericCell(" ", null, null));
+ for (Species s : species){
+ if (s.getPopulation() != null){
+ for (Population p : s.getPopulation()){
+ selectivityPopulationModel.addElement(new GenericCell(p.getName(), p, Population.class));
+ }
+ }
}
}
return selectivityPopulationModel;
@@ -104,10 +114,12 @@
protected DefaultComboBoxModel getSelectivityEquationModel(){
java.util.List<Formule> formules = fr.ifremer.isisfish.datastore.FormuleStorage.getFormules(getContextValue(InputAction.class).getIsisContext(), "Selectivity");
DefaultComboBoxModel selectivityEquationModel = new DefaultComboBoxModel();
- selectivityEquationModel.addElement(new GenericCell(" ", null, null));
- for (Formule f : formules){
- GenericCell g = new GenericCell(f.getName(), f, Formule.class);
- selectivityEquationModel.addElement(g);
+ if (formules != null){
+ selectivityEquationModel.addElement(new GenericCell(" ", null, null));
+ for (Formule f : formules){
+ GenericCell g = new GenericCell(f.getName(), f, Formule.class);
+ selectivityEquationModel.addElement(g);
+ }
}
return selectivityEquationModel;
}
@@ -133,7 +145,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Gear");
- getParentContainer(InputUI.class).setTreeSelection(topia, Gear.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -61,6 +61,15 @@
setFieldSetOfVesselsTechnicalEfficiencyModel(setOfVessels);
fieldSetOfVesselsComment.setText(setOfVessels.getComment());
}
+ else{
+ fieldSetOfVesselsName.setText("");
+ setFieldSetOfVesselsPortModel(null);
+ setFieldSetOfVesselsVesselTypeModel(null);
+ fieldSetOfVesselsNumberOfVessels.setText("");
+ fieldSetOfVesselsFixedCosts.setText("");
+ setFieldSetOfVesselsTechnicalEfficiencyModel(null);
+ fieldSetOfVesselsComment.setText("");
+ }
try {
editor.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
} catch (IOException ex) {
@@ -70,62 +79,76 @@
protected void setFieldSetOfVesselsPortModel(fr.ifremer.isisfish.entities.SetOfVessels setOfVessels){
DefaultComboBoxModel model = new DefaultComboBoxModel();
java.util.List<Port> ports = getContextValue(InputAction.class).getFisheryRegion().getPort();
- String portSelectedName = setOfVessels.getPort().getName();
GenericCell selectedCell = null;
for (Port p : ports){
GenericCell cell = new GenericCell(p.getName(), p, Port.class);
model.addElement(cell);
- if (p.getName().equals(portSelectedName)){
- selectedCell = cell;
+ if (setOfVessels != null){
+ if (setOfVessels.getPort() != null){
+ if (p.getName().equals(setOfVessels.getPort().getName())){
+ selectedCell = cell;
+ }
+ }
}
}
fieldSetOfVesselsPort.setModel(model);
- fieldSetOfVesselsPort.setSelectedItem(selectedCell);
+ if (selectedCell != null){
+ fieldSetOfVesselsPort.setSelectedItem(selectedCell);
+ }
}
protected void setFieldSetOfVesselsVesselTypeModel(fr.ifremer.isisfish.entities.SetOfVessels setOfVessels){
DefaultComboBoxModel model = new DefaultComboBoxModel();
java.util.List<VesselType> vesselTypes = getContextValue(InputAction.class).getFisheryRegion().getVesselType();
- String vesselTypeSelectedName = setOfVessels.getVesselType().getName();
GenericCell selectedCell = null;
for (VesselType v : vesselTypes){
GenericCell cell = new GenericCell(v.getName(), v, VesselType.class);
model.addElement(cell);
- if (v.getName().equals(vesselTypeSelectedName)){
- selectedCell = cell;
+ if (setOfVessels != null){
+ if (setOfVessels.getVesselType() != null){
+ if (v.getName().equals(setOfVessels.getVesselType().getName())){
+ selectedCell = cell;
+ }
+ }
}
}
fieldSetOfVesselsVesselType.setModel(model);
- fieldSetOfVesselsVesselType.setSelectedItem(selectedCell);
+ if (selectedCell != null){
+ fieldSetOfVesselsVesselType.setSelectedItem(selectedCell);
+ }
}
protected void setFieldSetOfVesselsTechnicalEfficiencyModel(fr.ifremer.isisfish.entities.SetOfVessels setOfVessels){
DefaultComboBoxModel model = new DefaultComboBoxModel();
java.util.List<Formule> formule = getContextValue(InputAction.class).getFormules("TechnicalEfficiency");
String formuleSelectedName = null;
- if (setOfVessels.getTechnicalEfficiencyEquation() != null){
- formuleSelectedName = setOfVessels.getTechnicalEfficiencyEquation().getName();
- }
GenericCell selectedCell = null;
for (Formule f : formule){
GenericCell cell = new GenericCell(f.getName(), f, Formule.class);
model.addElement(cell);
- if (f.getName().equals(formuleSelectedName)){
- selectedCell = cell;
+ if(setOfVessels != null){
+ if (setOfVessels.getTechnicalEfficiencyEquation() != null){
+ if (f.getName().equals(formuleSelectedName)){
+ selectedCell = cell;
+ }
+ }
}
}
fieldSetOfVesselsTechnicalEfficiency.setModel(model);
- fieldSetOfVesselsTechnicalEfficiency.setSelectedItem(selectedCell);
+ if(selectedCell != null){
+ fieldSetOfVesselsTechnicalEfficiency.setSelectedItem(selectedCell);
+ }
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("SetOfVessels");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.SetOfVessels.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("SetOfVessels");
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.SetOfVessels.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -198,8 +221,9 @@
getContextValue(InputAction.class).getSetOfVessels().setComment(fieldSetOfVesselsComment.getText());
}
protected void saveAsModel(){
- GenericCell g = (GenericCell)fieldSetOfVesselsTechnicalEfficiency.getSelectedItem();
- getContextValue(InputAction.class).saveEquationAsModel((Equation)g.getValue());
+// GenericCell g = (GenericCell)fieldSetOfVesselsTechnicalEfficiency.getSelectedItem();
+// getContextValue(InputAction.class).saveEquationAsModel((Equation)g.getValue());
+ getContextValue(InputAction.class).saveAsModel("SetOfVessels", "Java", editor.getText());
setInfoText(_("isisfish.message.saveModel.finished"));
}
protected void openEditor(){
@@ -216,7 +240,7 @@
<JLabel text="isisfish.setOfVessels.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldSetOfVesselsName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -240,7 +264,7 @@
<JLabel text="isisfish.setOfVessels.numberOfVessels"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsNumberOfVessels" onKeyTyped='numberOfVesselsChanged()'/>
+ <JTextField id="fieldSetOfVesselsNumberOfVessels" onKeyTyped='valueChanged(true)' onFocusLost='numberOfVesselsChanged()'/>
</cell>
</row>
<row>
@@ -248,7 +272,7 @@
<JLabel text="isisfish.setOfVessels.fixedCosts"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsFixedCosts" onKeyTyped='fixedCostsChanged()'/>
+ <JTextField id="fieldSetOfVesselsFixedCosts" onKeyTyped='valueChanged(true)' onFocusLost='fixedCostsChanged()'/>
</cell>
</row>
<row>
@@ -291,7 +315,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.3'>
<JScrollPane>
- <JTextArea id="fieldSetOfVesselsComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldSetOfVesselsComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -47,7 +47,7 @@
effortDescriptionUI.refresh();
}
protected void goToStrategies(){
- getParentContainer(InputUI.class).setTreeSelection(null, Strategy.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$strategies");
}
]]></script>
<JTabbedPane id="SetOfVesselsTab" name="SetOfVessels" constraints='BorderLayout.CENTER'>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -58,19 +58,30 @@
fieldSpeciesDynamicAge.setSelected(s.getAgeGroupType());
fieldSpeciesDynamicLength.setSelected(!s.getAgeGroupType());
fieldSpeciesComment.setText(s.getComment());
+ goToPopulation.setEnabled(true);
}
+ else{
+ fieldSpeciesName.setText("");
+ fieldSpeciesScientificName.setText("");
+ fieldSpeciesCodeRubbin.setText("");
+ fieldSpeciesCEE.setText("");
+ fieldSpeciesComment.setText("");
+ goToPopulation.setEnabled(false);
+ }
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Species");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Species.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Species");
- getParentContainer(InputUI.class).setTreeSelection(topia, Species.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId());
+
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -87,7 +98,8 @@
refresh();
}
protected void goToPopulation(){
- getParentContainer(InputUI.class).setTreeSelection(null, Population.class);
+ Species s = getContextValue(InputAction.class).getSpecies();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ s.getTopiaId() +"/$populations");
}
protected void valueChanged(boolean b){
changed=b;
@@ -139,7 +151,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldSpeciesName" onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -148,7 +160,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesScientificName" onKeyTyped='scientificNameChanged()'/>
+ <JTextField id="fieldSpeciesScientificName" onFocusLost='scientificNameChanged()'/>
</cell>
</row>
<row>
@@ -158,7 +170,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesCodeRubbin" onKeyTyped='codeChanged()'/>
+ <JTextField id="fieldSpeciesCodeRubbin" onFocusLost='codeChanged()'/>
</cell>
</row>
<row>
@@ -167,7 +179,7 @@
</cell>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JTextField id="fieldSpeciesCEE" onKeyTyped='CEEChanged()'/>
+ <JTextField id="fieldSpeciesCEE" onFocusLost='CEEChanged()'/>
</cell>
</row>
<row>
@@ -190,7 +202,7 @@
</cell>
<cell fill='both' columns='2' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldSpeciesComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldSpeciesComment" onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
@@ -218,7 +230,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continuePopulations" onActionPerformed='goToPopulation()'/>
+ <JButton id='goToPopulation' text="isisfish.input.continuePopulations" enabled='false' onActionPerformed='goToPopulation()'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -59,7 +59,7 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Strategy");
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.Strategy.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -56,6 +56,14 @@
setFieldStrategyMonthInfoProportionModel();
valueChanged(false);
}
+ else{
+ DefaultComboBoxModel model = new DefaultComboBoxModel();
+ fieldStrategyMonthInfoTripType.setModel(model);
+ numberOfTrips.setText("");
+ fieldStrategyMonthInfoMinInactivityDays.setText("");
+ fieldStrategyMonthInfoProportion.setMatrix(null);
+ valueChanged(false);
+ }
}
protected void setFieldStrategyMonthInfoTripTypeModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
@@ -128,7 +136,7 @@
<JLabel text="isisfish.strategyMonthInfo.minInactivityDays"/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldStrategyMonthInfoMinInactivityDays" onKeyTyped='minInactivityDayChanged()'/>
+ <JTextField id="fieldStrategyMonthInfoMinInactivityDays" onKeyTyped='valueChanged(true)' onFocusLost='minInactivityDayChanged()'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -124,8 +124,9 @@
getContextValue(InputAction.class).getSetOfVessels().setName(fieldStrategyName.getText());
}
protected void saveModel(){
- GenericCell g = (GenericCell)fieldStrategyInactivity.getSelectedItem();
- getContextValue(InputAction.class).saveEquationAsModel((Equation)g.getValue());
+// GenericCell g = (GenericCell)fieldStrategyInactivity.getSelectedItem();
+// getContextValue(InputAction.class).saveEquationAsModel((Equation)g.getValue());
+ getContextValue(InputAction.class).saveAsModel("Strategy", "Java", editor.getText());
setInfoText(_("isisfish.message.saveModel.finished"));
}
protected void openEditor(){
@@ -136,13 +137,14 @@
TopiaEntity topia = getContextValue(InputAction.class).create("Strategy");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.Strategy.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Strategy");
- getParentContainer(InputUI.class).setTreeSelection(topia, fr.ifremer.isisfish.entities.Strategy.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -176,7 +178,7 @@
<JLabel text="isisfish.strategy.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldStrategyName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldStrategyName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -192,7 +194,7 @@
<JLabel text="isisfish.strategy.proportionSetOfVessels"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldStrategyProportionSetOfVessels" onKeyTyped='proportionSetOfVesselsChanged()'/>
+ <JTextField id="fieldStrategyProportionSetOfVessels" onKeyTyped='valueChanged(true)' onFocusLost='proportionSetOfVesselsChanged()'/>
</cell>
</row>
<row>
@@ -241,7 +243,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.3'>
<JScrollPane>
- <JTextArea id="fieldStrategyComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldStrategyComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -53,6 +53,12 @@
fieldTripTypeMinTimeBetweenTrip.setText("" + getContextValue(InputAction.class).getTripType().getMinTimeBetweenTrip().getHour());
fieldTripTypeComment.setText(getContextValue(InputAction.class).getTripType().getComment());
}
+ else{
+ fieldTripTypeName.setText("");
+ fieldTripTypeDuration.setText("");
+ fieldTripTypeMinTimeBetweenTrip.setText("");
+ fieldTripTypeComment.setText("");
+ }
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -83,13 +89,14 @@
TopiaEntity topia = getContextValue(InputAction.class).create("TripType");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, TripType.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("TripType");
- getParentContainer(InputUI.class).setTreeSelection(topia, TripType.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -106,7 +113,7 @@
refresh();
}
protected void goToVesselTypes(){
- getParentContainer(InputUI.class).setTreeSelection(null, VesselType.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes");
}
]]>
</script>
@@ -118,7 +125,7 @@
<JLabel text="isisfish.tripType.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldTripTypeName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldTripTypeName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -126,7 +133,7 @@
<JLabel text="isisfish.tripType.duration"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldTripTypeDuration" onKeyTyped='typeDurationChanged()'/>
+ <JTextField id="fieldTripTypeDuration" onKeyTyped='valueChanged(true)' onFocusLost='typeDurationChanged()'/>
</cell>
</row>
<row>
@@ -134,7 +141,7 @@
<JLabel text="isisfish.tripType.minTime"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldTripTypeMinTimeBetweenTrip" onKeyTyped='minTimeChanged()'/>
+ <JTextField id="fieldTripTypeMinTimeBetweenTrip" onKeyTyped='valueChanged(true)' onFocusLost='minTimeChanged()'/>
</cell>
</row>
<row>
@@ -144,7 +151,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JTextArea id="fieldTripTypeComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldTripTypeComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -47,6 +47,7 @@
}
protected void refresh() {
VesselType vesselType = getContextValue(InputAction.class).getVesselType();
+ setVesselTypeTripTypeModel();
if (vesselType != null){
fieldVesselTypeName.setText(vesselType.getName());
fieldVesselTypeLength.setText("" + vesselType.getLength());
@@ -56,9 +57,20 @@
fieldVesselTypeMinCrewSize.setText("" + vesselType.getMinCrewSize());
fieldVesselTypeSpeed.setText("" + vesselType.getSpeed());
fieldVesselTypeUnitFuelCostOfTravel.setText("" + vesselType.getUnitFuelCostOfTravel());
- setVesselTypeTripTypeModel();
fieldVesselTypeComment.setText(vesselType.getComment());
}
+ else {
+ fieldVesselTypeName.setText("");
+ fieldVesselTypeLength.setText("");
+ fieldVesselTypeSpeed.setText("");
+ fieldVesselTypeMaxTripDuration.setText("");
+ fieldVesselTypeActivityRange.setText("");
+ fieldVesselTypeMinCrewSize.setText("");
+ fieldVesselTypeSpeed.setText("");
+ fieldVesselTypeUnitFuelCostOfTravel.setText("");
+ fieldVesselTypeComment.setText("");
+
+ }
}
protected void setVesselTypeTripTypeModel(){
java.util.List<TripType> tripTypes = getContextValue(InputAction.class).getFisheryRegion().getTripType();
@@ -72,13 +84,14 @@
TopiaEntity topia = getContextValue(InputAction.class).create("VesselType");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, VesselType.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("VesselType");
- getParentContainer(InputUI.class).setTreeSelection(topia, VesselType.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -104,7 +117,7 @@
save.setEnabled(b);
}
protected void goToSetOfVessels(){
- getParentContainer(InputUI.class).setTreeSelection(null, VesselType.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels");
}
protected void nameChanged(){
getContextValue(InputAction.class).getVesselType().setName(fieldVesselTypeName.getText());
@@ -148,7 +161,7 @@
<JLabel text="isisfish.vesselType.name"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeName" onKeyTyped='nameChanged()'/>
+ <JTextField id="fieldVesselTypeName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()'/>
</cell>
</row>
<row>
@@ -156,7 +169,7 @@
<JLabel text="isisfish.vesselType.length"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeLength" onKeyTyped='lenghtChanged()'/>
+ <JTextField id="fieldVesselTypeLength" onKeyTyped='valueChanged(true)' onFocusLost='lenghtChanged()'/>
</cell>
</row>
<row>
@@ -164,7 +177,7 @@
<JLabel text="isisfish.vesselType.speed"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeSpeed" onKeyTyped='speedChanged()'/>
+ <JTextField id="fieldVesselTypeSpeed" onKeyTyped='valueChanged(true)' onFocusLost='speedChanged()'/>
</cell>
</row>
<row>
@@ -172,7 +185,7 @@
<JLabel text="isisfish.vesselType.maxDuration"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeMaxTripDuration" onKeyTyped='tripDurationChanged()'/>
+ <JTextField id="fieldVesselTypeMaxTripDuration" onKeyTyped='valueChanged(true)' onFocusLost='tripDurationChanged()'/>
</cell>
</row>
<row>
@@ -180,7 +193,7 @@
<JLabel text="isisfish.vesselType.activityRange"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeActivityRange" onKeyTyped='activityRangeChanged()'/>
+ <JTextField id="fieldVesselTypeActivityRange" onKeyTyped='valueChanged(true)' onFocusLost='activityRangeChanged()'/>
</cell>
</row>
<row>
@@ -188,7 +201,7 @@
<JLabel text="isisfish.vesselType.miniCrew"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeMinCrewSize" onKeyTyped='minCrewChanged()'/>
+ <JTextField id="fieldVesselTypeMinCrewSize" onKeyTyped='valueChanged(true)' onFocusLost='minCrewChanged()'/>
</cell>
</row>
<row>
@@ -196,7 +209,7 @@
<JLabel text="isisfish.vesselType.fuelCost"/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldVesselTypeUnitFuelCostOfTravel" onKeyTyped='unitFuelCostChanged()'/>
+ <JTextField id="fieldVesselTypeUnitFuelCostOfTravel" onKeyTyped='valueChanged(true)' onFocusLost='unitFuelCostChanged()'/>
</cell>
</row>
<row>
@@ -215,7 +228,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.3'>
<JScrollPane>
- <JTextArea id="fieldVesselTypeComment" onKeyTyped='commentChanged()'/>
+ <JTextArea id="fieldVesselTypeComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()'/>
</JScrollPane>
</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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -68,7 +68,7 @@
System.out.println(changed);
if (changed){
if (!askAndSave()){
- getParentContainer(InputUI.class).setTreeSelection(getContextValue(InputAction.class).getSelected(), Zone.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$zones"+getContextValue(InputAction.class).getZone().getTopiaId());
}
}
}
@@ -99,8 +99,6 @@
protected void refresh() {
Zone z = getContextValue(InputAction.class).getZone();
if (z != null){
- //DefaultComboBoxModel model = new DefaultComboBoxModel(getContextValue(InputAction.class).getFisheryRegion().getCell().toArray());
- //zoneCells.setModel(model);
DefaultListModel zoneCellsModel = new DefaultListModel();
java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
for (Cell c : cells){
@@ -108,13 +106,15 @@
}
zoneCells.setModel(zoneCellsModel);
java.util.List<Cell> cellsSelected = z.getCell();
- int[] indexs = new int[zoneCellsModel.size()];
- int i = 0;
- for (Cell c : cellsSelected){
- indexs[i] = zoneCellsModel.indexOf(c);
- i++;
+ if (cellsSelected != null){
+ int[] indexs = new int[zoneCellsModel.size()];
+ int i = 0;
+ for (Cell c : cellsSelected){
+ indexs[i] = zoneCellsModel.indexOf(c);
+ i++;
+ }
+ zoneCells.setSelectedIndices(indexs);
}
- zoneCells.setSelectedIndices(indexs);
fieldZoneName.setText(z.getName());
fieldZoneComment.setText(getContextValue(InputAction.class).getZone().getComment());
@@ -126,6 +126,23 @@
zoneMapPanel.add(zoneMap, BorderLayout.CENTER);
refreshMap();
}
+ else{
+ DefaultListModel zoneCellsModel = new DefaultListModel();
+ java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
+ for (Cell c : cells){
+ zoneCellsModel.addElement(c);
+ }
+ zoneCells.setModel(zoneCellsModel);
+ fieldZoneName.setText("");
+ fieldZoneComment.setText("");
+
+ zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(zoneMap);
+ toolMap.add((Component)toolSet);
+ zoneMapPanel.add(toolMap, BorderLayout.NORTH);
+ zoneMapPanel.add(zoneMap, BorderLayout.CENTER);
+ refreshMap();
+ }
}
protected void refreshMap(){
java.util.List<Cell> cells = new ArrayList<Cell>();
@@ -138,13 +155,14 @@
TopiaEntity topia = getContextValue(InputAction.class).create("Zone");
getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection(topia, Zone.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId());
setInfoText(_("isisfish.message.creation.finished"));
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save("Zone");
- getParentContainer(InputUI.class).setTreeSelection(topia, Zone.class);
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
valueChanged(false);
@@ -161,7 +179,7 @@
refresh();
}
protected void goToPort(){
- getParentContainer(InputUI.class).setTreeSelection(null, Port.class);
+ getParentContainer(InputUI.class).setTreeSelection("$root/$ports");
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -206,7 +224,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldZoneName" onKeyTyped='nameChange()'/>
+ <JTextField id="fieldZoneName" onKeyTyped='valueChanged(true)' onFocusLost='nameChange()'/>
</cell>
</row>
<row>
@@ -229,7 +247,7 @@
<row>
<cell columns='2' fill='both' weighty='0.3' weightx='1.0'>
<JScrollPane>
- <JTextArea id="fieldZoneComment" onKeyTyped='commentChange()'/>
+ <JTextArea id="fieldZoneComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChange()'/>
</JScrollPane>
</cell>
</row>
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx 2008-12-08 18:13:52 UTC (rev 1645)
@@ -0,0 +1,51 @@
+<JDialog title='isisfish.error.dialog.title'>
+ <script>
+/** le dialogue pour afficher les erreurs */
+protected static ErrorDialogUI instance;
+
+public static void showError(Exception e) {
+ if (instance == null) { instance = new ErrorDialogUI(); }
+ instance.getErrorMessage().setText(e.getMessage());
+ StringWriter w = new StringWriter();
+ e.printStackTrace(new PrintWriter(w));
+ instance.getErrorStack().setText(w.toString());
+ instance.getErrorStack().setCaretPosition(0);
+ instance.pack();
+ instance.setVisible(true);
+}
+public static void disposeUI() {
+ instance=null;
+}
+
+JRootPane rootPane = getRootPane();
+rootPane.setDefaultButton(close);
+rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
+rootPane.getActionMap().put("close", close.getAction());
+ </script>
+ <Table>
+ <row fill='both'>
+ <cell>
+ <JPanel>
+ <JLabel text='isisfish.error.dialog.message'/>
+ </JPanel>
+ </cell>
+ </row>
+ <row fill='both'>
+ <cell>
+ <JLabel id='errorMessage'/>
+ </cell>
+ </row>
+ <row fill='both' weightx='1' weighty='1'>
+ <cell>
+ <JScrollPane width='600' height='200'>
+ <JTextArea id='errorStack' editable='false' font-size='9'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell>
+ <JButton id='close' text='isisfish.welcome.menu.close' onActionPerformed='dispose()'/>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-08 18:13:52 UTC (rev 1645)
@@ -213,7 +213,7 @@
isisfish.equation.editor.title=Equation Editor
isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Error while adding of result to the map.
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
isisfish.error.add.result.data=Error while adding result ot data.
isisfish.error.add.result.graph=Error while adding result to graph
isisfish.error.add.tray=Can't add system tray icon
@@ -226,6 +226,8 @@
isisfish.error.delete.database=Can't delete database
isisfish.error.delete.file=could not delete file %1$s
isisfish.error.delete.vcs.files=Can't delete vcs files
+isisfish.error.dialog.message=Some errors have been detected
+isisfish.error.dialog.title=Error...
isisfish.error.during.simulation=Error during simulation
isisfish.error.emigration.negative=emigration negative
isisfish.error.empty.code.rubbin=rubbin's code is empty
@@ -282,13 +284,13 @@
isisfish.error.log.foundAppender=\=could not found log appender %1$s for category %2$s
isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
+isisfish.error.no.matrix=No matrix for\:
isisfish.error.no.null.time.step=Error, the time step should not be null
isisfish.error.no.sector=No sector defined
isisfish.error.no.select.simulation=could not select simulation
isisfish.error.no.selected.simulation=No Simulation selected
isisfish.error.no.target.species=no target species in %1$s for %2$s
-isisfish.error.not.found.class=this class does not
+isisfish.error.not.found.class=this class does not
isisfish.error.not.found.code=could not found codeclass for %1$s
isisfish.error.not.found.description=could not found description for %1$s
isisfish.error.not.found.field=could not found field %1$s doc for %1$s
@@ -297,7 +299,7 @@
isisfish.error.not.null.mean.weight=poids moyen nul
isisfish.error.not.null.natiral.death=natural mortality null
isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
-isisfish.error.not.support.class=this class does not support
+isisfish.error.not.support.class=this class does not support
isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
isisfish.error.obtain.doc.export=Can't obtain @Doc on class export
@@ -522,7 +524,7 @@
isisfish.message.commit.finished=commit finished
isisfish.message.commit.region.canceled=Commit region canceled
isisfish.message.commiting.region=Commiting region %1$s ...
-isisfish.message.compilation.time=Compilation time %1$ss
+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'
@@ -548,8 +550,8 @@
isisfish.message.import.region.xml=XMLed Region
isisfish.message.import.region.zipped=Zipped Region
isisfish.message.import.scripts.file.cancelled=Import scripts cancelled
-isisfish.message.import.xml.v2.file\ =Import xml v2 file
-isisfish.message.import.zip=Import zip file
+isisfish.message.import.xml.v2.file\ =Import xml v2 file
+isisfish.message.import.zip=Import zip file
isisfish.message.load.finished=load finished
isisfish.message.load.map=Try to load map file\: %1$s (%2$s, %3$s)
isisfish.message.load.region.canceled=load region canceled
@@ -608,7 +610,7 @@
isisfish.month.november=november
isisfish.month.october=october
isisfish.month.september=september
-isisfish.notitle=\
+isisfish.notitle=/
isisfish.params.changeLogLev=Change from level '%1$s' to level '%2$s'
isisfish.params.clearFilter=Clear filter
isisfish.params.description=Description
@@ -626,7 +628,7 @@
isisfish.params.toString.number.years=Number of years\: %1$s\\n\\n
isisfish.params.toString.plan=Plan\: %1$s
isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\\n\\n
-isisfish.params.toString.populations=Populations\:
+isisfish.params.toString.populations=Populations\:
isisfish.params.toString.rule=Rule\: %1$s
isisfish.params.toString.script.logger.level=Level of scripts' logger %1$s
isisfish.params.toString.script.presimulation=Script de presimulation
@@ -721,15 +723,15 @@
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
isisfish.result.add=Add a result
-isisfish.result.begin.simulation=En debut de Simulation\:
+isisfish.result.begin.simulation=En debut de Simulation\:
isisfish.result.capture=Capture
isisfish.result.capture.metier=Capture par metier
isisfish.result.choose.simulation=Choose a Simulation
isisfish.result.datas=Datas
isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension\ =Dimension
-isisfish.result.end.simulation=En fin de Simulation\:
+isisfish.result.dimension\ =Dimension
+isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
isisfish.result.export.file=Export text file
isisfish.result.file=File
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-02 21:13:10 UTC (rev 1644)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-08 18:13:52 UTC (rev 1645)
@@ -213,7 +213,7 @@
isisfish.equation.editor.title=Editeur d'\u00E9quation
isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Erreur lors de l'ajout du r\u00E9sultat \u00E0 la carte.
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
isisfish.error.add.result.data=Erreur lors de l'ajout du r\u00E9sultat au data.
isisfish.error.add.result.graph=Erreur lors de l'ajout du r\u00E9sultat au graph.
isisfish.error.add.tray=Impossible d'ajouter une icone de notification
@@ -226,6 +226,8 @@
isisfish.error.delete.database=Can't delete database
isisfish.error.delete.file=could not delete file %1$s
isisfish.error.delete.vcs.files=Can't delete vcs files
+isisfish.error.dialog.message=Une erreur a \u00E9t\u00E9 d\u00E9tect\u00E9e
+isisfish.error.dialog.title=Erreur...
isisfish.error.during.simulation=Error during simulation
isisfish.error.emigration.negative=emigration negative
isisfish.error.empty.code.rubbin=le code rubbin est vide
@@ -282,13 +284,13 @@
isisfish.error.log.foundAppender=n'a pas trouve l'appender %1$s pour la categorie %2$s
isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
+isisfish.error.no.matrix=No matrix for\:
isisfish.error.no.null.time.step=Error, the time step should not be null
isisfish.error.no.sector=il n'y a pas de secteur de d\u00E9finit
isisfish.error.no.select.simulation=could not select simulation
isisfish.error.no.selected.simulation=No Simulation selected
isisfish.error.no.target.species=no target species in %1$s for %2$s
-isisfish.error.not.found.class=this class does not
+isisfish.error.not.found.class=this class does not
isisfish.error.not.found.code=could not found codeclass for %1$s
isisfish.error.not.found.description=could not found description for %1$s
isisfish.error.not.found.field=could not found field %1$s doc for %1$s
@@ -297,9 +299,9 @@
isisfish.error.not.null.mean.weight=poids moyen nul
isisfish.error.not.null.natiral.death=mortalite naturelle nulle
isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
-isisfish.error.not.support.class=this class does not support
+isisfish.error.not.support.class=this class does not support
isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
-isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
+isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
isisfish.error.obtain.doc.export=Can't obtain @Doc on class Export
isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
@@ -522,10 +524,10 @@
isisfish.message.commit.finished=commit termin\u00E9
isisfish.message.commit.region.canceled=Commit de la r\u00E9gion annul\u00E9
isisfish.message.commiting.region=En train de commiter la r\u00E9gion %1$s ...
-isisfish.message.compilation.time=Temps de compilation %1$ss
+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.create.region.canceled=Creation de r\u00E9gion annul\u00E9e
@@ -548,8 +550,8 @@
isisfish.message.import.region.xml=Region XML (Isis-Fish V2.x)
isisfish.message.import.region.zipped=Zipped Region
isisfish.message.import.scripts.file.cancelled=Importation des scripts annul\u00E9
-isisfish.message.import.xml.v2.file\ =Import xml v2 file
-isisfish.message.import.zip=Import zip file
+isisfish.message.import.xml.v2.file\ =Import xml v2 file
+isisfish.message.import.zip=Import zip file
isisfish.message.load.finished=Chargement termin\u00E9
isisfish.message.load.map=Chargement de la carte \: %1$s (%2$s, %3$s)
isisfish.message.load.region.canceled=chargement de r\u00E9gion annul\u00E9
@@ -608,7 +610,7 @@
isisfish.month.november=novembre
isisfish.month.october=octobre
isisfish.month.september=september
-isisfish.notitle=\
+isisfish.notitle=/
isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
isisfish.params.clearFilter=Reset filtre
isisfish.params.description=Description
@@ -626,7 +628,7 @@
isisfish.params.toString.number.years=Nombre d'ann\u00E9\u00E9s \: %1$s\\n\\n
isisfish.params.toString.plan=Plan\: %1$s
isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\\n\\n
-isisfish.params.toString.populations=Populations\:
+isisfish.params.toString.populations=Populations\:
isisfish.params.toString.rule=Rule\: %1$s
isisfish.params.toString.script.logger.level=niveau du logger de scripts %1$s
isisfish.params.toString.script.presimulation=Script de presimulation
@@ -721,15 +723,15 @@
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
isisfish.result.add=Ajouter un r\u00E9sultat\=
-isisfish.result.begin.simulation=En debut de Simulation\:
+isisfish.result.begin.simulation=En debut de Simulation\:
isisfish.result.capture=Capturer
isisfish.result.capture.metier=Capturer par metier
isisfish.result.choose.simulation=Choisir une simulation
isisfish.result.datas=Donn\u00E9es
isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension\ =Dimension
-isisfish.result.end.simulation=En fin de Simulation\:
+isisfish.result.dimension\ =Dimension
+isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
isisfish.result.export.file=Exporter text file
isisfish.result.file=Fichier
1
0
Author: tchemit
Date: 2008-12-02 21:13:10 +0000 (Tue, 02 Dec 2008)
New Revision: 1644
Modified:
isis-fish/trunk/pom.xml
Log:
use webstart new version (with new groupId...) wich allows inline mode
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-02 20:57:45 UTC (rev 1643)
+++ isis-fish/trunk/pom.xml 2008-12-02 21:13:10 UTC (rev 1644)
@@ -433,11 +433,11 @@
<executions>
<execution>
<phase>package</phase>
- <configuration>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- </configuration>
</execution>
</executions>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ </configuration>
</plugin>
<plugin>
@@ -500,14 +500,14 @@
<!-- Java Web Start -->
<!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
<plugin>
- <groupId>org.codehaus.mojo</groupId>
+ <groupId>org.codehaus.mojo.webstart</groupId>
<artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-1</version>
+ <version>1.0-alpha-2-cl_20081018</version>
<executions>
<execution>
<phase>deploy</phase>
<goals>
- <goal>jnlp</goal>
+ <goal>jnlp-inline</goal>
</goals>
</execution>
</executions>
1
0
r1643 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input src/main/resources src/main/resources/i18n
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
by tchemit@users.labs.libre-entreprise.org 02 Dec '08
02 Dec '08
Author: tchemit
Date: 2008-12-02 20:57:45 +0000 (Tue, 02 Dec 2008)
New Revision: 1643
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
isis-fish/trunk/src/main/resources/log4j.properties
Log:
l'arbe fonctionne :)
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-02 17:03:51 UTC (rev 1642)
+++ isis-fish/trunk/pom.xml 2008-12-02 20:57:45 UTC (rev 1643)
@@ -382,26 +382,22 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinwidget</artifactId>
- <version>${lutinwidget.version}</version>
- <scope>runtime</scope>
+ <version>${lutinwidget.version}</version>
</dependency>
<dependency>
<groupId>org.codelutin.topia</groupId>
<artifactId>topia-persistence</artifactId>
<version>${topia.version}</version>
- <scope>runtime</scope>
</dependency>
<dependency>
<groupId>jfreechart</groupId>
<artifactId>jfreechart</artifactId>
<version>0.9.3</version>
- <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinmatrix</artifactId>
<version>1.1</version>
- <scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-02 17:03:51 UTC (rev 1642)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-02 20:57:45 UTC (rev 1643)
@@ -115,6 +115,7 @@
protected Strategy strategy;
public InputAction() {
+ log.info("new instance");
}
protected void showMsgBox(String txt){
if (txt != null){
@@ -133,7 +134,11 @@
vesselType = null;
setOfVessels = null;
strategy = null;
- System.out.println(value.getClass().getName());
+ selected=null;
+ if (!(value instanceof TopiaEntity)) {
+ // this is not a TopiaEntity value, so quit
+ return;
+ }
switch (IsisFishEntityEnum.valueOf(value.getClass())){
case Zone:
zone = (Zone) value;
@@ -459,7 +464,6 @@
* if this method return false, nothing is do
*
* @return false if user want cancel action, true otherwize
- * @throws TopiaException
*/
protected boolean askForSave() {
boolean result = true;
@@ -627,10 +631,10 @@
* Save an Equation as model, to reuse it for other equation
*
* @param category
- * categoy for this equation
- * @param isisfish
+ * category for this equation
+ * @param language
* equation to put in models
- * @param language
+ * @param content content ?
* @return if ok return null else OutputView error message
*/
public Object saveAsModel(String category, String language, String content) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-02 17:03:51 UTC (rev 1642)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-02 20:57:45 UTC (rev 1643)
@@ -5,40 +5,38 @@
package fr.ifremer.isisfish.ui.input;
-import java.awt.Component;
-import java.lang.reflect.Method;
-import javax.swing.JPanel;
-import javax.swing.event.TreeSelectionEvent;
import jaxx.runtime.swing.CardLayout2;
import jaxx.runtime.swing.JAXXTree;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
-import jaxx.runtime.swing.navigation.NavigationTreeSelectionAdapter;
import jaxx.runtime.swing.navigation.NavigationTreeSelectionAdapterWithCardLayout;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-/**
- *
- * @author letellier
- */
+import javax.swing.JPanel;
+import javax.swing.event.TreeSelectionEvent;
+import java.awt.Component;
+import java.lang.reflect.Method;
+
+/** @author letellier */
public class InputNavigationTreeSelectionAdapter extends NavigationTreeSelectionAdapterWithCardLayout {
/** to use log facility, just put in your code: log.info(\"...\"); */
static private final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
- public InputNavigationTreeSelectionAdapter (InputUI context, boolean register) {
- super(InputUI.class, null, context);
+ public InputNavigationTreeSelectionAdapter(InputUI context, boolean register) {
+ super(InputUI.class, null, context, Strategy.PER_UI_TYPE);
if (context.getNavigation() == null) {
throw new IllegalArgumentException("could not have a null 'navigation' in ui " + context);
}
-// Util.checkJAXXContextEntry(context, ContextHelper.NAVIGATION_MODEL_ENTRY_DEF);
+
if (register) {
// register in tree this listener
context.getNavigation().addTreeSelectionListener(this);
}
}
+
@Override
protected JPanel getContentContainer() {
return ((InputUI) context).getInputPane();
@@ -58,6 +56,7 @@
protected void goBackToPreviousNode(TreeSelectionEvent event, Exception e) {
if (e != null) {
// ErrorDialogUI.showError(e);
+ e.printStackTrace();
}
// go back to previous node
returnToPreviousNode(getNavigationTree(), event);
@@ -69,92 +68,26 @@
}
@Override
- public void valueChanged(TreeSelectionEvent event) {
- if (event.getOldLeadSelectionPath() != null && event.getOldLeadSelectionPath().equals(event.getPath())) {
- // do not treate this if no path changed
- return;
- }
-
+ protected void openUI(Component newUI, NavigationTreeNode node) throws Exception {
+ super.openUI(newUI, node);
+ // apply refresh method (should a contract for all this ui with a method refresh...)
try {
-
- NavigationTreeNode node = prepareNode(event);
-
- String path = node.getContextPath();
-
- if (log.isTraceEnabled()) {
- log.trace(path);
- }
-
- Component newUI = getNewUI(path);
- Component component = getCurrentUI();
-
- if (newUI != null && newUI.equals(component)) {
- // call back from goto back to previous node, do nothing
- return;
- }
-
- if (!closeUI(event, component)) {
- // previous ui was not closed, so reselect the previous node in navigation
- goBackToPreviousNode(event, null);
- // and quit
- return;
- }
-
- // now, we are free to open the ui associated with the selected node in navigation
-
- // before all, attach bean in context associated with the selected node in naivgation tree
- Object data = getNavigationTreeModel().getJAXXContextValue(context, path);
-
- if (log.isDebugEnabled()) {
- log.debug("find data for contextPath <" + path + "> : " + (data == null ? null : data.getClass()));
- }
-
- context.removeContextValue(Object.class,NAVIGATION_SELECTED_BEAN);
- InputUI inputUI = ((InputUI)context);
- InputAction action = inputUI.getContextValue(InputAction.class);
- if (data != null) {
- action.setValue(data);
- // context.setContextValue(data, NAVIGATION_SELECTED_BEAN);
- //todo should we not use this to avoid conflict in context ?
- // context.setContextValue(data);
- }
-
-
- if (newUI == null) {
- // instanciate a new ui associated with the selected node
- newUI = createUI(node);
-
- }
-
- ((jaxx.runtime.JAXXObject)newUI).setContextValue(action);
- // save in context current node context path
- context.setContextValue(node.getContextPath(), NAVIGATION_CONTEXT_PATH);
-
- // save in context current node
- context.setContextValue(node, NAVIGATION_SELECTED_NODE);
-
- // really open the ui associated with the selected node
- openUI(newUI, node);
-
- } catch (Exception e) {
- // remove data from context
- System.out.println(e.getMessage());
- // if any error, go back to previvous node
- goBackToPreviousNode(event, e);
+ Method m = newUI.getClass().getDeclaredMethod("refresh");
+ m.setAccessible(true);
+ m.invoke(newUI);
+ } catch (NoSuchMethodException e) {
+ // ok do nothing
}
}
@Override
- protected void openUI(Component newUI, NavigationTreeNode node) throws Exception {
- CardLayout2 layout = getContentLayout();
- JPanel container = getContentContainer();
- // switch layout
- layout.show(container, node.getContextPath());
- log.info(((jaxx.runtime.JAXXObject)newUI).getContextValue(InputAction.class));
- Method m = newUI.getClass().getMethod("refresh");
- m.invoke(newUI);
-
+ protected void addSelectedBeanInContext(NavigationTreeNode node, Object data) {
+ if (log.isDebugEnabled()) {
+ log.debug("find data for contextPath <" + node.getContextPath() + "> : " + (data == null ? null : data.getClass()));
+ }
+ InputAction action = context.getContextValue(InputAction.class);
+ if (data != null) {
+ action.setValue(data);
+ }
}
-
-
}
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-02 17:03:51 UTC (rev 1642)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-02 20:57:45 UTC (rev 1643)
@@ -857,6 +857,9 @@
isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
isisfish.simulation.log.console.title=Log console for simulation '%1$s'
isisfish.simulation.log.showConsole=display log console for simulation %1$s
+isisfish.simulation.menu.import=
+isisfish.simulation.menu.save=
+isisfish.simulation.menu.simulation=
isisfish.simulation.name=Simulation name
isisfish.simulation.title=Simulation launcher
isisfish.simulator.launcher.inprocess=in current process
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-02 17:03:51 UTC (rev 1642)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-02 20:57:45 UTC (rev 1643)
@@ -857,6 +857,9 @@
isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
isisfish.simulation.log.console.title=Console de log simulation '%1$s'
isisfish.simulation.log.showConsole=affichage de la console de log pour la simulation %1$s
+isisfish.simulation.menu.import=
+isisfish.simulation.menu.save=
+isisfish.simulation.menu.simulation=
isisfish.simulation.name=Nom de la simulation
isisfish.simulation.title=Lanceur de simulation
isisfish.simulator.launcher.inprocess=dans le m\u00EAme processus
Modified: isis-fish/trunk/src/main/resources/log4j.properties
===================================================================
--- isis-fish/trunk/src/main/resources/log4j.properties 2008-12-02 17:03:51 UTC (rev 1642)
+++ isis-fish/trunk/src/main/resources/log4j.properties 2008-12-02 20:57:45 UTC (rev 1643)
@@ -14,3 +14,4 @@
log4j.logger.rules=INFO
log4j.logger.scripts=INFO
log4j.logger.simulators=INFO
+log4j.logger.fr.ifremer.isisfish.ui.input.InputNavigationTreeSelectionAdapter=DEBUG
1
0