Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
Author: chatellier
Date: 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
Author: sletellier
Date: 2008-12-02 17:03:51 +0000 (Tue, 02 Dec 2008)
New Revision: 1642
Modified:
isis-fish/trunk/pom.xml
Log:
Integration de l'arbre JAXX
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-02 16:58:11 UTC (rev 1641)
+++ isis-fish/trunk/pom.xml 2008-12-02 17:03:51 UTC (rev 1642)
@@ -297,7 +297,7 @@
<!--labs.project>isis-fish</labs.project-->
<!-- jaxx version -->
- <jaxx.version>0.6</jaxx.version>
+ <jaxx.version>0.7-SNAPSHOT</jaxx.version>
<!-- generator version -->
<generator.version>0.62-SNAPSHOT</generator.version>
1
0
r1641 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: input result script simulator versionning widget/filter
by sletellier@users.labs.libre-entreprise.org 02 Dec '08
by sletellier@users.labs.libre-entreprise.org 02 Dec '08
02 Dec '08
Author: sletellier
Date: 2008-12-02 16:58:11 +0000 (Tue, 02 Dec 2008)
New Revision: 1641
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
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/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/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/StrategyUI.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/WizardGroupCreationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/CommitDialogUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSGenerateSshKeyUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSPassPhraseUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/filter/FilterPanelUI.jaxx
Log:
Integration de l'arbre JAXX
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -50,7 +50,7 @@
protected boolean changed = false;
public CellUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
@@ -103,7 +103,7 @@
}
protected void fieldCellChanged(){
Cell c = (Cell)fieldCell.getSelectedItem();
- getContextValue(InputAction.class).setValue(c, Cell.class);
+ getContextValue(InputAction.class).setValue(c);
getParentContainer(InputUI.class).setTreeSelection(c, Cell.class);
refresh();
valueChanged(true);
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -42,7 +42,7 @@
boolean changed = false;
public EffortDescriptionUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -39,7 +39,7 @@
protected boolean changed = false;
public GearTabUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -39,7 +39,7 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Metier;
public GearUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-02 16:58:11 UTC (rev 1641)
@@ -35,6 +35,7 @@
*/
import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishEntityEnum;
import fr.ifremer.isisfish.datastore.FormuleStorage;
import java.util.List;
@@ -101,7 +102,6 @@
protected FisheryRegion fisheryRegion = null;
protected TopiaContext isisContext = null;
protected TopiaEntity selected;
- protected Class selectedType;
protected Cell cell;
protected Zone zone;
protected Port port;
@@ -121,33 +121,55 @@
showMessageDialog(null, txt);
}
}
- public void setValue(Object value, Class type) {
- if (type == Zone.class) {
- zone = (Zone) value;
- } else if (type == Cell.class) {
- cell = (Cell) value;
- } else if (type == Port.class) {
- port = (Port) value;
- } else if (type == Species.class) {
- species = (Species) value;
- } else if (type == Population.class) {
- population = (Population) value;
- } else if (type == Gear.class) {
- gear = (Gear) value;
- } else if (type == Metier.class) {
- metier = (Metier) value;
- } else if (type == TripType.class) {
- tripType = (TripType) value;
- } else if (type == VesselType.class) {
- vesselType = (VesselType) value;
- } else if (type == SetOfVessels.class) {
- setOfVessels = (SetOfVessels) value;
- } else if (type == Strategy.class) {
- strategy = (Strategy) value;
+ public void setValue(Object value) {
+ cell = null;
+ zone = null;
+ port = null;
+ species = null;
+ population = null;
+ gear = null;
+ metier = null;
+ tripType = null;
+ vesselType = null;
+ setOfVessels = null;
+ strategy = null;
+ System.out.println(value.getClass().getName());
+ switch (IsisFishEntityEnum.valueOf(value.getClass())){
+ case Zone:
+ zone = (Zone) value;
+ break;
+ case Cell:
+ cell = (Cell) value;
+ break;
+ case Port:
+ port = (Port) value;
+ break;
+ case Species:
+ species = (Species) value;
+ break;
+ case Population:
+ population = (Population) value;
+ break;
+ case Metier:
+ metier = (Metier) value;
+ break;
+ case TripType:
+ tripType = (TripType) value;
+ break;
+ case Gear:
+ gear = (Gear) value;
+ break;
+ case VesselType:
+ vesselType = (VesselType) value;
+ break;
+ case SetOfVessels:
+ setOfVessels = (SetOfVessels) value;
+ break;
+ case Strategy:
+ strategy = (Strategy) value;
+ break;
}
- selected = (TopiaEntity) value;
- selectedType = type;
-
+ selected = (TopiaEntity) value;
}
public TopiaContext getIsisContext(){
return isisContext;
@@ -264,24 +286,7 @@
log.info("new region name " + regionName);
try {
-
SimulationStorage.getSimulation(simulationName).extractRegion(regionName);
-
- // ajout de la nouvelle region dans la combo
-// frame.refreshView("fieldCurrentRegion");
-
- // on selectionne la nouvelle region, ce qui appelle loadRegion
- //TODO du au bug, on ne selectionne pas la nouvelle region import?e
- //TODO pour le moment
- //combo.setSelectedItem(regionName);
-
- //TODO Fix Bug : the call to loadRegion don't appear since a
- // ``thread:input.Input.loadRegion($inputPane, $fieldCurrentRegion/selectedItem);'' :
- // Undefined argument: $inputPane : at Line: 1 : in file: inline evaluation of:
- // ``thread:input.Input.loadRegion($inputPane, $fieldCurrentRegion/selectedItem);''
- // : ( $inputPane , $fieldCurrentRegion / selectedItem )...
-
-
} catch (StorageException e) {
log.error("Can't extract region", e);
showMsgBox("error" + e.getMessage());
@@ -405,36 +410,14 @@
public void loadRegion(String name) {
log.debug("loadRegion called");
try {
-
-// if (regionStorage != null) {
-// boolean result = askForSave();
-// if (result) {
-// addCommentOnRegion(uiContext, oldRegionStorage);
-// // close old context before change region
-// if (!oldIsisContext.isClosed()) {
-// oldIsisContext.closeContext();
-// }
-// } else {
-// frame.setInfoText(_("isisfish.message.load.region.canceled"));
-// return null;
-// }
-// }
-
regionStorage = null;
fisheryRegion = null;
isisContext = null;
-
-// initContext(uiContext);
-
if (name != null && !"".equals(name)) {
regionStorage = RegionStorage.getRegion(name);
isisContext = regionStorage.getStorage().beginTransaction();
fisheryRegion = RegionStorage.getFisheryRegion(isisContext);
}
-
-
-// ((CardLayout) inputPane.getLayout()).show(inputPane, "emptyPanel");
-
} catch (Exception eee) {
log.error("Can't load region", eee);
showMsgBox("error " + eee.getMessage());
@@ -452,30 +435,13 @@
public void newRegion(String name) {
try {
log.debug("newRegion called");
-//
-// if (oldRegionStorage != null && oldIsisContext != null) {
-// boolean result = askForSave(uiContext, frame, oldIsisContext);
-// if (result) {
-// addCommentOnRegion(uiContext, oldRegionStorage);
-// // close old context before change region
-// oldIsisContext.closeContext();
-// } else {
-// frame.setInfoText(_("isisfish.message.create.region.canceled"));
-// return null;
-// }
-// }
-
if ("".equals(name)) {
showMsgBox("error " + _("isisfish.error.region.name.empty"));
}
if (RegionStorage.getRegionNames().contains(name)) {
showMsgBox("Error " + _("isisfish.error.region.already.exists"));
}
-
-
RegionStorage.create(name);
-
-
} catch (Exception eee) {
log.error("Can't create region", eee);
showMsgBox("Error " + eee.getMessage());
@@ -497,28 +463,9 @@
*/
protected boolean askForSave() {
boolean result = true;
-// int choice = JOptionPane.showConfirmDialog(null,_("isisfish.message.page.modified"));
-// switch (choice) {
-// case JOptionPane.YES_OPTION:
-// isisContext.commitTransaction();
-// result = true;
-// break;
-// case JOptionPane.NO_OPTION:
-// isisContext.rollbackTransaction();
-// result = true;
-// break;
-// case JOptionPane.CANCEL_OPTION:
-// result = false;
-// break;
-// }
-// if (result == true) {
-// // object has been saved or no, we must refresh button
-// uiContext.setData("EntityModified", null);
-// frame.refreshViewPattern("panel.*?ButtonAction");
-// }
-//
return result;
}
+
/**
* Permet de creer simplement un nouvelle objet portant un nom par defaut.
* Le nouvel element est automatiquement selectionné dans l'arbre
@@ -561,18 +508,18 @@
public TopiaEntity save(String idToRefresh) {
log.debug("save called");
try {
- if (selected == null) {
- log.warn("Try to save null entity");
- return null;
- }
- // on est pas en autoUpdate donc il faut faire le update avant le
- // commit
- selected.update();
+ if (selected == null) {
+ log.warn("Try to save null entity");
+ return null;
+ }
+ // on est pas en autoUpdate donc il faut faire le update avant le
+ // commit
+ selected.update();
- selected.getTopiaContext().commitTransaction();
+ selected.getTopiaContext().commitTransaction();
} catch (Exception eee) {
- log.error("Can't save region", eee);
- showMsgBox("Error " + eee.getMessage());
+ log.error("Can't save region", eee);
+ showMsgBox("Error " + eee.getMessage());
}
return selected;
}
@@ -589,19 +536,15 @@
public Object cancel(String type) {
log.debug("cancel called");
try {
- isisContext.rollbackTransaction();
+ isisContext.rollbackTransaction();
- // reload the object
- if (selected != null) {
- selected = isisContext.findByTopiaId(selected.getTopiaId());
- }
-// uiContext.setData(type, entity);
-
-// frame.refreshView(type + "Tab");
-
+ // reload the object
+ if (selected != null) {
+ selected = isisContext.findByTopiaId(selected.getTopiaId());
+ }
} catch (Exception eee) {
- log.error("Can't cancel modification in region", eee);
- showMsgBox("Error " + eee.getMessage());
+ log.error("Can't cancel modification in region", eee);
+ showMsgBox("Error " + eee.getMessage());
}
return null;
}
@@ -619,43 +562,37 @@
log.debug("remove called");
String msg = "";
try {
-
- boolean doDelete = true;
- List<TopiaEntity> allWillBeRemoved = selected.getComposite();
- if (allWillBeRemoved.size() > 0) {
- String text = _(
- "isisfish.message.delete.object",
- selected.toString());
- for (TopiaEntity e : allWillBeRemoved) {
- text += ClassUtils.getShortClassName(e.getClass()) + " - "
- + e.toString() + "\n";
- }
- int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entities"), JOptionPane.YES_NO_OPTION);
- doDelete = resp == JOptionPane.YES_OPTION;
- } else {
- String text = _("isisfish.message.confirm.delete.object", selected.toString());
- int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
- doDelete = resp == JOptionPane.YES_OPTION;
- }
+ boolean doDelete = true;
+ List<TopiaEntity> allWillBeRemoved = selected.getComposite();
+ if (allWillBeRemoved.size() > 0) {
+ String text = _(
+ "isisfish.message.delete.object",
+ selected.toString());
+ for (TopiaEntity e : allWillBeRemoved) {
+ text += ClassUtils.getShortClassName(e.getClass()) + " - "
+ + e.toString() + "\n";
+ }
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entities"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ } else {
+ String text = _("isisfish.message.confirm.delete.object", selected.toString());
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ }
- if (doDelete) {
-// uiContext.setData("RegionModified", Boolean.FALSE);
-// uiContext.setData("InDeletion", Boolean.TRUE);
- selected.delete();
- isisContext.commitTransaction();
- msg = _("isisfish.message.remove.finished");
- } else {
- msg = _("isisfish.message.remove.canceled");
- }
+ if (doDelete) {
+ selected.delete();
+ isisContext.commitTransaction();
+ msg = _("isisfish.message.remove.finished");
+ } else {
+ msg = _("isisfish.message.remove.canceled");
+ }
} catch (Exception eee) {
log.error("Can't remove entity: " + selected, eee);
showMsgBox("Error " + eee.getMessage());
}
-// finally {
- // uiContext.removeData("InDeletion");
-// }
return msg;
}
@@ -678,8 +615,6 @@
.getCategory(), name, eq.getLanguage());
storage.setContent(eq.getContent());
}
-
-
}
} catch (Exception eee) {
log.error("Can't save equation as model", eee);
@@ -874,8 +809,6 @@
targetSpecies.getTargetFactorEquation().setContent(targetFactorEquation);
targetSpecies.setPrimaryCatch(primaryCatch);
m.addSpeciesTargetSpecies(targetSpecies);
-
-// frame.refreshView("inputMetierSeasonInfoSpecies");
}catch(Exception eee){
log.error("Can't add TargetSpecies", eee);
showMsgBox("Error " + eee.getMessage());
@@ -888,8 +821,6 @@
try {
if (targetSpecies != null) {
m.removeSpeciesTargetSpecies(targetSpecies);
-
-// frame.refreshView("inputMetierSeasonInfoSpecies");
}
}catch(Exception eee){
log.error("Can't remove TargetSpecies", eee);
@@ -903,15 +834,12 @@
public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
log.debug("addEffortDescription called: " + setOfVessels + " metier: " + metier);
try {
-
EffortDescriptionDAO effortDescriptionPS = IsisFishDAOHelper.getEffortDescriptionDAO(isisContext);
EffortDescription effortDescription = effortDescriptionPS.create();
effortDescription.setPossibleMetiers(metier);
effortDescription.update();
setOfVessels.addPossibleMetiers(effortDescription);
setOfVessels.update();
-// isisContext.commitTransaction();
-
}catch(Exception eee){
log.error("Can't create EffortDescription", eee);
showMsgBox("Error " + eee.getMessage());
@@ -923,7 +851,6 @@
try {
sov.removePossibleMetiers(effort);
isisContext.commitTransaction();
-
} catch (Exception eee) {
log.error("Can't remove entity: " + effort, eee);
showMsgBox("Error " + eee.getMessage());
@@ -938,8 +865,6 @@
try {
String val = JOptionPane.showInputDialog(_("isisfish.message.recruitment.number.month"));
int num = -1;
-
-
if (val != null && !"".equals(val)) {
try {
num = Integer.parseInt(val);
@@ -963,10 +888,7 @@
}
population.setRecruitmentDistribution(newMat);
population.update();
- } else {
-// new OutputView("Error.xml " + "Error " + _("isisfish.error.integer.positif"));
}
-
} catch (Exception eee) {
log.error("Can't remove PopulationSeasonInfo", eee);
showMsgBox("Error " + eee.getMessage());
Added: 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 (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-02 16:58:11 UTC (rev 1641)
@@ -0,0 +1,160 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+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
+ */
+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);
+
+ 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();
+ }
+
+ @Override
+ protected CardLayout2 getContentLayout() {
+ return ((InputUI) context).getCardlayout();
+ }
+
+ @Override
+ protected NavigationTreeModel getNavigationTreeModel() {
+ return (NavigationTreeModel) ((InputUI) context).getNavigation().getModel();
+ }
+
+ @Override
+ protected void goBackToPreviousNode(TreeSelectionEvent event, Exception e) {
+ if (e != null) {
+// ErrorDialogUI.showError(e);
+ }
+ // go back to previous node
+ returnToPreviousNode(getNavigationTree(), event);
+ }
+
+
+ protected JAXXTree getNavigationTree() {
+ return ((InputUI) context).getNavigation();
+ }
+
+ @Override
+ public void valueChanged(TreeSelectionEvent event) {
+ if (event.getOldLeadSelectionPath() != null && event.getOldLeadSelectionPath().equals(event.getPath())) {
+ // do not treate this if no path changed
+ return;
+ }
+
+ 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);
+ }
+ }
+
+ @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);
+
+ }
+
+
+}
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -31,6 +31,11 @@
*/
-->
<JPanel id="input" visible="true" size='{new Dimension(700,500)}' layout='{new BorderLayout()}' location='{new Point(0,139)}'>
+
+ <javax.swing.tree.DefaultTreeSelectionModel id='navigationSelectionModel' selectionMode='{javax.swing.tree.TreeSelectionModel.SINGLE_TREE_SELECTION}'/>
+
+ <jaxx.runtime.swing.CardLayout2 id='cardlayout'/>
+
<script><![CDATA[
import fr.ifremer.isisfish.ui.Common;
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
@@ -56,8 +61,15 @@
import javax.swing.tree.TreePath;
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.topia.TopiaException;
+ import fr.ifremer.isisfish.IsisFishEntityEnum;
+ import jaxx.runtime.JAXXContextEntryDef;
+ import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+ import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder;
+ import fr.ifremer.isisfish.entities.FisheryRegion;
+ import jaxx.runtime.swing.navigation.NavigationTreeCellRenderer;
+ import jaxx.runtime.swing.navigation.NavigationTreeModel;
- tree.addTreeSelectionListener(new TreeSelectionListener() {
+/* tree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
@@ -75,34 +87,10 @@
((CardLayout) inputPane.getLayout()).show(inputPane, name);
}
}
- });
- protected void refreshAll(GenericCell selectedValue){
- if (selectedValue.getType() == Zone.class){
- zoneUI.refresh();
- } else if (selectedValue.getType() == Cell.class){
- cellUI.refresh();
- } else if (selectedValue.getType() == Port.class){
- portUI.refresh();
- } else if (selectedValue.getType() == Species.class){
- speciesUI.refresh();
- } else if (selectedValue.getType() == Population.class){
- populationUI.refresh();
- } else if (selectedValue.getType() == Gear.class){
- gearUI.refresh();
- } else if (selectedValue.getType() == Metier.class){
- metierUI.refresh();
- } else if (selectedValue.getType() == TripType.class){
- tripTypeUI.refresh();
- } else if (selectedValue.getType() == VesselType.class){
- vesselTypeUI.refresh();
- } else if (selectedValue.getType() == SetOfVessels.class){
- setOfVesselsUI.refresh();
- } else if (selectedValue.getType() == Strategy.class){
- strategyUI.refresh();
- }
- }
+ });*/
+
public InputUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected DefaultComboBoxModel getFieldCurrentRegionModel(){
@@ -115,7 +103,7 @@
setInfoText(_("isisfish.message.load.finished"));
setTreeModel();
}
- protected void setTreeModel(){
+/* protected void setTreeModel(){
tree.setModel(getTreeModel());
}
protected DefaultTreeModel getTreeModel(){
@@ -234,7 +222,62 @@
}
}
return result;
+ } */
+ protected void setTreeModel(){
+
+ String regionName = getContextValue(InputAction.class).getFisheryRegionName();
+ if (regionName != null){
+ try {
+ 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 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);
+ NavigationTreeNode species = builder.build(root, "Species", "../species", "$species", SpeciesUI.class, null);
+ NavigationTreeNode gears = builder.build(root, "Gears", "../gear", "$gears", GearUI.class, null);
+ NavigationTreeNode metiers = builder.build(root, "Metiers", "../metier", "$metiers", MetierUI.class, null);
+ NavigationTreeNode tripTypes = builder.build(root, "TripTypes", "../tripType", "$tripTypes", TripTypeUI.class, null);
+ NavigationTreeNode vesselTypes = builder.build(root, "VesselTypes", "../vesselType", "$vesselTypes", VesselTypeUI.class, null);
+ NavigationTreeNode setOfVessels = builder.build(root, "SetOfVessels", "../setOfVessels", "$setOfVessels", SetOfVesselsUI.class, null);
+ NavigationTreeNode strategies = builder.build(root, "Strategies", "../strategy", "$strategies", StrategyUI.class, null);
+
+ setNode(builder, cells, fisheryRegion.getCell().toArray(), CellUI.class);
+ setNode(builder, zones, fisheryRegion.getZone().toArray(), ZoneUI.class);
+ setNode(builder, ports, fisheryRegion.getPort().toArray(), PortUI.class);
+ setNode(builder, gears, fisheryRegion.getGear().toArray(), GearUI.class);
+ setNode(builder, metiers, fisheryRegion.getMetier().toArray(), MetierUI.class);
+ setNode(builder, tripTypes, fisheryRegion.getTripType().toArray(), TripTypeUI.class);
+ setNode(builder, vesselTypes, fisheryRegion.getVesselType().toArray(), VesselTypeUI.class);
+ setNode(builder, setOfVessels, fisheryRegion.getSetOfVessels().toArray(), SetOfVesselsUI.class);
+ setNode(builder, strategies, fisheryRegion.getStrategy().toArray(), StrategyUI.class);
+
+ 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);
+ }
+
+ navigation.setSelectionModel(navigationSelectionModel);
+ navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
+ NavigationTreeModel model = new jaxx.runtime.swing.navigation.NavigationTreeModel(root, "/");
+ navigation.setModel(model);
+ new InputNavigationTreeSelectionAdapter(this, true);
+ } catch (Exception ex) {
+ Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
}
+ protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui){
+ for (Object o : values){
+ TopiaEntity topiaEntity = (TopiaEntity)o;
+ builder.build(parent, o.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
+ }
+ }
+ protected void setTreeSelection(TopiaEntity topia, Class type){
+ }
protected void setInfoText(String s){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(s);
@@ -328,12 +371,13 @@
</Table>
<JPanel id="treePanel" name="treePanel" layout='{new BorderLayout()}'>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JTree id="tree" name="tree" model='{getTreeModel()}'/>
+ <!--JTree id="tree" name="tree" model='{getTreeModel()}'/-->
+ <JTree id="navigation" rootVisible="true" selectionRow='0' model='{new DefaultTreeModel(null)}'/>
</JScrollPane>
</JPanel>
</JPanel>
- <JPanel id="inputPane" layout='{new CardLayout()}'>
- <JLabel horizontalAlignment="0" text="isisfish.input.selectNodeTree" constraints='"none"'/>
+ <JPanel id="inputPane" layout='{cardlayout}'>
+ <!--JLabel id='none' horizontalAlignment="0" text="isisfish.input.selectNodeTree" constraints='"none"'/>
<CellUI id='cellUI' constraints='"Cell"' constructorParams='getContextValue(InputAction.class)'/>
<ZoneUI id='zoneUI' constraints='"Zone"' constructorParams='getContextValue(InputAction.class)'/>
<PortUI id='portUI' constraints='"Port"' constructorParams='getContextValue(InputAction.class)'/>
@@ -344,7 +388,7 @@
<TripTypeUI id='tripTypeUI' constraints='"TripType"' constructorParams='getContextValue(InputAction.class)'/>
<VesselTypeUI id='vesselTypeUI' constraints='"VesselType"' constructorParams='getContextValue(InputAction.class)'/>
<SetOfVesselsUI id='setOfVesselsUI' constraints='"SetOfVessels"' constructorParams='getContextValue(InputAction.class)'/>
- <StrategyUI id='strategyUI' constraints='"Strategy"' constructorParams='getContextValue(InputAction.class)'/>
+ <StrategyUI id='strategyUI' constraints='"Strategy"' constructorParams='getContextValue(InputAction.class)'/-->
</JPanel>
</JSplitPane>
</JPanel>
\ No newline at end of file
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -51,27 +51,30 @@
boolean changed = false;
public MetierSeasonInfoSpeciesUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
- if (fieldMetierSeasonInfo.getSelectedIndex() <= 0){
- setSeasonModel();
- }
- else {
- setTableTargetSpeciesModel();
- }
- if (fieldTargetSpecies.getSelectedIndex() <= 0){
- setTargetSpeciesModel();
- }
- if (fieldTargetFactorEquation.getSelectedIndex() <= 0){
- setTargetFactorEquationModel();
- }
- try {
- fieldTargetFactorScript.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
- } catch (IOException ex) {
- Logger.getLogger(SelectivityUI.class.getName()).log(Level.SEVERE, null, ex);
- }
+ if (getContextValue(InputAction.class).getMetier() != null){
+ if (fieldMetierSeasonInfo.getSelectedIndex() <= 0){
+ setSeasonModel();
+ }
+ else {
+ setTableTargetSpeciesModel();
+ }
+ if (fieldTargetSpecies.getSelectedIndex() <= 0){
+ setTargetSpeciesModel();
+ }
+ if (fieldTargetFactorEquation.getSelectedIndex() <= 0){
+ setTargetFactorEquationModel();
+ }
+ try {
+ fieldTargetFactorScript.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
+ } catch (IOException ex) {
+ Logger.getLogger(SelectivityUI.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ }
}
protected void setSeasonModel(){
Metier metier = getContextValue(InputAction.class).getMetier();
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -48,7 +48,7 @@
protected IntervalPanel ip = new IntervalPanel();
displayMetierSeason.add(ip, BorderLayout.CENTER);
public MetierSeasonInfoZoneUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh(boolean seasonInit) {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -45,7 +45,7 @@
protected boolean changed = false;
public MetierTabUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -38,7 +38,7 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.TripType;
public MetierUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -48,7 +48,7 @@
boolean changed = false;
protected Population pop = null;
public PopulationBasicsUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -43,7 +43,7 @@
protected Population pop = null;
protected boolean changed = false;
public PopulationCapturabilityUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -41,7 +41,7 @@
protected Population pop = null;
boolean changed = false;
public PopulationEquationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -46,7 +46,7 @@
protected Population pop = null;
protected PopulationGroup populationGroup = null;
public PopulationGroupUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -53,7 +53,7 @@
protected PopulationSeasonInfo popInfo = null;
public PopulationMigrationEmigrationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(PopulationSeasonInfo pi){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -39,7 +39,7 @@
protected Population pop = null;
public PopulationMigrationEquationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(PopulationSeasonInfo popInfo){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -49,7 +49,7 @@
protected PopulationSeasonInfo popInfo = null;
protected Population pop = null;
public PopulationMigrationImmigrationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(PopulationSeasonInfo pi){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -48,7 +48,7 @@
protected PopulationSeasonInfo popInfo = null;
protected Population pop = null;
public PopulationMigrationMigrationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(PopulationSeasonInfo pi){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -46,7 +46,7 @@
protected boolean changed;
// protected PopulationSeasonInfo populationSeasonInfoSelected = null;
public PopulationMigrationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationOneEquationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -46,7 +46,7 @@
protected Class clazz = null;
protected String nameEquation = null;
public PopulationOneEquationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(String lblText, Formule f, String name, Class c){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -45,7 +45,7 @@
protected Population pop = null;
protected boolean changed = false;
public PopulationRecruitmentUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -48,7 +48,7 @@
protected IntervalPanel ip = new IntervalPanel();
fieldPopulationSeasonInterval.add(ip, BorderLayout.CENTER);
public PopulationSeasonsUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -41,18 +41,20 @@
import fr.ifremer.isisfish.entities.Gear;
public PopulationUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
- populationBasicsUI.refresh();
- populationGroupUI.refresh();
- populationEquationUI.refresh();
- populationZoneUI.refresh();
- populationSeasonsUI.refresh();
- populationCapturabilityUI.refresh();
- populationRecruitementUI.refresh();
- populationMigrationUI.refresh();
+ if (getContextValue(InputAction.class).getPopulation() != null){
+ populationBasicsUI.refresh();
+ populationGroupUI.refresh();
+ populationEquationUI.refresh();
+ populationZoneUI.refresh();
+ populationSeasonsUI.refresh();
+ populationCapturabilityUI.refresh();
+ populationRecruitementUI.refresh();
+ populationMigrationUI.refresh();
+ }
}
protected void goToGear(){
getParentContainer(InputUI.class).setTreeSelection(null, Gear.class);
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -46,7 +46,7 @@
protected boolean changed = false;
protected Population pop = null;
public PopulationZonesUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -53,7 +53,7 @@
protected OMToolSet toolSet = new OMToolSet();
protected boolean changed = false;
public PortUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -50,15 +50,15 @@
boolean changed = false;
public SelectivityUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
- if (getContextValue(InputAction.class).getSelected() != null){
+ if (getContextValue(InputAction.class).getGear() != null){
fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
+ fieldSelectivityEquation.setModel(getSelectivityEquationModel());
+ setSelectivityTableModel();
}
- fieldSelectivityEquation.setModel(getSelectivityEquationModel());
- setSelectivityTableModel();
try {
fieldSelectivityScript.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
} catch (IOException ex) {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -47,7 +47,7 @@
protected boolean changed = false;
public SetOfVesselsTabsUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -39,7 +39,7 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Strategy;
public SetOfVesselsUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -45,7 +45,7 @@
protected boolean changed = false;
public SpeciesUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -40,7 +40,7 @@
protected boolean changed = false;
public StrategyMonthInfoUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void 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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -43,7 +43,7 @@
protected StrategyMonthInfo strategyMonthInfo = null;
protected boolean changed = false;
public StrategyOneMonthInfoUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh(Month m) {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -45,7 +45,7 @@
boolean changed = false;
public StrategyTabUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -37,7 +37,7 @@
<JTabbedPane id="StrategyTab" name="Strategy" >
<script><![CDATA[
public StrategyUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -43,7 +43,7 @@
boolean changed = false;
public TripTypeUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -42,7 +42,7 @@
boolean changed = false;
public VesselTypeUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void refresh() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -58,7 +58,7 @@
protected PopulationBasicsUI popBasic;
public WizardGroupCreationUI(InputAction action, PopulationBasicsUI p){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
popBasic = p;
}
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-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -54,7 +54,7 @@
protected OMToolSet toolSet = new OMToolSet();
protected boolean changed = false;
public ZoneUI (InputAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
this.addFocusListener(new FocusListener() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/DataResultUIJAXX.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -34,7 +34,7 @@
<script>
<![CDATA[
public DataResultUIJAXX (ResultAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
]]>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/GraphBeanUIJAXX.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -43,7 +43,7 @@
init();
public GraphBeanUIJAXX (ResultAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void init(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEditUIJAXX.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -34,7 +34,7 @@
<script>
<![CDATA[
public ResultEditUIJAXX (ResultAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected String getFrameName(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -35,7 +35,7 @@
<![CDATA[
import fr.ifremer.isisfish.ui.Common;
public ResultUI (ResultAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void open(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResumePanelUIJAXX.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -34,7 +34,7 @@
<script>
<![CDATA[
public ResumePanelUIJAXX (ResultAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
]]>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/SimpleResultatMapBeanUIJAXX.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -38,7 +38,7 @@
import com.bbn.openmap.gui.ToolPanel;
init();
public SimpleResultatMapBeanUIJAXX (ResultAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void init(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2008-12-02 16:58:11 UTC (rev 1641)
@@ -56,7 +56,7 @@
static private Log log = getLog(ScriptAction.class);
File fileOpen= null;
public ScriptAction(){
-
+
}
protected void showMsgBox(String txt){
if (txt != null){
@@ -486,30 +486,6 @@
log.debug("commitScript called");
// TODO a refaire
throw new UnsupportedOperationException("En reparation");
-// ScriptMapping mapping = guessMapping(tree);
-// if (mapping == null) return null;
-// try {
-// long oldTilestamp = script.getFile().lastModified();
-// // save script before commit
-// script.setContent(content);
-//
-// String diff;
-// VCSFileState state = VCSFileStateManager.getState(oldTilestamp,script.getFile());
-// boolean canDiff = state.getState().authorizeAction(VCSAction.DIFF);
-// if (canDiff) {
-// diff = script.diff();
-// } else {
-// diff = _("isisfish.message.no.diff" , script.getFile(),state.getState().libelle() );
-// }
-//
-// frame.setInfoText(_("isisfish.message.diff.finished" , state.getState().libelle() ));
-// uiContext.setData(ACTION_LOG, diff);
-// frame.refreshView("actionLogArea");
-//
-// } catch (Exception eee) {
-// return returnError(_("isisfish.error.script.diff",script==null?null:script.getFile(), eee.getMessage()),eee);
-// }
-// return null;
}
/** enum to encapsulate a script module */
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -36,24 +36,28 @@
import javax.swing.table.DefaultTableModel;
import java.util.Map.Entry;
- fieldSimulationStatistique.setSelected(getContextValue(SimulAction.class).getSimulationParameter().getUseStatistic());
- fieldSimulationCache.setSelected(getContextValue(SimulAction.class).getSimulationParameter().getUseOptimization());
- fieldSimulAdvParamsSimulLoggerError.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulErrorLevel());
- fieldSimulAdvParamsSimulLoggerWarn.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulWarnLevel());
- fieldSimulAdvParamsSimulLoggerInfo.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulInfoLevel());
- fieldSimulAdvParamsSimulLoggerDebug.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulDebugLevel());
- fieldSimulAdvParamsScriptLoggerError.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptErrorLevel());
- fieldSimulAdvParamsScriptLoggerWarn.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptWarnLevel());
- fieldSimulAdvParamsScriptLoggerInfo.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptInfoLevel());
- fieldSimulAdvParamsScriptLoggerDebug.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptDebugLevel());
- fieldSimulAdvParamsLibLoggerError.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibErrorLevel());
- fieldSimulAdvParamsLibLoggerWarn.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibWarnLevel());
- fieldSimulAdvParamsLibLoggerInfo.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibErrorLevel());
- fieldSimulAdvParamsLibLoggerDebug.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibDebugLevel());
- setTableTagValue();
+ refresh();
+ public void refresh(){
+ fieldSimulationStatistique.setSelected(getContextValue(SimulAction.class).getSimulationParameter().getUseStatistic());
+ fieldSimulationCache.setSelected(getContextValue(SimulAction.class).getSimulationParameter().getUseOptimization());
+ fieldSimulAdvParamsSimulLoggerError.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulErrorLevel());
+ fieldSimulAdvParamsSimulLoggerWarn.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulWarnLevel());
+ fieldSimulAdvParamsSimulLoggerInfo.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulInfoLevel());
+ fieldSimulAdvParamsSimulLoggerDebug.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isSimulDebugLevel());
+ fieldSimulAdvParamsScriptLoggerError.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptErrorLevel());
+ fieldSimulAdvParamsScriptLoggerWarn.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptWarnLevel());
+ fieldSimulAdvParamsScriptLoggerInfo.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptInfoLevel());
+ fieldSimulAdvParamsScriptLoggerDebug.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isScriptDebugLevel());
+ fieldSimulAdvParamsLibLoggerError.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibErrorLevel());
+ fieldSimulAdvParamsLibLoggerWarn.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibWarnLevel());
+ fieldSimulAdvParamsLibLoggerInfo.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibErrorLevel());
+ fieldSimulAdvParamsLibLoggerDebug.setSelected(getContextValue(SimulAction.class).getSimulationParameter().isLibDebugLevel());
+ setTableTagValue();
+ }
+
public AdvancedParamsUI (SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void addTagValue(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ExportUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -33,12 +33,12 @@
<Table>
<script><![CDATA[
- update();
+ refresh();
public ExportUI (SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
- protected void update(){
+ public void refresh(){
if (listSimulExportChoose.getSelectedIndex() > -1){
Object[] values = listSimulExportChoose.getSelectedValues();
java.util.List<String> exportNames = new LinkedList<String>();
@@ -48,13 +48,17 @@
getContextValue(SimulAction.class).getSimulationParameter().setExportNames(exportNames);
}
fieldSimulExportFolder.setText(getContextValue(SimulAction.class).getSimulationParameter().getExportDirectory());
+ listSimulExportChoose.setModel(getListSimulExportChooseModel());
}
+ protected DefaultComboBoxModel getListSimulExportChooseModel(){
+ return new DefaultComboBoxModel(getContextValue(SimulAction.class).getExportNames().toArray());
+ }
]]>
</script>
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="1.0">
<JScrollPane>
- <JList id="listSimulExportChoose" selectionMode="2" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getExportNames().toArray())}' onValueChanged='update()'/>
+ <JList id="listSimulExportChoose" selectionMode="2" model='{getListSimulExportChooseModel()}' onValueChanged='refresh()'/>
</JScrollPane>
</cell>
</row>
@@ -63,7 +67,7 @@
<JLabel text="isisfish.export.directory"/>
</cell>
<cell fill="horizontal" weightx="1.0">
- <JTextField id="fieldSimulExportFolder" onFocusLost='update()'/>
+ <JTextField id="fieldSimulExportFolder" onFocusLost='refresh()'/>
</cell>
<cell>
<JButton text="isisfish.common.ellipsis" onActionPerformed='getContextValue(SimulAction.class).updateDirectory()'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -52,14 +52,17 @@
import javax.swing.table.TableColumn;
import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
import static javax.swing.JOptionPane.showMessageDialog;
+ import javax.swing.text.JTextComponent;
+ import org.dom4j.DocumentHelper;
+ import org.dom4j.Element;
setContextValue(new MatrixPanelEditor());
simulParamsNumbers.add(getContextValue(MatrixPanelEditor.class), BorderLayout.CENTER);
public ParamsUI(SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
- protected void refresh(){
+ public void refresh(){
if (getContextValue(SimulAction.class).getSimulationStorage() != null){
fieldSimulParamsName.setText(getContextValue(SimulAction.class).getSimulationStorage().getName());
}
@@ -77,6 +80,9 @@
simul.enableAnalysePlan();
}
}
+ public void setName(String name){
+ fieldSimulParamsName.setText(name);
+ }
protected void regionChange(){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(_("isisfish.message.loading.region"));
@@ -88,12 +94,14 @@
getContextValue(SimulAction.class).setSimulationParameter(simulAction.getSimulationParameter());
}
protected void loadOldSimulation(){
-
+
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(_("isisfish.message.loading.old.simulation"));
-
- showMsgBox(getContextValue(SimulAction.class).loadOldSimulation(fieldSimulParamsSelect.getSelectedItem().toString()));
- refresh();
+ String selected = fieldSimulParamsSelect.getSelectedItem().toString();
+ if (selected.equals(" ")){
+ showMsgBox(getContextValue(SimulAction.class).loadOldSimulation(selected));
+ refresh();
+ }
root.setInfoText(_("isisfish.message.old.simulation.loaded"));
}
protected void addRules(){
@@ -257,6 +265,54 @@
protected void resetFilter(){
getContextValue(SimulAction.class).resetOldSimulatorNames();
}
+ protected void saveName(){
+ getContextValue(SimulAction.class).setName(fieldSimulParamsName.getText());
+ }
+ public Element save(){
+ Element result = DocumentHelper.createElement("paramsUI");
+ for (String name : $objectMap.keySet()){
+ Object o = $objectMap.get(name);
+ if (!name.matches("^\\$.*")){
+ Element child = DocumentHelper.createElement(name);
+ if (JComboBox.class.isInstance(o)){
+ Object value = ((JComboBox)o).getSelectedItem();
+ child.addAttribute("value", value.toString());
+ }
+ if (JList.class.isInstance(o)){
+ Object[] values = ((JList)o).getSelectedValues();
+ for (Object value : values){
+ child.add(DocumentHelper.createElement("item").addAttribute("value", value.toString()));
+ }
+ }
+ else if (JTextComponent.class.isInstance(o)){
+ child.addText(((JTextComponent)o).getText());
+ }
+ else if (AbstractButton.class.isInstance(o)){
+ child.addAttribute("selected", ((AbstractButton)o).isSelected() + "");
+ }
+ else if (JTable.class.isInstance(o)){
+ JTable table = (JTable)o;
+ for (int i=0;i<table.getColumnCount();i++){
+ Element column = DocumentHelper.createElement("column");
+ for (int j=0;j<table.getRowCount();j++){
+ Element row = DocumentHelper.createElement("row");
+ Object value = table.getValueAt(j, i);
+ if (value != null){
+ row.add(DocumentHelper.createElement("cell").addAttribute("value", value.toString()));
+ }
+ else {
+ row.add(DocumentHelper.createElement("cell").addAttribute("value", null));
+ }
+ column.add(row);
+ }
+ child.add(column);
+ }
+ }
+ result.add(child);
+ }
+ }
+ return result;
+ }
]]>
</script>
<row>
@@ -292,7 +348,7 @@
<JLabel text="isisfish.params.simulationName" minimumSize='{new Dimension(140,25)}' preferredSize='{new Dimension(140,25)}'/>
</cell>
<cell fill="both" weightx="1.0">
- <JTextField id="fieldSimulParamsName"/>
+ <JTextField id="fieldSimulParamsName" onKeyPressed='saveName()'/>
</cell>
</row>
</Table>
@@ -439,8 +495,7 @@
<JPanel id="simulParamsNumbers" name="isisfish.params.populationNumbers" layout='{new BorderLayout()}'/>
</tab>
<tab title='{_("isisfish.params.ruleParameters")}'>
- <JTable id="simulParamsRules" name="isisfish.params.ruleParameters">
- </JTable>
+ <JTable id="simulParamsRules" name="isisfish.params.ruleParameters"/>
</tab>
</JTabbedPane>
</cell>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -33,9 +33,11 @@
<JPanel id="simulPreScripts" layout='{new BorderLayout()}'>
<script><![CDATA[
public PreScriptsUI (SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
+ public void refresh(){
+ }
protected void save(){
getContextValue(SimulAction.class).getSimulationParameter().setPreScript(fieldSimulPreScript.getText());
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -45,9 +45,9 @@
import org.jdesktop.beansbinding.Bindings;
import org.jdesktop.beansbinding.ELProperty;
- init();
+ refresh();
- protected void init(){
+ public void refresh(){
SimulationService ss = SimulationService.getService();
BindingGroup bindingGroup = new BindingGroup();
@@ -75,7 +75,7 @@
}
public QueueUI (SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public class JProgressBarTableCellRenderer implements TableCellRenderer {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ResultChoiceUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -33,9 +33,15 @@
<JPanel id="ResultChoice" name="isisfish.resultChoice.title" layout='{new BorderLayout()}'>
<script><![CDATA[
public ResultChoiceUI (SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
+ public void refresh(){
+ listResultNames.setModel(getListResultNameModel());
+ }
+ protected DefaultComboBoxModel getListResultNameModel(){
+ return new DefaultComboBoxModel(getContextValue(SimulAction.class).getResultNames().toArray());
+ }
protected void saveResultNames(){
if (listResultNames.getSelectedIndex() != -1){
getContextValue(SimulAction.class).saveResultNames(listResultNames.getSelectedValues());
@@ -45,8 +51,7 @@
</script>
<JLabel text="isisfish.resultChoice.save" horizontalAlignment="0" constraints='BorderLayout.NORTH'/>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JList id="listResultNames" selectionMode="2" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getResultNames().toArray())}'>
- </JList>
+ <JList id="listResultNames" selectionMode="2" model='{getListResultNameModel()}'/>
</JScrollPane>
<JButton constraints='BorderLayout.SOUTH' text="isisfish.common.saveNextSimulation" onActionPerformed='saveResultNames()'/>
</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -41,7 +41,7 @@
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
public SensUI (SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
public void refresh(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-02 16:58:11 UTC (rev 1641)
@@ -62,7 +62,12 @@
import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -71,6 +76,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.logging.Log;
@@ -90,7 +96,7 @@
protected Map<AnalysePlan, String> analysePlans = new HashMap<AnalysePlan, String>();
static private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm");
protected List<String> oldSimulNames = null;
-
+ protected String simulName = null;
/*
************
* Init
@@ -124,8 +130,52 @@
}
return null;
}
-
+ protected void setName(String name){
+ simulName = name;
+ }
+ protected String importSimulation(File f){
+ String result = null;
+ FileInputStream fos = null;
+ try {
+ fos = new FileInputStream(f);
+ BufferedReader br = new BufferedReader(new InputStreamReader(fos));
+ String line = br.readLine();
+ if (line.matches("^#.*")){
+ result = line.substring(1);
+ }
+ Properties proper = new Properties();
+ proper.load(fos);
+// TODO : réparer
+// param.fromProperties(proper);
+ simulName = result;
+ } catch (Exception ex) {
+ Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ try {
+ fos.close();
+ } catch (IOException ex) {
+ Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ return result;
+ }
+ protected void saveSimulation(File f){
+ FileOutputStream fos = null;
+ try {
+ fos = new FileOutputStream(f);
+ param.copy().toProperties().store(fos, simulName);
+ } catch (Exception ex) {
+ Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ try {
+ fos.close();
+ } catch (IOException ex) {
+ Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ }
+
/**
* Looking for ResultName.java script and read all fields and fill
* list of field value and doc
@@ -199,6 +249,7 @@
public String loadOldSimulation(String simulName) {
log.debug("call loadOldSimulation: " + simulName);
try {
+ this.simulName = simulName;
simulStorage = SimulationStorage.getSimulation(simulName);
param = simulStorage.getParameter().copy();
// all time reset number after load
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -32,8 +32,10 @@
-->
<JPanel size='{new Dimension(800,600)}' id="simul" layout='{new BorderLayout()}'>
<script><![CDATA[
+ import org.dom4j.DocumentHelper;
+ import org.dom4j.Element;
public SimulUI(SimulAction action){
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
setContextValue(action);
}
protected void enablePreSimul(){
@@ -47,15 +49,69 @@
protected void selTab(int i){
simulTabs.setSelectedIndex(i);
}
+ protected void refreshAll(){
+ paramsUI.refresh();
+ preSciptUI.refresh();
+ sensUI.refresh();
+ exportUI.refresh();
+ resultChoiceUI.refresh();
+ advencedParamsUI.refresh();
+ queueUI.refresh();
+ }
+ protected void importSimulation(){
+ JFileChooser fc = new JFileChooser();
+ int returnVal = fc.showOpenDialog(null);
+
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fc.getSelectedFile();
+ //This is where a real application would open the file.
+ String name = getContextValue(SimulAction.class).importSimulation(file);
+ refreshAll();
+ paramsUI.setName(name);
+ }
+ }
+ protected void saveSimulation(){
+ JFileChooser fc = new JFileChooser();
+ int returnVal = fc.showOpenDialog(null);
+
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fc.getSelectedFile();
+ //This is where a real application would open the file.
+// getContextValue(SimulAction.class).saveSimulation(file);
+ Element result = DocumentHelper.createElement("simul");
+ result.add(paramsUI.save());
+ System.out.println(result.asXML());
+ }
+ }
]]>
</script>
+ <JMenuBar id="simulMenuBar" constraints='BorderLayout.NORTH'>
+ <JMenu id="simulMenu" text="isisfish.simulation.menu.simulation">
+ <JMenuItem id="siSave" text="isisfish.simulation.menu.save" onActionPerformed="saveSimulation()"/>
+ <JMenuItem id="siImport" text="isisfish.simulation.menu.import" onActionPerformed="importSimulation()"/>
+ </JMenu>
+ </JMenuBar>
<JTabbedPane id="simulTabs" constraints='BorderLayout.CENTER'>
- <tab id="paramsUITab" title='isisfish.params.title'><ParamsUI id="paramUI" constructorParams='getContextValue(SimulAction.class)'/></tab>
- <tab id="preScriptUITab" title='isisfish.preScript.title' enabled='false'><PreScriptsUI id="preScipt" constructorParams='getContextValue(SimulAction.class)'/></tab>
- <tab id="sensUITab" title='isisfish.sens.title' enabled='false'><SensUI id="sensUI" constructorParams='getContextValue(SimulAction.class)'/></tab>
- <tab id="exportUITab" title='isisfish.export.title'><ExportUI id="exportUI" constructorParams='getContextValue(SimulAction.class)'/></tab>
- <tab id="resultChoiceUITab" title='isisfish.resultChoice.title'><ResultChoiceUI id="resultChoiceUI" constructorParams='getContextValue(SimulAction.class)'/></tab>
- <tab id="advancedParamsUITab" title='isisfish.advancedParameters.title'><AdvancedParamsUI id="advencedParamsUI" constructorParams='getContextValue(SimulAction.class)'/></tab>
- <tab id="queueUITab" title='isisfish.queue.title'><QueueUI id="queueUI" constructorParams='getContextValue(SimulAction.class)'/></tab>
+ <tab id="paramsUITab" title='isisfish.params.title'>
+ <ParamsUI id="paramsUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="preScriptUITab" title='isisfish.preScript.title' enabled='false'>
+ <PreScriptsUI id="preSciptUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="sensUITab" title='isisfish.sens.title' enabled='false'>
+ <SensUI id="sensUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="exportUITab" title='isisfish.export.title'>
+ <ExportUI id="exportUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="resultChoiceUITab" title='isisfish.resultChoice.title'>
+ <ResultChoiceUI id="resultChoiceUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="advancedParamsUITab" title='isisfish.advancedParameters.title'>
+ <AdvancedParamsUI id="advencedParamsUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="queueUITab" title='isisfish.queue.title'>
+ <QueueUI id="queueUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
</JTabbedPane>
</JPanel>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/CommitDialogUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/CommitDialogUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/CommitDialogUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -11,7 +11,7 @@
public CommitDialogUI(Dialog owner, boolean modal) {
super(owner, modal);
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
}
public boolean isEmpty() {
return items.getRowCount()==0;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSGenerateSshKeyUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSGenerateSshKeyUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSGenerateSshKeyUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -30,7 +30,7 @@
// block close operation
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
}
public void setData(String vcsLogin, File privateKeyFile) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSPassPhraseUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSPassPhraseUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/versionning/VCSPassPhraseUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -38,7 +38,7 @@
// block close operation
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
}
</script>
<Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/filter/FilterPanelUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/filter/FilterPanelUI.jaxx 2008-11-28 17:17:20 UTC (rev 1640)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/filter/FilterPanelUI.jaxx 2008-12-02 16:58:11 UTC (rev 1641)
@@ -10,7 +10,7 @@
protected FilterPanelUI(fr.ifremer.isisfish.ui.widget.filter.FilterDialogUI dialog) {
this.dialog = dialog;
- delegateContext = new jaxx.runtime.DefaultJAXXContext(this);
+
}
/**
1
0
r1640 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 28 Nov '08
by chatellier@users.labs.libre-entreprise.org 28 Nov '08
28 Nov '08
Author: chatellier
Date: 2008-11-28 17:17:20 +0000 (Fri, 28 Nov 2008)
New Revision: 1640
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncher.java
Log:
Throw an exception if simulation can't be launched
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncher.java 2008-11-28 17:10:20 UTC (rev 1639)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncher.java 2008-11-28 17:17:20 UTC (rev 1640)
@@ -229,6 +229,7 @@
if(log.isErrorEnabled()) {
log.error(_("isisfish.error.simulation.remote.global"));
}
+ throw new SimulationException("isisfish.error.simulation.remote.global", e);
}
1
0