Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
December 2008
- 3 participants
- 82 discussions
r1672 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: rule simulator ui/simulator
by chatellier@users.labs.libre-entreprise.org 15 Dec '08
by chatellier@users.labs.libre-entreprise.org 15 Dec '08
15 Dec '08
Author: chatellier
Date: 2008-12-15 11:41:36 +0000 (Mon, 15 Dec 2008)
New Revision: 1672
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
Log:
Javadoc modification
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -62,9 +62,11 @@
* Recupere dans prop les valeurs des champs specifique a la regle et met a
* jour les champs de la regle
*
+ * @param ruleIndex l'index de la regle
* @param rule la regle dont les parametres doivent etre lu depuis les
* proprietes
- * @param prop les proprietes contenant les parametre de la regle
+ * @param region ???
+ * @param props les proprietes contenant les parametre de la regle
*/
static public void populateRule(int ruleIndex, RegionStorage region, Rule rule, Properties props) {
ConvertUtilsBean beanUtils = ConverterUtil.getConverter(region.getStorage());
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -145,7 +145,7 @@
/**
* Remove simulation listener, if listener is {@link SimulationResultListener}, it's
- * automaticaly removed as listener on {@link ResultManager}
+ * Automatically removed as listener on {@link ResultManager}
* @param l
*/
public void removeSimulationListener(SimulationListener l) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -177,7 +177,6 @@
return result;
}
-
/**
* @return Returns the isisFishVersion.
*/
@@ -213,7 +212,7 @@
* Cela permet de le stocker facilement sur le disque.
*
* @return L'objet Properties representant les parametres
- * @see #fromProperties(Properties)
+ * @see #fromProperties(File,Properties)
*/
public Properties toProperties() {
Properties result = new Properties();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -244,7 +244,7 @@
/**
* Change region in simulation launcher
*
- * @param simulationName name of simulation to load
+ * @param simulName name of simulation to load
* @return <code>null</code> if ok, an OutputView otherwise with error
*/
public String loadOldSimulation(String simulName) {
1
0
Author: tchemit
Date: 2008-12-15 06:35:20 +0000 (Mon, 15 Dec 2008)
New Revision: 1671
Added:
isis-fish/trunk/README.txt
isis-fish/trunk/changelog.txt
Removed:
isis-fish/trunk/README
isis-fish/trunk/changelog
Modified:
isis-fish/trunk/pom.xml
Log:
passage en lutinproject 3.2
Deleted: isis-fish/trunk/README
===================================================================
--- isis-fish/trunk/README 2008-12-15 00:59:49 UTC (rev 1670)
+++ isis-fish/trunk/README 2008-12-15 06:35:20 UTC (rev 1671)
@@ -1,117 +0,0 @@
-maven target
-------------
-
-genapp
- pour generer le skelette du répertoire de projet
-
-jar
- pour compiler et générer un jar
-
-uberjar
- pour générer un jar qui contient toutes ses dépendances que l'on peut
- exécuter avec un java -jar ...
-
-site:deploy
- pour mettre à jour les pages web du site
-
-jar:deploy
- pour mettre à jour la version dans le repository
-
-jar:deploy-snapshot
- pour mettre en place une nouvelle version snapshot dans le repository
-
-dist:deploy
- pour generer des tar.gz de binaire et de sources et les mettre dans le
- repository
-
-Installation d'un plugin
-------------------------
-
-::
-
- maven -DartifactId=maven-lutinprocessor-plugin -DgroupId=lutinlib -Dversion=0.1 plugin:download
-
-Installation de maven
----------------------
-
-Récupérer la dernière version de maven sur http://maven.apache.org
-Installer le en le décompressant dans un répertoire, par exemple /opt
-
-Ajouter le répertoire de bin maven dans votre PATH (peut-etre dans le
-fichier /etc/profile ou ~/.bash_profile)::
-
- export PATH=$PATH:/opt/maven/bin
-
-modifier les droits du répertoire /opt/maven/plugin si vous souhaitez
-installer de nouveau plugin en tant qu'uilisateur normal et non pas
-seulement en root.
-
-Par exemple créez un group dev dans lequel vous mettrez tous les
-développeurs qui devront pouvoir ajouter des plugins à votre installation
-maven.
-
-ensuite::
-
- chown .dev /opt/maven/plugin
- chmod g+w /opt/maven/plugin
- chmod go+s /opt/maven/plugin
-
-Maven décompresse les plugins et download les librairies dans un répertoire.
-Normalement ce répertoire est dans le HOME de chaque utilisateur, mais il
-peut très bien être partagé, et cela permet de ne pas avoir un répertoire de
-plusieurs méga dans son HOME.
-
-Pour cela ajouté dans votre fichier ~/build.properties ceci::
-
- maven.home.local=/var/cache/maven
-
-Il faut ensuite créer ce répertoire et lui mettre les bons droits::
-
- mkdir -p /var/cache/maven
- chown .dev /var/cache/maven
- chmod g+w /var/cache/maven
- chmod go+s /var/cache/maven
-
-Exemple de fichier build.properties
------------------------------------
-
-::
-
- maven.repo.remote=http://www.ibiblio.org/maven/,http://lutinbuilder.labs.li…
-
- maven.checkstyle.format=sun
-
- # pour que le home ne soit pas submerger de .jar énorme
- maven.home.local=/var/cache/maven
-
- # pour la creation de nouveau projet
- maven.genapp.template=topia
- maven.genapp.default.id=lutinApp
- maven.genapp.default.name=Code Lutin Application
- maven.genapp.default.package=org.codelutin
-
- # login sur les sites de deployement
- maven.username=bpoussin
-
-Installation d'un template
---------------------------
-
-On voit dans l'exemple de fichier build.properties ci-dessus que le template
-utilisé est topia. Pour créer ou ajouter un template il faut le faire dans
-le répertoire ~/.maven/template/nom_du_template
-
-par exemple vous pouvez récuperer le template topia et l'installer
-(http://lutinbuilder.labs.libre-entreprise.org/maven/template/topia-0.1.tar.gz)
-
-TODO
-----
-
-labs:register
- pour enregistrer le projet sur labs (declaration des mailings lists,
- fermeture des forums, ...)
-
-labs:release
- pour publier une nouvelle version sur labs (mise à jour du site web,
- enregistrement des fichiers dowloads, ajout du jar dans le repository
- maven, update du XXX-last.jar pointant vers cette derniere version.
-
Copied: isis-fish/trunk/README.txt (from rev 1665, isis-fish/trunk/README)
===================================================================
--- isis-fish/trunk/README.txt (rev 0)
+++ isis-fish/trunk/README.txt 2008-12-15 06:35:20 UTC (rev 1671)
@@ -0,0 +1,117 @@
+maven target
+------------
+
+genapp
+ pour generer le skelette du répertoire de projet
+
+jar
+ pour compiler et générer un jar
+
+uberjar
+ pour générer un jar qui contient toutes ses dépendances que l'on peut
+ exécuter avec un java -jar ...
+
+site:deploy
+ pour mettre à jour les pages web du site
+
+jar:deploy
+ pour mettre à jour la version dans le repository
+
+jar:deploy-snapshot
+ pour mettre en place une nouvelle version snapshot dans le repository
+
+dist:deploy
+ pour generer des tar.gz de binaire et de sources et les mettre dans le
+ repository
+
+Installation d'un plugin
+------------------------
+
+::
+
+ maven -DartifactId=maven-lutinprocessor-plugin -DgroupId=lutinlib -Dversion=0.1 plugin:download
+
+Installation de maven
+---------------------
+
+Récupérer la dernière version de maven sur http://maven.apache.org
+Installer le en le décompressant dans un répertoire, par exemple /opt
+
+Ajouter le répertoire de bin maven dans votre PATH (peut-etre dans le
+fichier /etc/profile ou ~/.bash_profile)::
+
+ export PATH=$PATH:/opt/maven/bin
+
+modifier les droits du répertoire /opt/maven/plugin si vous souhaitez
+installer de nouveau plugin en tant qu'uilisateur normal et non pas
+seulement en root.
+
+Par exemple créez un group dev dans lequel vous mettrez tous les
+développeurs qui devront pouvoir ajouter des plugins à votre installation
+maven.
+
+ensuite::
+
+ chown .dev /opt/maven/plugin
+ chmod g+w /opt/maven/plugin
+ chmod go+s /opt/maven/plugin
+
+Maven décompresse les plugins et download les librairies dans un répertoire.
+Normalement ce répertoire est dans le HOME de chaque utilisateur, mais il
+peut très bien être partagé, et cela permet de ne pas avoir un répertoire de
+plusieurs méga dans son HOME.
+
+Pour cela ajouté dans votre fichier ~/build.properties ceci::
+
+ maven.home.local=/var/cache/maven
+
+Il faut ensuite créer ce répertoire et lui mettre les bons droits::
+
+ mkdir -p /var/cache/maven
+ chown .dev /var/cache/maven
+ chmod g+w /var/cache/maven
+ chmod go+s /var/cache/maven
+
+Exemple de fichier build.properties
+-----------------------------------
+
+::
+
+ maven.repo.remote=http://www.ibiblio.org/maven/,http://lutinbuilder.labs.li…
+
+ maven.checkstyle.format=sun
+
+ # pour que le home ne soit pas submerger de .jar énorme
+ maven.home.local=/var/cache/maven
+
+ # pour la creation de nouveau projet
+ maven.genapp.template=topia
+ maven.genapp.default.id=lutinApp
+ maven.genapp.default.name=Code Lutin Application
+ maven.genapp.default.package=org.codelutin
+
+ # login sur les sites de deployement
+ maven.username=bpoussin
+
+Installation d'un template
+--------------------------
+
+On voit dans l'exemple de fichier build.properties ci-dessus que le template
+utilisé est topia. Pour créer ou ajouter un template il faut le faire dans
+le répertoire ~/.maven/template/nom_du_template
+
+par exemple vous pouvez récuperer le template topia et l'installer
+(http://lutinbuilder.labs.libre-entreprise.org/maven/template/topia-0.1.tar.gz)
+
+TODO
+----
+
+labs:register
+ pour enregistrer le projet sur labs (declaration des mailings lists,
+ fermeture des forums, ...)
+
+labs:release
+ pour publier une nouvelle version sur labs (mise à jour du site web,
+ enregistrement des fichiers dowloads, ajout du jar dans le repository
+ maven, update du XXX-last.jar pointant vers cette derniere version.
+
Property changes on: isis-fish/trunk/README.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: isis-fish/trunk/changelog
===================================================================
--- isis-fish/trunk/changelog 2008-12-15 00:59:49 UTC (rev 1670)
+++ isis-fish/trunk/changelog 2008-12-15 06:35:20 UTC (rev 1671)
@@ -1,283 +0,0 @@
-isis-fish (3.2.0.x) xxx
-
- * switch to topia-service 1.0.0
- * switch to topia-persistence 2.1.0
- * remove tools.jar (now isis need JDK !!!)
-
-isis-fish (3.2.0.2) chatellier
-
- * fix missing lutinxml dependencies
-
-isis-fish (3.2.0.1) chemit
-
- * all ui are now in src/main/java
- * use maven 2 directory layout
- * use org.codelutin:lutinproject 3.0
- * passageto UTF-8
-
-isis-fish (3.2.0.0) poussin
-
- * complete refactoring option, vcs
- * complete refactoring simulation engin
- * new launcher type (subprocess, caparmor ...) in progress
- * modify script to use cell and not zone in some computation
- * add TechnicalEfficiency equation
- * add Inactivity equation support
-
-isis-fish (3.1.3) stable; urgency=high
-
- * bug correction when migration failed, still launch application on a new database
- * bug correction changing local database in configuration ui has no effect on next launch
- * bug correction if no svn connexion, application could not start
- * use commandline 0.4 (improve init and user options)
- * improve i18n loading (lutinutil)
- * refactor init and vcs init
-
- -- Tony Chemit <chemit at codelutin.com> Fri, 19 Mar 2008 02:02:02 +0200
-
-
- * bug correction #1605 add annotation on scripts for contextual help
- * bug correction #1617 Non prise en compte du changement de base locale
- * add new ui for configuration
-
- -- Tony Chemit <chemit at codelutin.com> Fri, 26 Feb 2008 23:34:02 +0200
-
- * bug correction #1601 Exception et erreur apres une simulation
- * bug correction #1602 Gros probleme de mise a jour de database entre v3.0 vers 3.1 perte des pecheries
- * bug i18n (loose some translate while using Isis-Fish from a jar)
-
- -- Tony Chemit <chemit at codelutin.com> Fri, 21 Dec 2007 11:34:02 +0200
-
-
-isis-fish (3.0.22) stable; urgency=high
-
- * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
- now we don't use cglib but javassist
-
- -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
-
-isis-fish (3.0.21) stable; urgency=high
-
- * bug correction in ResultDatastore, bad database used to get result during simulation
- * add call to close method on SimulationStorage for in memory database
- * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
-
- -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
-
-isis-fish (3.0.20) stable; urgency=high
-
- * add clean temp directory simulation preparation
- * add IsisFish version number in parameter
- * add getPopulations method in PopulationMonitor
- * bug correction #1592 in totalFishingMortality during reduction of matrix
- * bug correction #1583 about too many file open
- * bug in export script template
- * bug correction in rule Cantonnement
- * modify database simulation usage, now we use in memory database for
- data, and file storage for result, to separate result and data. This
- improve performance (70%).
- * bug switch to h2 database version 1.0.60, this prevent rollback exception
- during simulation
-
- -- Benjamin Poussin <poussin at codelutin.com> Mon, 15 Oct 2007 11:34:02 +0200
-
-isis-fish (3.0.19) stable; urgency=low
-
- * bug in cache for String and number in parameter
- * bug RuleMonitor add Rule as parameter
- * add extraRules field in SimulationParameter to permit Analyse Plan to
- add rules in parameter
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Jun 2007 15:39:17 +0200
-
-isis-fish (3.0.18) stable; urgency=low
-
- * bug go.bat have correct DOS end of line
- * improve build-release.sh to send email to user and devel list after deploy
- * bug correction in delete simulation, remove close context at begin of
- clear method
- * bug permit simulation without SimulationControl
- * bug in queue model test if no more simulation to prevent Index Out of
- bound Exception
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:39:17 +0200
-
-isis-fish (3.0.17) stable; urgency=low
-
- * add support for filename and extension in export script
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:38:17 +0200
-
-isis-fish (3.0.16) stable; urgency=low
-
- * add ssj jar to have random library
- * add support to auto upgrade database (topia migration service)
- * bug force reload parameter in thread simulation to prevent class cast
- exception because same class is loaded in two different classloader
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 21 May 2007 15:38:17 +0200
-
-isis-fish (3.0.15) stable; urgency=low
-
- * change database lock_mode to permit read with out lock
- * change database version to 1.0.20070304
- * bug end line in equation editor
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Apr 2007 15:38:17 +0200
-
-isis-fish (3.0.14) stable; urgency=low
-
- * add beforeOrEquals and afterOrEquals methods to Date and Month
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 02 Apr 2007 15:38:17 +0200
-
-isis-fish (3.0.13) stable; urgency=low
-
- * add simulation information support
- * change aspect deployment classloader (not used Agent)
- * bug in cache aspect when used without trace aspect
- * add checkout maven file option
- * change MatrixPanel context menu
- * bug in datastore closeContext (nullify storage)
- * bug in datastore getStorage (if closed create new)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 30 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.12) stable; urgency=low
-
- * bug in cache, help garbage with clear on collection
- * add on matrix sumOverDim(dim, start, nb)
- * change statistic is not used by default
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.11) stable; urgency=low
-
- * add result support in analyse plan
- * bug in AnalysePlanContext values access
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 09 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.10) stable; urgency=low
-
- * Analyse Plan implementation
- * feature #1531 date automaticaly added to simulation id
- * bug in Range value inversion of integer and real
- * bug #1492 matrix index error for result matrix
- * bug #1493 simulation, region deletion
- * bug #1495 view population number with one population
- * bug #1496 simulation, region order
- * bug #1528 in min size in wizard class creation
- * bug #1535 save/cancel button activation/desactivation
- * bug #1536 simulation queue
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.9) stable; urgency=low
-
- * add equation editor with syntaxe checking on all equation
- * implement Region checking mecanisme
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 08 Feb 2007 15:38:17 +0200
-
-isis-fish (3.0.8) stable; urgency=low
-
- * force checkout of directory not checkouted at startup
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Feb 2007 15:38:17 +0200
-
-isis-fish (3.0.7) stable; urgency=low
-
- * add import region and rename menu
- * bug in update script
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
-
-isis-fish (3.0.6) stable; urgency=low
-
- * add support for user prompt update file at startup
- * bug saisons (bad converter init)
- * simulation thread completely rewriten
- * first version of systray
- * region copy
- * bug tree refresh after delete region
- * cvs synchronisation menu
- * test de non regression
- * bug in exports
- * bug in rules
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
-
-isis-fish (3.0.5) stable; urgency=low
-
- * add support for delete prompt message and delete cascade prompt message
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.4) stable; urgency=low
-
- * improve cache key computation (use string), (gain 80%)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 17 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.3) stable; urgency=low
-
- * bug in getMonth if date is negative
- * bug in message error during equation compilation, now we show the
- equation type
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 16 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.2) stable; urgency=low
-
- * add import from isis-fish v2
- * change rules from region to root
- * improve equation frame editor (equation documentation)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 13 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.1) stable; urgency=low
-
- * bug selection cell (selected in list -> note selected in map)
- * add extension to file for model equation
- * improve refresh in input
- * add argument force to ResultStorage.addResult method
- * bug put new Population in right Species when more than one Species (tree problem)
- * bug put new Rule script in right region (tree problem)
- * add firstNull='true' for gear values types
- * bug when load gear with no values (null)
- * change method call: Input.CommitRegionInCVS -> Input.commitRegionInCVS
- * add Equation model editor
- * bug in script editor, don't used translated String for script type
- * bug in script editor, menu save/delete/deleteCVS work now
- * change use for(int i...) in GravityModel and SiMatrix for matrix access
- (gain factor 4 on matrix access and 65% on simulation)
- * change use Soft cache in ResultStorage (gain 10%)
- * improve ResultStorage keep in memory all result available to prevent unecessary
- query on database. Useful with Soft cache.
- * change use commons-collection in Cache aspect (prevent garbage bug in HashMapMultiKey)
- * bug in tools.jar search pattern for Windows
- * bug when create SetOfVessels in Effort description Add button
- was always grey
- * add getNecessaryResult in Rule to know result necessary for this rule
- and activate it automaticaly
- * improve all results are now optionnal
- * add compute and add as result discard weight if necessary
- * add TACweight in DemoRegion
- * add result MATRIX_NO_ACTIVITY
- * bug can set rule parameter
- * bug rule parameter can be saved and restored
- * improve when TopiaContext is used to read, error if another try to write
- (lock table timeout).
- * bug many correction in persistence (lock problem, load cycle problem)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 26 Sep 2006 15:38:17 +0200
-
-isis-fish (3.0.0) stable; urgency=low
-
- * Utililsation de DoubleBigVector par defaut pour les Matrix
- (gain facteur entre 2 et 8 suivant parcours (Iterator, Semantic, Index)
- * Suppression de tous les scripts utilisation de Java et compilation
- (gain facteur 1000 pour l'eval des equations donc 91% sur la simulation)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 07 Sep 2006 15:38:17 +0200
Copied: isis-fish/trunk/changelog.txt (from rev 1665, isis-fish/trunk/changelog)
===================================================================
--- isis-fish/trunk/changelog.txt (rev 0)
+++ isis-fish/trunk/changelog.txt 2008-12-15 06:35:20 UTC (rev 1671)
@@ -0,0 +1,284 @@
+isis-fish (3.2.0.x) xxx
+
+ * switch to lutinproject 3.2
+ * switch to topia-service 1.0.1
+ * switch to topia-persistence 2.1.1
+ * remove tools.jar (now isis need JDK !!!)
+
+isis-fish (3.2.0.2) chatellier
+
+ * fix missing lutinxml dependencies
+
+isis-fish (3.2.0.1) chemit
+
+ * all ui are now in src/main/java
+ * use maven 2 directory layout
+ * use org.codelutin:lutinproject 3.0
+ * passageto UTF-8
+
+isis-fish (3.2.0.0) poussin
+
+ * complete refactoring option, vcs
+ * complete refactoring simulation engin
+ * new launcher type (subprocess, caparmor ...) in progress
+ * modify script to use cell and not zone in some computation
+ * add TechnicalEfficiency equation
+ * add Inactivity equation support
+
+isis-fish (3.1.3) stable; urgency=high
+
+ * bug correction when migration failed, still launch application on a new database
+ * bug correction changing local database in configuration ui has no effect on next launch
+ * bug correction if no svn connexion, application could not start
+ * use commandline 0.4 (improve init and user options)
+ * improve i18n loading (lutinutil)
+ * refactor init and vcs init
+
+ -- Tony Chemit <chemit at codelutin.com> Fri, 19 Mar 2008 02:02:02 +0200
+
+
+ * bug correction #1605 add annotation on scripts for contextual help
+ * bug correction #1617 Non prise en compte du changement de base locale
+ * add new ui for configuration
+
+ -- Tony Chemit <chemit at codelutin.com> Fri, 26 Feb 2008 23:34:02 +0200
+
+ * bug correction #1601 Exception et erreur apres une simulation
+ * bug correction #1602 Gros probleme de mise a jour de database entre v3.0 vers 3.1 perte des pecheries
+ * bug i18n (loose some translate while using Isis-Fish from a jar)
+
+ -- Tony Chemit <chemit at codelutin.com> Fri, 21 Dec 2007 11:34:02 +0200
+
+
+isis-fish (3.0.22) stable; urgency=high
+
+ * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
+ now we don't use cglib but javassist
+
+ -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
+
+isis-fish (3.0.21) stable; urgency=high
+
+ * bug correction in ResultDatastore, bad database used to get result during simulation
+ * add call to close method on SimulationStorage for in memory database
+ * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
+
+ -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
+
+isis-fish (3.0.20) stable; urgency=high
+
+ * add clean temp directory simulation preparation
+ * add IsisFish version number in parameter
+ * add getPopulations method in PopulationMonitor
+ * bug correction #1592 in totalFishingMortality during reduction of matrix
+ * bug correction #1583 about too many file open
+ * bug in export script template
+ * bug correction in rule Cantonnement
+ * modify database simulation usage, now we use in memory database for
+ data, and file storage for result, to separate result and data. This
+ improve performance (70%).
+ * bug switch to h2 database version 1.0.60, this prevent rollback exception
+ during simulation
+
+ -- Benjamin Poussin <poussin at codelutin.com> Mon, 15 Oct 2007 11:34:02 +0200
+
+isis-fish (3.0.19) stable; urgency=low
+
+ * bug in cache for String and number in parameter
+ * bug RuleMonitor add Rule as parameter
+ * add extraRules field in SimulationParameter to permit Analyse Plan to
+ add rules in parameter
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Jun 2007 15:39:17 +0200
+
+isis-fish (3.0.18) stable; urgency=low
+
+ * bug go.bat have correct DOS end of line
+ * improve build-release.sh to send email to user and devel list after deploy
+ * bug correction in delete simulation, remove close context at begin of
+ clear method
+ * bug permit simulation without SimulationControl
+ * bug in queue model test if no more simulation to prevent Index Out of
+ bound Exception
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:39:17 +0200
+
+isis-fish (3.0.17) stable; urgency=low
+
+ * add support for filename and extension in export script
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:38:17 +0200
+
+isis-fish (3.0.16) stable; urgency=low
+
+ * add ssj jar to have random library
+ * add support to auto upgrade database (topia migration service)
+ * bug force reload parameter in thread simulation to prevent class cast
+ exception because same class is loaded in two different classloader
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 21 May 2007 15:38:17 +0200
+
+isis-fish (3.0.15) stable; urgency=low
+
+ * change database lock_mode to permit read with out lock
+ * change database version to 1.0.20070304
+ * bug end line in equation editor
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Apr 2007 15:38:17 +0200
+
+isis-fish (3.0.14) stable; urgency=low
+
+ * add beforeOrEquals and afterOrEquals methods to Date and Month
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 02 Apr 2007 15:38:17 +0200
+
+isis-fish (3.0.13) stable; urgency=low
+
+ * add simulation information support
+ * change aspect deployment classloader (not used Agent)
+ * bug in cache aspect when used without trace aspect
+ * add checkout maven file option
+ * change MatrixPanel context menu
+ * bug in datastore closeContext (nullify storage)
+ * bug in datastore getStorage (if closed create new)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 30 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.12) stable; urgency=low
+
+ * bug in cache, help garbage with clear on collection
+ * add on matrix sumOverDim(dim, start, nb)
+ * change statistic is not used by default
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.11) stable; urgency=low
+
+ * add result support in analyse plan
+ * bug in AnalysePlanContext values access
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 09 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.10) stable; urgency=low
+
+ * Analyse Plan implementation
+ * feature #1531 date automaticaly added to simulation id
+ * bug in Range value inversion of integer and real
+ * bug #1492 matrix index error for result matrix
+ * bug #1493 simulation, region deletion
+ * bug #1495 view population number with one population
+ * bug #1496 simulation, region order
+ * bug #1528 in min size in wizard class creation
+ * bug #1535 save/cancel button activation/desactivation
+ * bug #1536 simulation queue
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.9) stable; urgency=low
+
+ * add equation editor with syntaxe checking on all equation
+ * implement Region checking mecanisme
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 08 Feb 2007 15:38:17 +0200
+
+isis-fish (3.0.8) stable; urgency=low
+
+ * force checkout of directory not checkouted at startup
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Feb 2007 15:38:17 +0200
+
+isis-fish (3.0.7) stable; urgency=low
+
+ * add import region and rename menu
+ * bug in update script
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
+
+isis-fish (3.0.6) stable; urgency=low
+
+ * add support for user prompt update file at startup
+ * bug saisons (bad converter init)
+ * simulation thread completely rewriten
+ * first version of systray
+ * region copy
+ * bug tree refresh after delete region
+ * cvs synchronisation menu
+ * test de non regression
+ * bug in exports
+ * bug in rules
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
+
+isis-fish (3.0.5) stable; urgency=low
+
+ * add support for delete prompt message and delete cascade prompt message
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.4) stable; urgency=low
+
+ * improve cache key computation (use string), (gain 80%)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 17 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.3) stable; urgency=low
+
+ * bug in getMonth if date is negative
+ * bug in message error during equation compilation, now we show the
+ equation type
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 16 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.2) stable; urgency=low
+
+ * add import from isis-fish v2
+ * change rules from region to root
+ * improve equation frame editor (equation documentation)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 13 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.1) stable; urgency=low
+
+ * bug selection cell (selected in list -> note selected in map)
+ * add extension to file for model equation
+ * improve refresh in input
+ * add argument force to ResultStorage.addResult method
+ * bug put new Population in right Species when more than one Species (tree problem)
+ * bug put new Rule script in right region (tree problem)
+ * add firstNull='true' for gear values types
+ * bug when load gear with no values (null)
+ * change method call: Input.CommitRegionInCVS -> Input.commitRegionInCVS
+ * add Equation model editor
+ * bug in script editor, don't used translated String for script type
+ * bug in script editor, menu save/delete/deleteCVS work now
+ * change use for(int i...) in GravityModel and SiMatrix for matrix access
+ (gain factor 4 on matrix access and 65% on simulation)
+ * change use Soft cache in ResultStorage (gain 10%)
+ * improve ResultStorage keep in memory all result available to prevent unecessary
+ query on database. Useful with Soft cache.
+ * change use commons-collection in Cache aspect (prevent garbage bug in HashMapMultiKey)
+ * bug in tools.jar search pattern for Windows
+ * bug when create SetOfVessels in Effort description Add button
+ was always grey
+ * add getNecessaryResult in Rule to know result necessary for this rule
+ and activate it automaticaly
+ * improve all results are now optionnal
+ * add compute and add as result discard weight if necessary
+ * add TACweight in DemoRegion
+ * add result MATRIX_NO_ACTIVITY
+ * bug can set rule parameter
+ * bug rule parameter can be saved and restored
+ * improve when TopiaContext is used to read, error if another try to write
+ (lock table timeout).
+ * bug many correction in persistence (lock problem, load cycle problem)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 26 Sep 2006 15:38:17 +0200
+
+isis-fish (3.0.0) stable; urgency=low
+
+ * Utililsation de DoubleBigVector par defaut pour les Matrix
+ (gain facteur entre 2 et 8 suivant parcours (Iterator, Semantic, Index)
+ * Suppression de tous les scripts utilisation de Java et compilation
+ (gain facteur 1000 pour l'eval des equations donc 91% sur la simulation)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 07 Sep 2006 15:38:17 +0200
Property changes on: isis-fish/trunk/changelog.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-15 00:59:49 UTC (rev 1670)
+++ isis-fish/trunk/pom.xml 2008-12-15 06:35:20 UTC (rev 1671)
@@ -11,7 +11,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
</parent>
<groupId>ifremer</groupId>
@@ -94,21 +94,21 @@
<version>3.2.1</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>org.jdesktop</groupId>
<artifactId>beansbinding</artifactId>
<version>1.2.1</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
@@ -138,7 +138,7 @@
<scope>compile</scope>
</dependency>
- <!-- encore utilise pour les pre-scripts -->
+ <!-- encore utilise pour les pre-scripts -->
<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
@@ -166,7 +166,7 @@
<version>0.2.2</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
@@ -174,14 +174,14 @@
<scope>compile</scope>
</dependency>
- <!-- Utilisé dans les scripts -->
+ <!-- Utilisé dans les scripts -->
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinj2r</artifactId>
<version>0.2</version>
<scope>runtime</scope>
</dependency>
-
+
<!-- Utilisé lors de l'import xml v2 (entre autre) -->
<dependency>
<groupId>jaxen</groupId>
@@ -227,38 +227,38 @@
</dependency>
<dependency>
- <groupId>ssj</groupId>
- <artifactId>Blas</artifactId>
- <version>20081007</version>
- <scope>runtime</scope>
+ <groupId>ssj</groupId>
+ <artifactId>Blas</artifactId>
+ <version>20081007</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>ssj</groupId>
- <artifactId>colt</artifactId>
- <version>20081007</version>
- <scope>runtime</scope>
+ <groupId>ssj</groupId>
+ <artifactId>colt</artifactId>
+ <version>20081007</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>ssj</groupId>
- <artifactId>interpreter</artifactId>
- <version>1.6.8</version>
- <scope>runtime</scope>
+ <groupId>ssj</groupId>
+ <artifactId>interpreter</artifactId>
+ <version>1.6.8</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>ssj</groupId>
- <artifactId>language</artifactId>
- <version>1.6.7</version>
- <scope>runtime</scope>
+ <groupId>ssj</groupId>
+ <artifactId>language</artifactId>
+ <version>1.6.7</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>ssj</groupId>
- <artifactId>logger</artifactId>
- <version>1.6.4</version>
- <scope>runtime</scope>
+ <groupId>ssj</groupId>
+ <artifactId>logger</artifactId>
+ <version>1.6.4</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
@@ -294,7 +294,7 @@
<distribution>repo</distribution>
</license>
</licenses>
-
+
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
@@ -303,16 +303,18 @@
<properties>
<!-- id du projet du labs -->
<labs.id>8</labs.id>
- <!--labs.project>isis-fish</labs.project-->
+ <!-- nom du projet du labs -->
+ <labs.project>isis-fish</labs.project>
+
<!-- jaxx version -->
<jaxx.version>0.8-SNAPSHOT</jaxx.version>
<!-- generator version -->
- <generator.version>0.63-SNAPSHOT</generator.version>
+ <generator.version>0.63</generator.version>
<!-- topia version -->
- <topia.version>2.1.1-SNAPSHOT</topia.version>
+ <topia.version>2.1.1</topia.version>
<!-- lutinwidget version -->
<lutinwidget.version>0.11</lutinwidget.version>
@@ -351,7 +353,8 @@
<templates>org.codelutin.topia.generator.TopiaMetaGenerator</templates>
<destDirGen>${maven.gen.dir}/java</destDirGen>
<defaultPackage>fr.ifremer.isisfish</defaultPackage>
- <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%</copyVersionDir>
+ <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%
+ </copyVersionDir>
<copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
<copyOverwrite>true</copyOverwrite>
</configuration>
@@ -372,13 +375,13 @@
</dependency>
</dependencies>
</plugin>
-
+
<plugin>
<groupId>org.codelutin</groupId>
<artifactId>maven-jaxx-plugin</artifactId>
<version>${jaxx.version}</version>
<executions>
- <execution>
+ <execution>
<goals>
<goal>generate</goal>
</goals>
@@ -392,7 +395,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinwidget</artifactId>
- <version>${lutinwidget.version}</version>
+ <version>${lutinwidget.version}</version>
</dependency>
<dependency>
<groupId>org.codelutin.topia</groupId>
@@ -428,7 +431,7 @@
</configuration>
<executions>
<execution>
- <phase>generate-resources</phase>
+ <phase>generate-resources</phase>
<goals>
<goal>parserJava</goal>
<goal>gen</goal>
@@ -438,7 +441,6 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
@@ -451,147 +453,161 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${maven.jar.main.class}</mainClass>
- <classpathPrefix>lib/</classpathPrefix>
- </manifest>
- </archive>
+ <classpathPrefix>./lib/</classpathPrefix>
+ </manifest>
+ </archive>
</configuration>
</plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
- <execution>
- <id>JnlpSun</id>
- <phase>package</phase>
- <configuration>
+ </plugins>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
+ <url>${maven.scm.url}</url>
+ </scm>
+
+ <profiles>
+ <profile>
+ <id>release-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <plugin>
+
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
+ <execution>
+ <id>JnlpSun</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
+ todir="${project.basedir}/target/resources/jnlp/">
+ <filterset>
+ <filter token="mail" value="mail-1.4.jar"/>
+ <filter token="activation" value="activation-1.1.jar"/>
+ </filterset>
+ </copy>
+ <copy file="${project.build.directory}/lib/mail-1.4.jar"
+ todir="${project.basedir}/target/resources/jnlp/"/>
+ <copy file="${project.build.directory}/lib/activation-1.1.jar"
+ todir="${project.basedir}/target/resources/jnlp/"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <!--execution>
+ <id>MakeManualScreenShots</id>
+ <phase>package</phase>
+ <configuration>
<tasks>
- <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
- todir="${project.basedir}/target/resources/jnlp/">
- <filterset>
- <filter token="mail" value="mail-1.4.jar"/>
- <filter token="activation" value="activation-1.1.jar"/>
- </filterset>
- </copy>
- <copy file="${project.build.directory}/lib/mail-1.4.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
- <copy file="${project.build.directory}/lib/activation-1.1.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
+ <exec executable="${project.basedir}/doc/manual/prepareManual.sh"
+ dir="${project.basedir}/doc/manual/"/>
</tasks>
- </configuration>
- <goals>
+ </configuration>
+ <goals>
<goal>run</goal>
- </goals>
- </execution>
- <!--execution>
- <id>MakeManualScreenShots</id>
- <phase>package</phase>
+ </goals>
+ </execution-->
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
<configuration>
- <tasks>
- <exec executable="${project.basedir}/doc/manual/prepareManual.sh"
- dir="${project.basedir}/doc/manual/"/>
- </tasks>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
</configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution-->
- </executions>
- </plugin>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <!-- Java Web Start -->
- <!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
- <plugin>
- <groupId>org.codehaus.mojo.webstart</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-2-cl_20081018</version>
- <executions>
- <execution>
- <phase>deploy</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <dependencies>
- <excludes>
- <exclude>javax.mail:mail</exclude>
- <exclude>javax.activation:activation</exclude>
- </excludes>
- </dependencies>
- <jnlp>
- <!--<resources>${project.basedir}/src/jnlp</resources>-->
- <outputFile>isis-fish-v3.jnlp</outputFile>
- <mainClass>${maven.jar.main.class}</mainClass>
- </jnlp>
+ <!-- Java Web Start -->
+ <!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
+ <plugin>
+ <groupId>org.codehaus.mojo.webstart</groupId>
+ <artifactId>webstart-maven-plugin</artifactId>
+ <version>1.0-alpha-2-cl_20081018</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>jnlp-inline</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <dependencies>
+ <excludes>
+ <exclude>javax.mail:mail</exclude>
+ <exclude>javax.activation:activation</exclude>
+ </excludes>
+ </dependencies>
+ <jnlp>
+ <!--<resources>${project.basedir}/src/jnlp</resources>-->
+ <outputFile>isis-fish-v3.jnlp</outputFile>
+ <mainClass>${maven.jar.main.class}</mainClass>
+ </jnlp>
- <sign>
- <keystore>${keystorepath}</keystore>
- <keypass/>
- <storepass>${keystorepass}</storepass>
- <storetype/>
- <alias>${keystorealias}</alias>
- <validity/>
+ <sign>
+ <keystore>${keystorepath}</keystore>
+ <keypass/>
+ <storepass>${keystorepass}</storepass>
+ <storetype/>
+ <alias>${keystorealias}</alias>
+ <validity/>
- <dnameCn/>
- <dnameOu/>
- <dnameO/>
- <dnameL/>
- <dnameSt/>
- <dnameC/>
+ <dnameCn/>
+ <dnameOu/>
+ <dnameO/>
+ <dnameL/>
+ <dnameSt/>
+ <dnameC/>
- <verify>true</verify>
- </sign>
+ <verify>true</verify>
+ </sign>
- <keystore>
- <delete>false</delete>
- <gen>false</gen>
- </keystore>
+ <keystore>
+ <delete>false</delete>
+ <gen>false</gen>
+ </keystore>
- <pack200>false</pack200>
- <gzip>true</gzip>
- <verbose>false</verbose>
- </configuration>
- </plugin>
+ <pack200>false</pack200>
+ <gzip>true</gzip>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- </descriptors>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection}</connection>
- <developerConnection>${maven.scm.developerConnection}</developerConnection>
- <url>${maven.scm.url}</url>
- </scm>
-
</project>
1
0
r1670 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input src/test/java/fr/ifremer/isisfish/ui
by tchemit@users.labs.libre-entreprise.org 15 Dec '08
by tchemit@users.labs.libre-entreprise.org 15 Dec '08
15 Dec '08
Author: tchemit
Date: 2008-12-15 00:59:49 +0000 (Mon, 15 Dec 2008)
New Revision: 1670
Added:
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.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
Log:
little help to sylvain :) show how binding works on CellUI, in general we should not deal direclty with widget values but prefer data binding...
reformat Inputaction
always refresh InputAction value
bump lutingenerator and topia versions
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/pom.xml 2008-12-15 00:59:49 UTC (rev 1670)
@@ -309,10 +309,10 @@
<jaxx.version>0.8-SNAPSHOT</jaxx.version>
<!-- generator version -->
- <generator.version>0.62</generator.version>
+ <generator.version>0.63-SNAPSHOT</generator.version>
<!-- topia version -->
- <topia.version>2.1.0</topia.version>
+ <topia.version>2.1.1-SNAPSHOT</topia.version>
<!-- lutinwidget version -->
<lutinwidget.version>0.11</lutinwidget.version>
@@ -384,6 +384,7 @@
</goals>
<configuration>
<src>${project.basedir}/src/main/java</src>
+ <addSourcesToClassPath>true</addSourcesToClassPath>
</configuration>
</execution>
</executions>
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-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-15 00:59:49 UTC (rev 1670)
@@ -36,119 +36,92 @@
+-->
<Table implements='InputContent'>
- <!-- ui state when the activite is active -->
+ <!-- edit property -->
<Boolean id='actif' javaBean='false'/>
+ <!-- change property -->
<Boolean id='changed' javaBean='false'/>
+ <!-- bean property -->
+ <fr.ifremer.isisfish.entities.CellImpl id='bean' javaBean='null'/>
+
<script><![CDATA[
- import fr.ifremer.isisfish.entities.Cell;
- import com.bbn.openmap.gui.OMToolSet;
- import fr.ifremer.isisfish.map.IsisMapBean;
- import fr.ifremer.isisfish.map.OpenMapToolPanel;
- import org.codelutin.topia.persistence.TopiaEntity;
- import fr.ifremer.isisfish.entities.Zone;
- import fr.ifremer.isisfish.ui.WelcomePanelUI;
+import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.CellImpl;
+import com.bbn.openmap.gui.OMToolSet;
+import fr.ifremer.isisfish.map.IsisMapBean;
+import fr.ifremer.isisfish.map.OpenMapToolPanel;
+import org.codelutin.topia.persistence.TopiaEntity;
+import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.ui.WelcomePanelUI;
- protected IsisMapBean cellMap = new IsisMapBean();
- protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
- protected OMToolSet toolSet = new OMToolSet();
-
- public CellUI (InputAction action){
-
- setContextValue(action);
- }
- public 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){
- fieldCellName.setText(cell.getName());
- fieldCellLatitude.setText(cell.getLatitude()+"");
- fieldCellLongitude.setText(cell.getLongitude()+"");
- fieldCellLand.setSelected(cell.getLand());
- fieldCellComment.setText(getContextValue(InputAction.class).getCell().getComment());
+protected IsisMapBean cellMap = new IsisMapBean();
+protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
+protected OMToolSet toolSet = new OMToolSet();
- cellMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- toolSet.setupListeners(cellMap);
- toolMap.add((Component)toolSet);
- cellMapPanel.add(toolMap, BorderLayout.NORTH);
- cellMapPanel.add(cellMap, BorderLayout.CENTER);
- cellMap.setSelectedCells(cell);
- valueChanged(false);
- }
- else {
-
+addPropertyChangeListener("bean", new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getOldValue() != null || evt.getNewValue() == null) {
+ // remove previous binding on getBean()
+ jaxx.runtime.Util.removeDataBinding($Table0, "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
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);
+ fieldCellLand.setSelected(false);
}
+ if (evt.getNewValue() != null) {
+ // add binding on getBean()
+ jaxx.runtime.Util.applyDataBinding($Table0, "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
+ }
}
- protected void save(){
- TopiaEntity topia = getContextValue(InputAction.class).save();
- valueChanged(false);
- getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
- setInfoText(_("isisfish.message.save.finished"));
- refresh();
+});
+
+public void refresh() {
+ InputAction action = getContextValue(InputAction.class);
+ setBean(null);
+ Cell cell = action.getCell();
+ setBean((CellImpl) cell);
+ jaxx.runtime.swing.Utils.fillComboBox(fieldCell,action.getFisheryRegion().getCell(), cell);
+
+ cellMap.setFisheryRegion(action.getFisheryRegion());
+ toolSet.setupListeners(cellMap);
+ toolMap.add((Component)toolSet);
+ cellMapPanel.add(toolMap, BorderLayout.NORTH);
+ cellMapPanel.add(cellMap, BorderLayout.CENTER);
+
+ if (cell != null){
+ cellMap.setSelectedCells(cell);
}
- protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel();
- valueChanged(false);
- refresh();
- setInfoText(_("isisfish.message.cancel.finished"));
+ setChanged(false);
+}
+
+protected void save() {
+ TopiaEntity topia = getContextValue(InputAction.class).save();
+ getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
+ refresh();
+ getParentContainer(WelcomePanelUI.class).setInfoText(_("isisfish.message.save.finished"));
+}
+
+protected void cancel() {
+ getContextValue(InputAction.class).cancel();
+ refresh();
+ getParentContainer(WelcomePanelUI.class).setInfoText(_("isisfish.message.cancel.finished"));
+}
+
+protected void fieldCellChanged() {
+ Cell c = (Cell)fieldCell.getSelectedItem();
+ if (c==null) {
+ return;
}
- protected void goToZone(){
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
+ Cell oldC = getBean();
+ if (oldC != null && c.getTopiaId().equals(oldC.getTopiaId())) {
+ // avoid reentrant code
+ return;
}
- protected void valueChanged(boolean b){
- //TODO remove method valueChanged
- // must use the setter to fire property changes, and make possible bindings
- setChanged(b);
- }
- protected void setInfoText(String txt){
- WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
- root.setInfoText(txt);
- }
- protected void fieldCellChanged(){
- Cell c = (Cell)fieldCell.getSelectedItem();
- getContextValue(InputAction.class).setValue(c);
- getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
- //fixme no :) as you select a new node, you should not do anything more on ui ?
- refresh();
- valueChanged(true);
- }
- protected void nameChanged(){
- getContextValue(InputAction.class).getCell().setName(fieldCellName.getText());
- //fixme no :) use a propertyChangeListener on the bean
- refresh();
- valueChanged(true);
- }
- protected void cellLandChanged(){
- getContextValue(InputAction.class).getCell().setLand(fieldCellLand.isSelected());
- //fixme no :) use a propertyChangeListener on the bean
- refresh();
- valueChanged(true);
- }
- protected void commentChanged(){
- getContextValue(InputAction.class).getCell().setComment(fieldCellComment.getText());
- //fixme no :) use a propertyChangeListener on the bean
- refresh();
- valueChanged(true);
- }
- ]]>
- </script>
+ getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
+}
+]]></script>
<row>
<cell fill='both' weighty='1.0' weightx='1.0'>
<JSplitPane id="CellTab" name="Cells"
@@ -156,7 +129,7 @@
<Table>
<row>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()' enabled='{isActif()}'/>
+ <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()' model='{new DefaultComboBoxModel()}'/>
</cell>
</row>
<row>
@@ -164,7 +137,7 @@
<JLabel text="isisfish.cell.name" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/>
+ <JTextField id="fieldCellName" text='{getBean().getName()}' onKeyTyped='setChanged(true)' onFocusLost='if (isChanged()) {getBean().setName(fieldCellName.getText());}' enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -172,7 +145,7 @@
<JLabel text="isisfish.cell.latitude" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellLatitude" editable="false" enabled='{isActif()}'/>
+ <JTextField id="fieldCellLatitude" text='{getBean().getLatitude()}' editable="false" enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -180,7 +153,7 @@
<JLabel text="isisfish.cell.longitude" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellLongitude" editable="false" enabled='{isActif()}'/>
+ <JTextField id="fieldCellLongitude" text='{getBean().getLongitude()}' editable="false" enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -188,7 +161,7 @@
<JLabel text="isisfish.cell.land" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JCheckBox id="fieldCellLand" onActionPerformed='cellLandChanged()' enabled='{isActif()}'/>
+ <JCheckBox id="fieldCellLand" onActionPerformed='setChanged(true); getBean().setLand(fieldCellLand.isSelected());' enabled='{isActif()}' selected='{getBean().getLand()}'/>
</cell>
</row>
<row>
@@ -199,7 +172,7 @@
<row>
<cell columns='2' fill='both' weighty='1.0' weightx='1.0'>
<JScrollPane>
- <JTextArea id="fieldCellComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/>
+ <JTextArea id="fieldCellComment" text='{jaxx.runtime.Util.getStringValue(getBean().getComment())}' onKeyTyped='setChanged(true)' onFocusLost='if (isChanged()) { getBean().setComment(fieldCellComment.getText()); }' enabled='{isActif()}'/>
</JScrollPane>
</cell>
</row>
@@ -218,7 +191,7 @@
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continueZones" onActionPerformed='goToZone()'/>
+ <JButton text="isisfish.input.continueZones" onActionPerformed='getParentContainer(InputUI.class).setTreeSelection("$root/$zones")'/>
</cell>
</row>
</Table>
\ No newline at end of file
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-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-15 00:59:49 UTC (rev 1670)
@@ -37,58 +37,23 @@
import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.IsisFishEntityEnum;
import fr.ifremer.isisfish.datastore.FormuleStorage;
-import java.util.List;
-
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
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;
-import fr.ifremer.isisfish.entities.FisheryRegion;
-import fr.ifremer.isisfish.entities.Formule;
-import fr.ifremer.isisfish.entities.Gear;
-import fr.ifremer.isisfish.entities.Metier;
-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;
-import fr.ifremer.isisfish.entities.Selectivity;
-import fr.ifremer.isisfish.entities.SelectivityDAO;
-import fr.ifremer.isisfish.entities.SetOfVessels;
-import fr.ifremer.isisfish.entities.Species;
-import fr.ifremer.isisfish.entities.Strategy;
-import fr.ifremer.isisfish.entities.TargetSpecies;
-import fr.ifremer.isisfish.entities.TargetSpeciesDAO;
-import fr.ifremer.isisfish.entities.TripType;
-import fr.ifremer.isisfish.entities.VesselType;
-import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.entities.*;
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 static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation;
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;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
import org.apache.commons.beanutils.MethodUtils;
import org.apache.commons.lang.ClassUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import static org.codelutin.i18n.I18n._;
import org.codelutin.math.matrix.MatrixFactory;
import org.codelutin.math.matrix.MatrixND;
import org.codelutin.topia.TopiaContext;
@@ -97,14 +62,21 @@
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.util.FileUtil;
import org.codelutin.widget.editor.Editor;
-import static org.codelutin.i18n.I18n._;
+
+import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.showInputDialog;
-import static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+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.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-/**
- *
- * @author letellier
- */
+/** @author letellier */
public class InputAction {
/** to use log facility, just put in your code: log.info(\"...\"); */
@@ -132,82 +104,90 @@
log.debug("new instance");
}
}
- protected void showMsgBox(Exception eee){
+
+ protected void showMsgBox(Exception eee) {
ErrorDialogUI.showError(eee);
}
+
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;
-// selected=null;
- if (!(value instanceof TopiaEntity)) {
- // this is not a TopiaEntity value, so quit
- isNull = true;
- return;
- }
- isNull = false;
- switch (IsisFishEntityEnum.valueOf(value.getClass())){
- case Zone:
- zone = (Zone) value;
+ if (value == null || !(value instanceof TopiaEntity)) {
+ // this is not a TopiaEntity value, or a null value : so quit
+ isNull = true;
+ cell = null;
+ zone = null;
+ port = null;
+ species = null;
+ population = null;
+ gear = null;
+ metier = null;
+ tripType = null;
+ vesselType = null;
+ setOfVessels = null;
+ strategy = null;
+ selected = null;
+ return;
+ }
+ isNull = false;
+ switch (IsisFishEntityEnum.valueOf(value.getClass())) {
+ case Zone:
+ zone = (Zone) value;
break;
- case Cell:
- cell = (Cell) value;
+ case Cell:
+ cell = (Cell) value;
break;
- case Port:
- port = (Port) value;
+ case Port:
+ port = (Port) value;
break;
- case Species:
- species = (Species) value;
+ case Species:
+ species = (Species) value;
break;
- case Population:
- population = (Population) value;
- species = population.getSpecies();
+ case Population:
+ population = (Population) value;
+ species = population.getSpecies();
break;
- case Metier:
- metier = (Metier) value;
+ case Metier:
+ metier = (Metier) value;
break;
- case TripType:
- tripType = (TripType) value;
+ case TripType:
+ tripType = (TripType) value;
break;
- case Gear:
- gear = (Gear) value;
+ case Gear:
+ gear = (Gear) value;
break;
- case VesselType:
- vesselType = (VesselType) value;
+ case VesselType:
+ vesselType = (VesselType) value;
break;
- case SetOfVessels:
- setOfVessels = (SetOfVessels) value;
+ case SetOfVessels:
+ setOfVessels = (SetOfVessels) value;
break;
- case Strategy:
- strategy = (Strategy) value;
+ case Strategy:
+ strategy = (Strategy) value;
break;
- }
- selected = (TopiaEntity) value;
+ }
+ selected = (TopiaEntity) value;
}
- public boolean isNull(){
+
+ public boolean isNull() {
return isNull;
}
- public void setPath(String path){
+
+ public void setPath(String path) {
this.path = path;
}
- public String getPath(){
+
+ public String getPath() {
return path;
}
- public TopiaContext getIsisContext(){
+
+ public TopiaContext getIsisContext() {
return isisContext;
}
- public RegionStorage getRegionStorage(){
+
+ public RegionStorage getRegionStorage() {
return regionStorage;
}
- public void setSpecies(String topiaId){
+
+ public void setSpecies(String topiaId) {
try {
species = IsisFishDAOHelper.getSpeciesDAO(isisContext).findByTopiaId(topiaId);
} catch (TopiaException ex) {
@@ -215,75 +195,75 @@
}
}
- /**
- * Exporter la region dans un zip
- *
- * @return
- */
- public File importRegion() {
+ /**
+ * Exporter la region dans un zip
+ *
+ * @return TODO
+ */
+ public File importRegion() {
File file = null;
- try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
- if (file != null) {
- RegionStorage.importZip(file);
- }
- } catch (Exception eee) {
- log.error("Can't import region", eee);
+ try {
+ file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ if (file != null) {
+ RegionStorage.importZip(file);
+ }
+ } catch (Exception eee) {
+ log.error("Can't import region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Exporter la region dans un zip
- *
- * @return
- */
- public File importRegionAndRename() {
+ /**
+ * Exporter la region dans un zip
+ *
+ * @return TODO
+ */
+ public File importRegionAndRename() {
File file = null;
- try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
- if (file != null) {
+ try {
+ file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ if (file != null) {
- String newName =
+ String newName =
showInputDialog(_("isisfish.message.name.imported.region"));
- RegionStorage.importAndRenameZip(file, newName);
- }
- } catch (Exception eee) {
- log.error("Can't import region", eee);
+ RegionStorage.importAndRenameZip(file, newName);
+ }
+ } catch (Exception eee) {
+ log.error("Can't import region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Importer la region depuis un fichier XML de la version 2
- *
- * @return
- */
- public File importV2Region() {
+ /**
+ * Importer la region depuis un fichier XML de la version 2
+ *
+ * @return TODO
+ */
+ public File importV2Region() {
File file = null;
- try {
- file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml"));
- if (file != null) {
+ try {
+ file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml"));
+ if (file != null) {
- new ImportFromV2(true).importXML(file);
+ new ImportFromV2(true).importXML(file);
- }
- } catch (Exception eee) {
- log.error("Can't import region", eee);
+ }
+ } catch (Exception eee) {
+ log.error("Can't import region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Extract from a simulation the region, and rename it with name given
+ /**
+ * Extract from a simulation the region, and rename it with name given
* by user.
- *
- * return msg
- */
+ *
+ * @return msg
+ */
public String importRegionFromSimulation() {
// first step select a simulation and new region name
@@ -308,7 +288,7 @@
}
// ask new region name
- String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName);
+ String regionName = showInputDialog(_("isisfish.message.import.region.name"), "region from " + simulationName);
if (regionName == null || "".equals(regionName)) {
return null;
}
@@ -330,118 +310,115 @@
return regionName;
}
- /**
- * Exporter la region dans un zip
- *
- * @return
- */
- public File exportRegion() {
+ /**
+ * Exporter la region dans un zip
+ *
+ * @return TODO
+ */
+ public File exportRegion() {
File file = null;
- try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
- if (file != null) {
- int resp = JOptionPane.YES_OPTION;
- if (file.exists()) {
- resp = JOptionPane.showConfirmDialog(null,
- _("isisfish.message.file.overwrite"));
- }
- if (resp == JOptionPane.YES_OPTION) {
- regionStorage.createZip(file);
- }
- }
- } catch (Exception eee) {
- log.error("Can't export region", eee);
+ try {
+ file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ if (file != null) {
+ int resp = JOptionPane.YES_OPTION;
+ if (file.exists()) {
+ resp = JOptionPane.showConfirmDialog(null,
+ _("isisfish.message.file.overwrite"));
+ }
+ if (resp == JOptionPane.YES_OPTION) {
+ regionStorage.createZip(file);
+ }
+ }
+ } catch (Exception eee) {
+ log.error("Can't export region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Copy la region avec un autre nom
- *
- * @return
- */
- public String copyRegion() {
+ /**
+ * Copy la region avec un autre nom
+ *
+ * @return TODO
+ */
+ public String copyRegion() {
String newName = null;
- try {
- newName = showInputDialog(_("isisfish.message.new.region.name"));
+ try {
+ newName = showInputDialog(_("isisfish.message.new.region.name"));
- File zip = regionStorage.createZip();
- RegionStorage.importAndRenameZip(zip, newName);
+ File zip = regionStorage.createZip();
+ RegionStorage.importAndRenameZip(zip, newName);
- } catch (Exception eee) {
- log.error("Can't copy region", eee);
+ } catch (Exception eee) {
+ log.error("Can't copy region", eee);
showMsgBox(eee);
- }
- return newName;
- }
+ }
+ return newName;
+ }
- /**
- * Remove region
- *
- * @param cvsDelete
- * if true delete region in CVS too
- * @return
- */
- public String removeRegion(boolean cvsDelete) {
+ /**
+ * Remove region
+ *
+ * @param cvsDelete if true delete region in CVS too
+ * @return TODO
+ */
+ public String removeRegion(boolean cvsDelete) {
String result = null;
- try {
- int resp = JOptionPane.showConfirmDialog(null, _(
- "isisfish.message.confirm.remove.region",
- regionStorage.getName()));
- if (resp == JOptionPane.YES_OPTION) {
- regionStorage.delete(cvsDelete);
- result = _("isisfish.message.region.removed");
+ try {
+ int resp = JOptionPane.showConfirmDialog(null, _(
+ "isisfish.message.confirm.remove.region",
+ regionStorage.getName()));
+ if (resp == JOptionPane.YES_OPTION) {
+ regionStorage.delete(cvsDelete);
+ result = _("isisfish.message.region.removed");
- } else {
- result = _("isisfish.message.region.remove.canceled");
- }
- } catch (Exception eee) {
- log.error("Can't remove region", eee);
+ } else {
+ result = _("isisfish.message.region.remove.canceled");
+ }
+ } catch (Exception eee) {
+ log.error("Can't remove region", eee);
showMsgBox(eee);
- }
- return result;
- }
+ }
+ return result;
+ }
- /**
- * Remove region
- *
- * @return
- */
- public String commitRegionInCVS() {
+ /**
+ * Remove region
+ *
+ * @return TODO
+ */
+ public String commitRegionInCVS() {
String result = null;
- try {
- String msg = regionStorage.getCommentForNextCommit();
- JTextArea text = new JTextArea(msg);
- int resp = JOptionPane.showOptionDialog(null,
- new JScrollPane(text), _("isisfish.commit.message"),
- JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
- null, // icon
- null, null);
- if (resp == JOptionPane.OK_OPTION) {
- regionStorage.commit(text.getText());
- regionStorage.clearCommentForNextCommit();
- result = _("isisfish.message.region.commited");
- } else {
- result = _("isisfish.message.commit.region.canceled");
- }
- } catch (Exception eee) {
- log.error("Can't export region", eee);
+ try {
+ String msg = regionStorage.getCommentForNextCommit();
+ JTextArea text = new JTextArea(msg);
+ int resp = JOptionPane.showOptionDialog(null,
+ new JScrollPane(text), _("isisfish.commit.message"),
+ JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
+ null, // icon
+ null, null);
+ if (resp == JOptionPane.OK_OPTION) {
+ regionStorage.commit(text.getText());
+ regionStorage.clearCommentForNextCommit();
+ result = _("isisfish.message.region.commited");
+ } else {
+ result = _("isisfish.message.commit.region.canceled");
+ }
+ } catch (Exception eee) {
+ log.error("Can't export region", eee);
showMsgBox(eee);
- }
- return result;
- }
+ }
+ return result;
+ }
/**
* load region.
- * <p>
+ * <p/>
* RegionStorage, TopiaContext, FisheryRegion are put in uiContext data.
- * <p>
+ * <p/>
* tree ans
*
- * @param name
- * name of region
- * @return if ok return null else OutView error
+ * @param name name of region
*/
public void loadRegion(String name) {
if (log.isTraceEnabled()) {
@@ -466,77 +443,75 @@
* Create new region, and select it in combo, and show input pane region in
* input area.
*
- * @param name
- * name of the new region
- * @return if ok return null else OutView error
+ * @param name name of the new region
*/
public void newRegion(String name) {
if (log.isTraceEnabled()) {
log.trace("newRegion called");
}
try {
- if ("".equals(name)) {
+ if ("".equals(name)) {
// showMsgBox("error " + _("isisfish.error.region.name.empty"));
- }
- if (RegionStorage.getRegionNames().contains(name)) {
+ }
+ 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(eee);
}
+ RegionStorage.create(name);
+ } catch (Exception eee) {
+ log.error("Can't create region", eee);
+ showMsgBox(eee);
+ }
}
/**
* If some entities has been modified by the user (EntityModified state is
* true) then ask the user if he want save, don't save modification, or
* cancel current wanted action.
- *
+ * <p/>
* If this method return true, only button (save, cancel) will be refreshed
* not the current input panel
- *
+ * <p/>
* if this method return false, nothing is do
*
* @return false if user want cancel action, true otherwize
*/
protected boolean askForSave() {
- boolean result = true;
- return result;
+ return true;
}
/**
* Permet de creer simplement un nouvelle objet portant un nom par defaut.
* Le nouvel element est automatiquement selectionné dans l'arbre
*
- * @param type
- * le type de l'entite a creer, le type est compose seulement du
- * nom de l'entite et pas du package.
+ * @param type le type de l'entite a creer, le type est compose seulement du
+ * nom de l'entite et pas du package.
* @return null ou un fenetre d'erreur
*/
@SuppressWarnings("unchecked")
public TopiaEntity create(String type) {
- if (log.isTraceEnabled()) {
- log.trace("create called for " + type);
- }
- try {
- String name = type + "_new";
+ if (log.isTraceEnabled()) {
+ log.trace("create called for " + type);
+ }
+ try {
+ //TODO use the IsisFishEntityEnum for this purpose :
+ //TopiaDAO<TopiaEntity> dao = IsisFishEntityEnum.getEntry(type).getDAO(isisContext);
+ String name = type + "_new";
- Method method = MethodUtils.getAccessibleMethod(
- IsisFishDAOHelper.class, "get" + type + "DAO",
- TopiaContext.class);
- TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, new Object[] { isisContext });
+ Method method = MethodUtils.getAccessibleMethod(
+ IsisFishDAOHelper.class, "get" + type + "DAO",
+ TopiaContext.class);
+ TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, isisContext);
- TopiaEntity entity = dao.create("name", name);
- entity.update();
- isisContext.commitTransaction();
- return entity;
+ TopiaEntity entity = dao.create("name", name);
+ entity.update();
+ isisContext.commitTransaction();
+ return entity;
- } catch (Exception eee) {
- log.error("Can't create entity", eee);
- showMsgBox(eee);
- }
- return null;
+ } catch (Exception eee) {
+ log.error("Can't create entity", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
/**
@@ -545,26 +520,26 @@
* @return the saved entity
*/
public TopiaEntity save() {
- if (log.isTraceEnabled()) {
- log.trace("save called");
+ if (log.isTraceEnabled()) {
+ log.trace("save called");
+ }
+ try {
+ if (selected == null) {
+ log.warn("Try to save null entity");
+ return null;
}
- 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();
+ // on est pas en autoUpdate donc il faut faire le update avant le
+ // commit
+ selected.update();
- selected.getTopiaContext().commitTransaction();
- } catch (Exception eee) {
- log.error("Can't save region", eee);
- showMsgBox(eee);
- }
- return selected;
+ selected.getTopiaContext().commitTransaction();
+ } catch (Exception eee) {
+ log.error("Can't save region", eee);
+ showMsgBox(eee);
+ }
+ return selected;
}
-
+
/**
* Cancel all modification on entity (rollback), and force reload it and
* refresh all ui component that name match 'type'Tab
@@ -572,146 +547,145 @@
* @return the roolbacked entity
*/
public TopiaEntity cancel() {
- if (log.isTraceEnabled()) {
- log.trace("cancel called");
- }
- try {
- isisContext.rollbackTransaction();
+ if (log.isTraceEnabled()) {
+ log.trace("cancel called");
+ }
+ try {
+ isisContext.rollbackTransaction();
- // reload the object
- if (selected != null) {
- selected = isisContext.findByTopiaId(selected.getTopiaId());
- setValue(selected);
- }
- } catch (Exception eee) {
- log.error("Can't cancel modification in region", eee);
- showMsgBox(eee);
+ // reload the object
+ if (selected != null) {
+ selected = isisContext.findByTopiaId(selected.getTopiaId());
+ setValue(selected);
}
- return selected;
+ } catch (Exception eee) {
+ log.error("Can't cancel modification in region", eee);
+ showMsgBox(eee);
+ }
+ return selected;
}
/**
* Delete one entity and commit the change, try to selected intelligently
* other node in tree.
- * <p>
+ * <p/>
* Refresh all ui component where name match "input<entity type without
* package >.*"
*
* @return if ok return null else OutView error
*/
public String remove() {
- if (log.isTraceEnabled()) {
- log.trace("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;
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
+ String msg = "";
+ try {
+ boolean doDelete;
+ 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) {
- 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(eee);
+ if (doDelete) {
+ selected.delete();
+ isisContext.commitTransaction();
+ msg = _("isisfish.message.remove.finished");
+ } else {
+ msg = _("isisfish.message.remove.canceled");
}
- return msg;
+ } catch (Exception eee) {
+ log.error("Can't remove entity: " + selected, eee);
+ showMsgBox(eee);
+ }
+ return msg;
}
- /**
- * Save an Equation as model, to reuse it for other equation
- *
- * @param eq
- * equation to put in models
- * @return if ok return null else OutputView error message
- */
- public Object saveEquationAsModel(Equation eq) {
- try {
- if (eq != null) {
- String name = showInputDialog("");
- if ("".equals(name)) {
+ /**
+ * Save an Equation as model, to reuse it for other equation
+ *
+ * @param eq equation to put in models
+ * @return if ok return null else OutputView error message
+ */
+ public Object saveEquationAsModel(Equation eq) {
+ try {
+ if (eq != null) {
+ String name = showInputDialog("");
+ if ("".equals(name)) {
// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
- }
- if (name != null) {
- FormuleStorage storage = FormuleStorage.createFormule(eq
- .getCategory(), name, eq.getLanguage());
- storage.setContent(eq.getContent());
- }
- }
- } catch (Exception eee) {
- log.error("Can't save equation as model", eee);
- showMsgBox(eee);
- }
- return null;
- }
+ }
+ if (name != null) {
+ FormuleStorage storage = FormuleStorage.createFormule(eq
+ .getCategory(), name, eq.getLanguage());
+ storage.setContent(eq.getContent());
+ }
+ }
+ } catch (Exception eee) {
+ log.error("Can't save equation as model", eee);
+ showMsgBox(eee);
+ }
+ return null;
+ }
/**
* Save an Equation as model, to reuse it for other equation
*
- * @param category
- * category for this equation
- * @param language
- * equation to put in models
- * @param content content ?
+ * @param category category for this equation
+ * @param language equation to put in models
+ * @param content content ?
* @return if ok return null else OutputView error message
*/
public Object saveAsModel(String category, String language, String content) {
- try {
- String name = showInputDialog("");
- if ("".equals(name)) {
+ try {
+ String name = showInputDialog("");
+ if ("".equals(name)) {
// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
- }
- if (name != null) {
- FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
- storage.setContent(content);
- }
-
- } catch (Exception eee) {
- log.error("Can't save equation as model", eee);
- showMsgBox(eee);
}
- return null;
+ if (name != null) {
+ FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
+ storage.setContent(content);
+ }
+
+ } catch (Exception eee) {
+ log.error("Can't save equation as model", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
+
public Object openEditor(String category, String name,
- Class javaInterface, String content, Editor editor) {
- if (log.isTraceEnabled()) {
- log.trace("openEditor");
+ Class javaInterface, String content, Editor editor) {
+ if (log.isTraceEnabled()) {
+ log.trace("openEditor");
+ }
+ try {
+ EquationEditorPaneUI pane = new EquationEditorPaneUI();
+ pane.setEquation(category, name, javaInterface, content);
+ pane.setVisible(true);
+ if (pane.isOk() && editor != null) {
+ editor.setText(pane.getEditor().getText());
}
- try {
- EquationEditorPaneUI pane = new EquationEditorPaneUI();
- pane.setEquation(category, name, javaInterface, content);
- pane.setVisible(true);
- if (pane.isOk() && editor != null) {
- editor.setText(pane.getEditor().getText());
- }
- pane.dispose();
- } catch (Exception eee) {
- log.error("Can't open editor", eee);
- showMsgBox(eee);
- }
- return null;
+ pane.dispose();
+ } catch (Exception eee) {
+ log.error("Can't open editor", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
+
protected String getFisheryRegionName() {
if (fisheryRegion != null) {
return fisheryRegion.getName();
@@ -722,8 +696,8 @@
protected FisheryRegion getFisheryRegion() {
return fisheryRegion;
}
-
- protected TopiaEntity getSelected(){
+
+ protected TopiaEntity getSelected() {
return selected;
}
@@ -770,51 +744,52 @@
protected Strategy getStrategy() {
return strategy;
}
- protected List<Formule> getFormules(String name){
+
+ protected List<Formule> getFormules(String name) {
return FormuleStorage.getFormules(isisContext, name);
}
-
+
// InputGear
-
+
public Object addSelectivity(Population pop, String equation) {
try {
-
+
SelectivityDAO dao = IsisFishDAOHelper.getSelectivityDAO(isisContext);
Selectivity selectivity = dao.create();
-
+
selectivity.setGear(gear);
selectivity.setPopulation(pop);
selectivity.getEquation().setContent(equation);
selectivity.update();
-
+
gear.addPopulationSelectivity(selectivity);
gear.update();
-
+
} catch (Exception eee) {
log.error("Can't add selectivity", eee);
showMsgBox(eee);
}
return null;
}
-
- public Object removeSelectivity(Selectivity selectivity){
- if (log.isTraceEnabled()) {
+
+ public Object removeSelectivity(Selectivity selectivity) {
+ if (log.isTraceEnabled()) {
log.trace("removeTargetSpecies called: " + selectivity);
}
try {
if (gear != null && selectivity != null) {
gear.removePopulationSelectivity(selectivity);
}
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't remove TargetSpecies", eee);
showMsgBox(eee);
}
return null;
}
-
+
// InputMetier
-
- public Object createSeasonInfo(){
+
+ public Object createSeasonInfo() {
if (log.isTraceEnabled()) {
log.trace("createSeasonInfo called");
}
@@ -828,14 +803,14 @@
metier.update();
// isisContext.commitTransaction();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create MetierSeasonInfo", eee);
showMsgBox(eee);
}
return null;
}
- public Object removeSeasonInfo(MetierSeasonInfo info){
+ public Object removeSeasonInfo(MetierSeasonInfo info) {
if (log.isTraceEnabled()) {
log.trace("createSeasonInfo called");
}
@@ -843,33 +818,33 @@
metier.removeMetierSeasonInfo(info);
metier.update();
isisContext.commitTransaction();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create MetierSeasonInfo", eee);
showMsgBox(eee);
}
return null;
}
-
- public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch){
- if (log.isTraceEnabled()) {
+
+ public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch) {
+ if (log.isTraceEnabled()) {
log.trace("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation);
}
try {
TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(isisContext);
TargetSpecies targetSpecies = dao.create();
-
+
targetSpecies.setSpecies(species);
targetSpecies.getTargetFactorEquation().setContent(targetFactorEquation);
targetSpecies.setPrimaryCatch(primaryCatch);
m.addSpeciesTargetSpecies(targetSpecies);
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't add TargetSpecies", eee);
showMsgBox(eee);
}
return null;
}
-
- public Object removeTargetSpecies(MetierSeasonInfo m, TargetSpecies targetSpecies){
+
+ public Object removeTargetSpecies(MetierSeasonInfo m, TargetSpecies targetSpecies) {
if (log.isTraceEnabled()) {
log.trace("removeTargetSpecies called: " + targetSpecies);
}
@@ -877,7 +852,7 @@
if (targetSpecies != null) {
m.removeSpeciesTargetSpecies(targetSpecies);
}
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't remove TargetSpecies", eee);
showMsgBox(eee);
}
@@ -886,8 +861,8 @@
// SetOfVessels
- public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
- if (log.isTraceEnabled()) {
+ public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
+ if (log.isTraceEnabled()) {
log.trace("addEffortDescription called: " + setOfVessels + " metier: " + metier);
}
try {
@@ -897,14 +872,14 @@
effortDescription.update();
setOfVessels.addPossibleMetiers(effortDescription);
setOfVessels.update();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create EffortDescription", eee);
showMsgBox(eee);
}
}
-
+
public Object removeEffortDescription(SetOfVessels sov, EffortDescription effort) {
- if (log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("remove called");
}
try {
@@ -916,13 +891,13 @@
}
return null;
}
-
+
// Population
public Population createPopulation() {
if (log.isTraceEnabled()) {
- log.trace("create called");
-}
+ log.trace("create called");
+ }
try {
String name = "Population_new";
@@ -947,7 +922,7 @@
}
public Object createRecruitmentDistribution() {
- if (log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("createRecruitmentDistributionontext called: " + population);
}
try {
@@ -962,14 +937,14 @@
}
}
}
-
- if ( num > 0) {
+
+ if (num > 0) {
List<String> sem = new ArrayList<String>(num);
- for (int i=0; i<num; i++) {
+ for (int i = 0; i < num; i++) {
sem.add(_("isisfish.common.month", i));
}
- MatrixND newMat = MatrixFactory.getInstance().create(new List[]{sem});
-
+ MatrixND newMat = MatrixFactory.getInstance().create(new List[]{sem});
+
MatrixND mat = population.getRecruitmentDistribution();
if (mat != null) {
newMat.paste(mat);
@@ -983,67 +958,65 @@
}
return null;
}
-
+
// Migration
-
- public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
- if (log.isTraceEnabled()) {
- log.trace("addMigration called");
- }
- try {
- MatrixND mat = info.getMigrationMatrix().copy();
- mat.setValue(group, departure, arrival, coeff);
- info.setMigrationMatrix(mat);
-
- }catch(Exception eee){
- log.error("Can't add migration", eee);
- showMsgBox(eee);
- }
- return null;
+
+ public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
+ if (log.isTraceEnabled()) {
+ log.trace("addMigration called");
+ }
+ try {
+ MatrixND mat = info.getMigrationMatrix().copy();
+ mat.setValue(group, departure, arrival, coeff);
+ info.setMigrationMatrix(mat);
+
+ } catch (Exception eee) {
+ log.error("Can't add migration", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
public Object addEmigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, double coeff) {
- if (log.isTraceEnabled()) {
- log.trace("addEmigration called");
- }
- try {
- MatrixND mat = info.getEmigrationMatrix().copy();
- mat.setValue(group, departure, coeff);
- info.setEmigrationMatrix(mat);
-
- }catch(Exception eee){
- log.error("Can't add emigration", eee);
- showMsgBox(eee);
- }
- return null;
+ if (log.isTraceEnabled()) {
+ log.trace("addEmigration called");
+ }
+ try {
+ MatrixND mat = info.getEmigrationMatrix().copy();
+ mat.setValue(group, departure, coeff);
+ info.setEmigrationMatrix(mat);
+
+ } catch (Exception eee) {
+ log.error("Can't add emigration", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
-
+
public Object addImmigration(PopulationSeasonInfo info, PopulationGroup group, Zone arrival, double coeff) {
- if (log.isTraceEnabled()) {
- log.trace("addImmigration called");
- }
- try {
- MatrixND mat = info.getImmigrationMatrix().copy();
- mat.setValue(group, arrival, coeff);
- info.setImmigrationMatrix(mat);
-
- }catch(Exception eee){
- log.error("Can't add immigration", eee);
- showMsgBox(eee);
- }
- return null;
+ if (log.isTraceEnabled()) {
+ log.trace("addImmigration called");
+ }
+ try {
+ MatrixND mat = info.getImmigrationMatrix().copy();
+ mat.setValue(group, arrival, coeff);
+ info.setImmigrationMatrix(mat);
+
+ } catch (Exception eee) {
+ log.error("Can't add immigration", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
-// FisheryRegion
- /**
- *
- * @return TODO
- */
- public Object addMap(){
- if (log.isTraceEnabled()) {
- log.trace("AddMap called");
- }
+ // FisheryRegion
+ /** @return TODO */
+ public Object addMap() {
+ if (log.isTraceEnabled()) {
+ log.trace("AddMap called");
+ }
+
File shp = FileUtil.getFile(".*\\.shp", "shp file");
try {
if (shp != null) {
@@ -1073,7 +1046,7 @@
maps.add(basename);
fisheryRegion.setMapFileList(maps);
}
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't copy .shp or .ssx file for: " + shp, eee);
showMsgBox(eee);
}
@@ -1081,11 +1054,11 @@
}
/**
- * @param selectedMaps la list dans lequel il faut retirer la carte
+ * @param selectedMaps la list dans lequel il faut retirer la carte
* @return TODO
- */
- public Object removeMap(Object[] selectedMaps){
- if (log.isTraceEnabled()) {
+ */
+ public Object removeMap(Object[] selectedMaps) {
+ if (log.isTraceEnabled()) {
log.trace("removeMap called");
}
try {
@@ -1106,7 +1079,7 @@
fisheryRegion.setMapFileList(maps);
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't remove map", eee);
showMsgBox(eee);
}
@@ -1117,25 +1090,26 @@
* 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é
+ *
* @param cellFile file of cells
*/
- public void loadCellFile(String cellFile){
+ public void loadCellFile(String cellFile) {
if (log.isTraceEnabled()) {
log.trace("loadCell called");
}
- // FIXME todo loadCellFile
- }
+ // FIXME todo loadCellFile
+ }
- public Object saveFisheryRegion(String type){
+ public Object saveFisheryRegion(String type) {
if (log.isTraceEnabled()) {
log.trace("save called");
}
- try{
+ 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());
+ 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);
@@ -1148,20 +1122,20 @@
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;
+ 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){
+ 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.setName("La" + lati + "Lo" + longi);
cell.setLatitude(lati);
cell.setLongitude(longi);
cell.setLand(false);
@@ -1180,7 +1154,7 @@
// frame.setProgressMin(0);
// frame.setProgressMax(cells.size());
progresscpt = 0;
- for(Cell cell:cells){
+ 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
@@ -1195,14 +1169,14 @@
// frame.refreshView("inputFisheryRegion");
// frame.setInfoText(_("isisfish.message.save.finished"));
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error(_("isisfish.error.save.region"), eee);
showMsgBox(eee);
}
return null;
}
- public Object checkFisheryRegion(){
+ public Object checkFisheryRegion() {
try {
if (log.isTraceEnabled()) {
log.trace("check called: ");
@@ -1213,7 +1187,7 @@
CheckResultFrame dialog = new CheckResultFrame();
dialog.setCheckResult(result);
dialog.setVisible(true);
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error(_("isisfish.error.check.region"), eee);
showMsgBox(eee);
}
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-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-15 00:59:49 UTC (rev 1670)
@@ -131,7 +131,6 @@
int responce = askUser(content, _("isisfish.message.page.modified"));
if (responce == JOptionPane.NO_OPTION) {
context.getContextValue(InputAction.class).cancel();
- exit = true;
} else if (responce == JOptionPane.OK_OPTION) {
context.getContextValue(InputAction.class).save();
ui.setChanged(false);
@@ -140,7 +139,6 @@
if (currentNode != null) {
model.nodeChanged(currentNode);
}
- exit = true;
} else {
exit = false;
}
@@ -162,9 +160,10 @@
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);
+ /*if (data != null) {
action.setValue(data);
- }
+ }*/
action.setPath(node.getContextPath());
}
Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java (rev 0)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java 2008-12-15 00:59:49 UTC (rev 1670)
@@ -0,0 +1,38 @@
+package fr.ifremer.isisfish.ui;
+
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.JavaFileParser;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+
+/** @author chemit */
+public class TestJaxx {
+
+ @Test
+ public void testParseEntity() throws Exception {
+ URL javaSource = new File("target/generated-sources/java/fr/ifremer/isisfish/entities/Cell.java").toURI().toURL();
+
+ InputStream in = javaSource.openStream();
+ Reader reader = new InputStreamReader(in, "utf-8");
+ ClassDescriptor result = JavaFileParser.parseJavaFile(javaSource.toString(), reader, getClass().getClassLoader());
+ reader.close();
+ Assert.assertNotNull(result);
+ }
+
+ @Test
+ public void testParseEntityImpl() throws Exception {
+ URL javaSource = new File("src/main/java/fr/ifremer/isisfish/entities/CellImpl.java").toURI().toURL();
+
+ InputStream in = javaSource.openStream();
+ Reader reader = new InputStreamReader(in, "utf-8");
+ ClassDescriptor result = JavaFileParser.parseJavaFile(javaSource.toString(), reader, getClass().getClassLoader());
+ reader.close();
+ Assert.assertNotNull(result);
+ }
+}
1
0
r1669 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
13 Dec '08
Author: tchemit
Date: 2008-12-13 10:24:41 +0000 (Sat, 13 Dec 2008)
New Revision: 1669
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
scroll to selected node
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-13 09:35:22 UTC (rev 1668)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-13 10:24:41 UTC (rev 1669)
@@ -253,6 +253,7 @@
NavigationTreeNode node = NavigationUtil.findNode(this, null, path);
TreePath pathToRoot = new TreePath(getContextValue(NavigationTreeModel.class).getPathToRoot(node));
navigation.setSelectionPath(pathToRoot);
+ navigation.scrollPathToVisible(pathToRoot);
}
protected void setInfoText(String s){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
1
0
r1668 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input src/main/java/fr/ifremer/isisfish/ui/result
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
by tchemit@users.labs.libre-entreprise.org 13 Dec '08
13 Dec '08
Author: tchemit
Date: 2008-12-13 09:35:22 +0000 (Sat, 13 Dec 2008)
New Revision: 1668
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.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/InputContent.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/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java
Log:
remove deprecated code, javadoc, lissage code
pas de System.out.println
InputContent est un JAXXObject
passage de log en trace
refactor du builder de node :)
utilisation de r?\195?\169pertoires absolues pour les plugins maven
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/pom.xml 2008-12-13 09:35:22 UTC (rev 1668)
@@ -341,17 +341,17 @@
<id>Generator</id>
<phase>process-sources</phase>
<configuration>
- <srcDirUml>src/main/xmi</srcDirUml>
- <srcXmiDest>target/generated-sources/xmi/</srcXmiDest>
+ <srcDirUml>${project.basedir}/src/main/xmi</srcDirUml>
+ <srcXmiDest>${maven.gen.dir}/xmi/</srcXmiDest>
<fullPackagePath>fr.ifremer.isisfish</fullPackagePath>
<extractedPackages>fr.ifremer.isisfish</extractedPackages>
<!--Config generator-->
- <srcGenDest>target/generated-sources/objectmodel/</srcGenDest>
+ <srcGenDest>${maven.gen.dir}/objectmodel/</srcGenDest>
<includes>**/*.objectmodel</includes>
<templates>org.codelutin.topia.generator.TopiaMetaGenerator</templates>
- <destDirGen>target/generated-sources/java</destDirGen>
+ <destDirGen>${maven.gen.dir}/java</destDirGen>
<defaultPackage>fr.ifremer.isisfish</defaultPackage>
- <copyVersionDir>src/main/resources/oldmappings/%MODELNAME%</copyVersionDir>
+ <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%</copyVersionDir>
<copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
<copyOverwrite>true</copyOverwrite>
</configuration>
@@ -383,7 +383,7 @@
<goal>generate</goal>
</goals>
<configuration>
- <src>src/main/java</src>
+ <src>${project.basedir}/src/main/java</src>
</configuration>
</execution>
</executions>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
@@ -53,7 +53,7 @@
doc.setPage(e.getURL());
}
} catch (Exception eee) {
- System.out.println("Error for : " + e.getURL());
+ log.error("Error for : " + e.getURL(),eee);
eee.printStackTrace();
}
}
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-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -128,7 +128,9 @@
protected boolean isNull = true;
public InputAction() {
- log.info("new instance");
+ if (log.isDebugEnabled()) {
+ log.debug("new instance");
+ }
}
protected void showMsgBox(Exception eee){
ErrorDialogUI.showError(eee);
@@ -290,9 +292,7 @@
//TODO Should use a shared model ?
simulationName = selectSimulation(SimulationStorage.getSimulationNames());
if (simulationName == null) {
- {
- return null;
- }
+ return null;
}
} catch (Exception e) {
@@ -303,7 +303,9 @@
return null;
}
- log.info("simulation used " + simulationName);
+ if (log.isInfoEnabled()) {
+ log.info("simulation used " + simulationName);
+ }
// ask new region name
String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName);
@@ -315,7 +317,9 @@
}
- log.info("new region name " + regionName);
+ if (log.isInfoEnabled()) {
+ log.info("new region name " + regionName);
+ }
try {
SimulationStorage.getSimulation(simulationName).extractRegion(regionName);
@@ -440,7 +444,9 @@
* @return if ok return null else OutView error
*/
public void loadRegion(String name) {
- log.debug("loadRegion called");
+ if (log.isTraceEnabled()) {
+ log.trace("loadRegion called");
+ }
try {
regionStorage = null;
fisheryRegion = null;
@@ -465,8 +471,10 @@
* @return if ok return null else OutView error
*/
public void newRegion(String name) {
- try {
- log.debug("newRegion called");
+ if (log.isTraceEnabled()) {
+ log.trace("newRegion called");
+ }
+ try {
if ("".equals(name)) {
// showMsgBox("error " + _("isisfish.error.region.name.empty"));
}
@@ -508,7 +516,9 @@
*/
@SuppressWarnings("unchecked")
public TopiaEntity create(String type) {
- log.debug("create called for " + type);
+ if (log.isTraceEnabled()) {
+ log.trace("create called for " + type);
+ }
try {
String name = type + "_new";
@@ -532,12 +542,12 @@
/**
* Save entity passed in argument, and commit
*
- * @param idToRefresh
- * id to refresh after commit
- * @return if ok return null else OutView error
+ * @return the saved entity
*/
public TopiaEntity save() {
- log.debug("save called");
+ if (log.isTraceEnabled()) {
+ log.trace("save called");
+ }
try {
if (selected == null) {
log.warn("Try to save null entity");
@@ -559,13 +569,12 @@
* Cancel all modification on entity (rollback), and force reload it and
* refresh all ui component that name match 'type'Tab
*
- * @param type
- * entity type (Zone, Gear, Population, ...), prefix of user
- * interface Tab to refresh after rollback and reload
- * @return if ok return null else OutView error
+ * @return the roolbacked entity
*/
public TopiaEntity cancel() {
- log.debug("cancel called");
+ if (log.isTraceEnabled()) {
+ log.trace("cancel called");
+ }
try {
isisContext.rollbackTransaction();
@@ -591,7 +600,9 @@
* @return if ok return null else OutView error
*/
public String remove() {
- log.debug("remove called");
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
String msg = "";
try {
boolean doDelete = true;
@@ -684,7 +695,9 @@
}
public Object openEditor(String category, String name,
Class javaInterface, String content, Editor editor) {
- log.debug("openEditor");
+ if (log.isTraceEnabled()) {
+ log.trace("openEditor");
+ }
try {
EquationEditorPaneUI pane = new EquationEditorPaneUI();
pane.setEquation(category, name, javaInterface, content);
@@ -785,7 +798,9 @@
}
public Object removeSelectivity(Selectivity selectivity){
- log.debug("removeTargetSpecies called: " + selectivity);
+ if (log.isTraceEnabled()) {
+ log.trace("removeTargetSpecies called: " + selectivity);
+ }
try {
if (gear != null && selectivity != null) {
gear.removePopulationSelectivity(selectivity);
@@ -800,7 +815,9 @@
// InputMetier
public Object createSeasonInfo(){
- log.debug("createSeasonInfo called");
+ if (log.isTraceEnabled()) {
+ log.trace("createSeasonInfo called");
+ }
try {
MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper.getMetierSeasonInfoDAO(isisContext);
MetierSeasonInfo metierSeasonInfo = metierSeasonInfoPS.create();
@@ -819,7 +836,9 @@
}
public Object removeSeasonInfo(MetierSeasonInfo info){
- log.debug("createSeasonInfo called");
+ if (log.isTraceEnabled()) {
+ log.trace("createSeasonInfo called");
+ }
try {
metier.removeMetierSeasonInfo(info);
metier.update();
@@ -832,7 +851,9 @@
}
public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch){
- log.debug("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation);
+ if (log.isTraceEnabled()) {
+ log.trace("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation);
+ }
try {
TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(isisContext);
TargetSpecies targetSpecies = dao.create();
@@ -849,7 +870,9 @@
}
public Object removeTargetSpecies(MetierSeasonInfo m, TargetSpecies targetSpecies){
- log.debug("removeTargetSpecies called: " + targetSpecies);
+ if (log.isTraceEnabled()) {
+ log.trace("removeTargetSpecies called: " + targetSpecies);
+ }
try {
if (targetSpecies != null) {
m.removeSpeciesTargetSpecies(targetSpecies);
@@ -864,7 +887,9 @@
// SetOfVessels
public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
- log.debug("addEffortDescription called: " + setOfVessels + " metier: " + metier);
+ if (log.isTraceEnabled()) {
+ log.trace("addEffortDescription called: " + setOfVessels + " metier: " + metier);
+ }
try {
EffortDescriptionDAO effortDescriptionPS = IsisFishDAOHelper.getEffortDescriptionDAO(isisContext);
EffortDescription effortDescription = effortDescriptionPS.create();
@@ -879,7 +904,9 @@
}
public Object removeEffortDescription(SetOfVessels sov, EffortDescription effort) {
- log.debug("remove called");
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
try {
sov.removePossibleMetiers(effort);
isisContext.commitTransaction();
@@ -893,7 +920,9 @@
// Population
public Population createPopulation() {
- log.debug("create called");
+ if (log.isTraceEnabled()) {
+ log.trace("create called");
+}
try {
String name = "Population_new";
@@ -918,7 +947,9 @@
}
public Object createRecruitmentDistribution() {
- log.debug("createRecruitmentDistributionontext called: " + population);
+ if (log.isTraceEnabled()) {
+ log.trace("createRecruitmentDistributionontext called: " + population);
+ }
try {
String val = JOptionPane.showInputDialog(_("isisfish.message.recruitment.number.month"));
int num = -1;
@@ -956,7 +987,9 @@
// Migration
public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
- log.debug("addMigration called");
+ if (log.isTraceEnabled()) {
+ log.trace("addMigration called");
+ }
try {
MatrixND mat = info.getMigrationMatrix().copy();
mat.setValue(group, departure, arrival, coeff);
@@ -971,7 +1004,9 @@
public Object addEmigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, double coeff) {
- log.debug("addEmigration called");
+ if (log.isTraceEnabled()) {
+ log.trace("addEmigration called");
+ }
try {
MatrixND mat = info.getEmigrationMatrix().copy();
mat.setValue(group, departure, coeff);
@@ -985,7 +1020,9 @@
}
public Object addImmigration(PopulationSeasonInfo info, PopulationGroup group, Zone arrival, double coeff) {
- log.debug("addImmigration called");
+ if (log.isTraceEnabled()) {
+ log.trace("addImmigration called");
+ }
try {
MatrixND mat = info.getImmigrationMatrix().copy();
mat.setValue(group, arrival, coeff);
@@ -998,11 +1035,14 @@
return null;
}
// FisheryRegion
- /**
- * @param list la list dans lequel il faut ajouter la carte
- */
+ /**
+ *
+ * @return TODO
+ */
public Object addMap(){
- log.debug("AddMap called");
+ if (log.isTraceEnabled()) {
+ log.trace("AddMap called");
+ }
File shp = FileUtil.getFile(".*\\.shp", "shp file");
try {
@@ -1041,10 +1081,13 @@
}
/**
- * @param list la list dans lequel il faut retirer la carte
+ * @param selectedMaps la list dans lequel il faut retirer la carte
+ * @return TODO
*/
public Object removeMap(Object[] selectedMaps){
- log.debug("removeMap called");
+ if (log.isTraceEnabled()) {
+ log.trace("removeMap called");
+ }
try {
List<String> maps = fisheryRegion.getMapFileList();
@@ -1074,14 +1117,19 @@
* 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é
+ * @param cellFile file of cells
*/
public void loadCellFile(String cellFile){
- log.debug("loadCell called");
+ if (log.isTraceEnabled()) {
+ log.trace("loadCell called");
+ }
// FIXME todo loadCellFile
}
public Object saveFisheryRegion(String type){
- log.debug("save called");
+ if (log.isTraceEnabled()) {
+ log.trace("save called");
+ }
try{
TopiaContext isisContext = fisheryRegion.getTopiaContext();
@@ -1156,7 +1204,9 @@
public Object checkFisheryRegion(){
try {
- log.debug("check called: ");
+ if (log.isTraceEnabled()) {
+ log.trace("check called: ");
+ }
// frame.setInfoText(_("isisfish.message.check.region"));
CheckResult result = new CheckResult();
CheckRegion.check(fisheryRegion, result);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContent.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -5,11 +5,13 @@
package fr.ifremer.isisfish.ui.input;
+import jaxx.runtime.JAXXObject;
+
/**
*
* @author letellier
*/
-public interface InputContent {
+public interface InputContent extends JAXXObject {
void refresh();
@@ -20,4 +22,6 @@
void setActif(java.lang.Boolean b);
void setChanged(java.lang.Boolean b);
+
+ String getName();
}
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-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -5,20 +5,36 @@
package fr.ifremer.isisfish.ui.input;
+import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.FisheryRegion;
+import fr.ifremer.isisfish.entities.Gear;
+import fr.ifremer.isisfish.entities.Metier;
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.Port;
+import fr.ifremer.isisfish.entities.SetOfVessels;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.TripType;
+import fr.ifremer.isisfish.entities.VesselType;
+import fr.ifremer.isisfish.entities.Zone;
+import jaxx.runtime.Decorator;
+import jaxx.runtime.JAXXContextEntryDef;
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.NavigationTreeModelBuilder;
+import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder.ChildBuilder;
import jaxx.runtime.swing.navigation.NavigationTreeSelectionAdapterWithCardLayout;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import static org.codelutin.i18n.I18n._;
+import org.codelutin.topia.persistence.TopiaEntity;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
+import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import java.awt.Component;
-import javax.swing.JOptionPane;
-import javax.swing.JTree;
-import static org.codelutin.i18n.I18n._;
/** @author letellier */
public class InputNavigationTreeSelectionAdapter extends NavigationTreeSelectionAdapterWithCardLayout {
@@ -27,6 +43,7 @@
static private final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
protected NavigationTreeNode currentNode = null;
+
public InputNavigationTreeSelectionAdapter(InputUI context, boolean register) {
super(InputUI.class, null, context, Strategy.PER_UI_TYPE);
@@ -77,7 +94,9 @@
try {
InputContent ui = (InputContent) newUI;
boolean parameter = !context.getContextValue(InputAction.class).isNull();
- log.debug(parameter);
+ if (log.isDebugEnabled()) {
+ log.debug(parameter);
+ }
// Method setActif = newUI.getClass().getDeclaredMethod("setActif", Boolean.class);
// setActif.setAccessible(true);
// setActif.invoke(newUI, parameter);
@@ -100,9 +119,11 @@
}
public boolean checkEdit(TreeSelectionEvent event, Component content) {
boolean exit = true;
- if (content != null){
+ if (content != null) {
InputContent ui = (InputContent) content;
- System.out.println(ui + " " + ui.isChanged() + " " + ui.isActif());
+ if (log.isDebugEnabled()) {
+ log.debug(ui.getClass()+"["+ui.getName() + "] <changed:" + ui.isChanged() + ", actif: " + ui.isActif()+">");
+ }
if (ui.isActif()) {
if (ui.isChanged()) {
// ask user to close edition
@@ -111,18 +132,16 @@
if (responce == JOptionPane.NO_OPTION) {
context.getContextValue(InputAction.class).cancel();
exit = true;
- }
- else if (responce == JOptionPane.OK_OPTION){
+ } else if (responce == JOptionPane.OK_OPTION) {
context.getContextValue(InputAction.class).save();
ui.setChanged(false);
- JTree tree = (JTree)event.getSource();
- NavigationTreeModel model = (NavigationTreeModel)tree.getModel();
- if (currentNode != null){
+ JTree tree = (JTree) event.getSource();
+ NavigationTreeModel model = (NavigationTreeModel) tree.getModel();
+ if (currentNode != null) {
model.nodeChanged(currentNode);
}
exit = true;
- }
- else{
+ } else {
exit = false;
}
}
@@ -148,4 +167,81 @@
}
action.setPath(node.getContextPath());
}
+
+ public static NavigationTreeModel getTreeModel(String regionName, FisheryRegion fisheryRegion) {
+
+ //String regionName = context.getContextValue(InputAction.class).getFisheryRegionName();
+ NavigationTreeModelBuilder builder = new NavigationTreeModelBuilder("/");
+
+ if (regionName == null) {
+ return null;
+ }
+
+ ChildBuilder<TopiaEntity> childBuilder = new ChildBuilder<TopiaEntity>(builder) {
+
+ Decorator<? extends TopiaEntity> decorator;
+
+ public void init(Class<? extends TopiaEntity> klass) {
+ decorator = jaxx.runtime.PropertyDecorator.newDecorator(klass, "name");
+ }
+
+ public Decorator<? extends TopiaEntity> getDecorator(TopiaEntity child) {
+ return decorator;
+ }
+
+ public String getJXPath(TopiaEntity child) {
+ return "..[@topiaId=\"" + child.getTopiaId() + "\"]";
+ }
+
+ public String getNavigationPath(TopiaEntity child) {
+ return child.getTopiaId();
+ }
+ };
+
+ try {
+
+ NavigationTreeNode root = builder.build(null, regionName, JAXXContextEntryDef.newDef(FisheryRegion.class), "$root", FisheryRegionUI.class, null);
+
+ childBuilder.build(builder.build(root, "Cells", "../cell", "$cells", CellUI.class, null),
+ true, Cell.class, fisheryRegion.getCell(), CellUI.class, null);
+
+ childBuilder.build(builder.build(root, "Zones", "../zone", "$zones", ZoneUI.class, null),
+ true, Zone.class, fisheryRegion.getZone(), ZoneUI.class, null);
+
+ childBuilder.build(builder.build(root, "Ports", "../port", "$ports", PortUI.class, null),
+ true, Port.class, fisheryRegion.getPort(), PortUI.class, null
+ );
+
+ NavigationTreeNode species = builder.build(root, "Species", "../species", "$species", SpeciesUI.class, null);
+
+ for (Species specie : fisheryRegion.getSpecies()) {
+ NavigationTreeNode speciesChild = builder.build(species, specie.toString(), "..[@topiaId=\"" + specie.getTopiaId() + "\"]", specie.getTopiaId(), SpeciesUI.class, null);
+ NavigationTreeNode populations = builder.build(speciesChild, "Populations", "../population", "$populations", PopulationUI.class, null);
+ childBuilder.build(populations, true, Population.class, specie.getPopulation(), PopulationUI.class, null);
+ }
+
+ childBuilder.build(builder.build(root, "Gears", "../gear", "$gears", GearUI.class, null),
+ true, Gear.class, fisheryRegion.getGear(), GearUI.class, null);
+
+ childBuilder.build(builder.build(root, "Metiers", "../metier", "$metiers", MetierUI.class, null),
+ true, Metier.class, fisheryRegion.getMetier(), MetierUI.class, null);
+
+ childBuilder.build(builder.build(root, "TripTypes", "../tripType", "$tripTypes", TripTypeUI.class, null),
+ true, TripType.class, fisheryRegion.getTripType(), TripTypeUI.class, null);
+
+ childBuilder.build(builder.build(root, "VesselTypes", "../vesselType", "$vesselTypes", VesselTypeUI.class, null),
+ true, VesselType.class, fisheryRegion.getVesselType(), VesselTypeUI.class, null);
+
+ childBuilder.build(builder.build(root, "SetOfVessels", "../setOfVessels", "$setOfVessels", SetOfVesselsUI.class, null),
+ true, SetOfVessels.class, fisheryRegion.getSetOfVessels(), SetOfVesselsUI.class, null);
+
+ childBuilder.build(builder.build(root, "Strategies", "../strategy", "$strategies", StrategyUI.class, null),
+ true, fr.ifremer.isisfish.entities.Strategy.class, fisheryRegion.getStrategy(), StrategyUI.class, null);
+
+ } catch (Exception ex) {
+ log.error(ex.getMessage(), ex);
+ }
+ return builder.getModel();
+ }
+
}
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-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
@@ -231,63 +231,19 @@
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", 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);
- 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);
+ FisheryRegion fisheryRegion = getContextValue(InputAction.class).getFisheryRegion();
+ setContextValue(fisheryRegion);
+ NavigationTreeModel model = InputNavigationTreeSelectionAdapter.getTreeModel(regionName, fisheryRegion);
+ navigation.setSelectionModel(navigationSelectionModel);
+ navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
- setNode(builder, cells, fisheryRegion.getCell().toArray(), CellUI.class, Cell.class);
- setNode(builder, zones, fisheryRegion.getZone().toArray(), ZoneUI.class, Zone.class);
- setNode(builder, ports, fisheryRegion.getPort().toArray(), PortUI.class, Port.class);
- setNode(builder, gears, fisheryRegion.getGear().toArray(), GearUI.class, Gear.class);
- setNode(builder, metiers, fisheryRegion.getMetier().toArray(), MetierUI.class, Metier.class);
- setNode(builder, tripTypes, fisheryRegion.getTripType().toArray(), TripTypeUI.class, TripType.class);
- setNode(builder, vesselTypes, fisheryRegion.getVesselType().toArray(), VesselTypeUI.class, VesselType.class);
- setNode(builder, setOfVessels, fisheryRegion.getSetOfVessels().toArray(), SetOfVesselsUI.class, SetOfVessels.class);
- setNode(builder, strategies, fisheryRegion.getStrategy().toArray(), StrategyUI.class, Strategy.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, "Populations", "../population", "$populations", PopulationUI.class, null);
- if (specie.getPopulation() != null){
- setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class, Population.class);
- }
- }
-
- navigation.setSelectionModel(navigationSelectionModel);
- navigation.setCellRenderer(new NavigationTreeCellRenderer(this));
- 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);
- }
- }
+ setContextValue(model);
+ navigation.setModel(model);
+ new InputNavigationTreeSelectionAdapter(this, true);
+ setTreeSelection("$root");
}
- protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class<?> type){
- Decorator deco = jaxx.runtime.PropertyDecorator.newDecorator(type, "name");
- for (Object o : values){
- TopiaEntity topiaEntity = (TopiaEntity)o;
- builder.build(parent, deco , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
- }
- }
+
public void repaintNode(String path){
NavigationTreeModel model = getContextValue(NavigationTreeModel.class);
NavigationTreeNode currentNode = model.findNode(path);
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-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-13 09:35:22 UTC (rev 1668)
@@ -116,7 +116,9 @@
int i = 0;
for (Cell c : cellsSelected){
indexs[i] = zoneCellsModel.indexOf(c);
- System.out.println("refresh " + c + " " + i);
+ if (log.isDebugEnabled()) {
+ log.debug("refresh " + c + " " + i);
+ }
i++;
}
zoneCells.setSelectedIndices(indexs);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-12-12 20:41:08 UTC (rev 1667)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/result/ResultEdit.java 2008-12-13 09:35:22 UTC (rev 1668)
@@ -91,11 +91,9 @@
setStatusOK(true);
}
- /* (non-Javadoc)
- * @see java.lang.Object#finalize()
- */
@Override
protected void finalize() throws Throwable {
+ super.finalize();
if (this.tx != null) {
this.tx.closeContext();
}
@@ -139,6 +137,7 @@
* infoItemTab. Le 0 contient les dates.
*
* @param group le group utilise pour mettre a jour le infoItemTab
+ * @return todo
*/
protected InfoPanelable [] createInfoPanel(MatrixND group) {
if (group == null){
@@ -177,7 +176,7 @@
getInfoPanel().setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
- c.gridy = 0000;
+ c.gridy = 0;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = 1;
@@ -204,7 +203,7 @@
/**
* Set the value of simulation.
- * @param v Value to assign to simulation.
+ * @param simulation Value to assign to simulation.
*/
public void setSimulation(SimulationStorage simulation) {
try {
@@ -213,8 +212,9 @@
this.tx.closeContext();
}
this.tx = simulation.getStorage().beginTransaction();
- FisheryRegion region = simulation.getFisheryRegion();
-
+ FisheryRegion region = SimulationStorage.getFisheryRegion(this.tx);
+ //FisheryRegion region = simulation.getFisheryRegion();
+
mapBean.setRegion(region);
resultManager = simulation.getResultStorage();
@@ -264,13 +264,13 @@
mat1 = mat1.sumOverDim(0);
mat1 = mat1.sumOverDim(1);
mat1 = mat1.reduce();
- resume.append(_("isisfish.result.begin.simulation")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.result.begin.simulation")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
mat1 = resultManager.getMatrix(resultManager.getLastDate(), name, tx);
mat1 = mat1.sumOverDim(0);
mat1 = mat1.sumOverDim(1);
mat1 = mat1.reduce();
- resume.append(_("isisfish.result.end.simulation")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.result.end.simulation")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
else if(name.startsWith(REJETPARMETIER_STRING)){
MatrixND mat1 = resultManager.getMatrix(name, tx);
@@ -280,7 +280,7 @@
mat1 = mat1.sumOverDim(3);
mat1 = mat1.reduce();
- resume.append(_("isisfish.common.sum")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.common.sum")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
else if (!name.startsWith(CAPTUREPARMETIER_STRING) && name.startsWith(CAPTURE_STRING)){
MatrixND mat1 = resultManager.getMatrix(name, tx);
@@ -289,7 +289,7 @@
mat1 = mat1.sumOverDim(2);
mat1 = mat1.reduce();
- resume.append(_("isisfish.common.sum")+mat1.getName()+": "+mat1.getValue(0)+"\n");
+ resume.append(_("isisfish.common.sum")).append(mat1.getName()).append(": ").append(mat1.getValue(0)).append("\n");
}
} catch (Exception eee) {
resume.append(_("isisfish.error.no.matrix" + name));
@@ -334,8 +334,11 @@
* Method reduction permet de reduire la matrice en fonction des
* selections de l'utilisateur dans l'interface.
*
- * @param group
- */
+ * @param matrix todo
+ *
+ * @param infoItems todo
+ * @return todo
+ */
protected MatrixND createAndReduce(MatrixND matrix, InfoPanelable [] infoItems){
// Reduit la matrice en fonction des choix de l utilisateur
@@ -525,7 +528,7 @@
* les methods que l'on trouve dans les scripts de l'objet Export.
*/
public Vector getMenuExport_menuChilds(){
- Vector result = new Vector();
+ Vector<JMenuItem> result = new Vector<JMenuItem>();
for (String name : ExportStorage.getExportNames()) {
JMenuItem item = getExportMenu(name);
result.add(item);
@@ -536,7 +539,9 @@
/**
* Retourne l'item de menu qui permet l'appelle de la method du code
* ECMAScript d'export.
- */
+ * @param methodName todo
+ * @return todo
+ */
protected JMenuItem getExportMenu(String methodName){
JMenuItem result = new JMenuItem(_(methodName));
result.addActionListener(new ExportActionListener(methodName));
1
0
r1667 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: tchemit
Date: 2008-12-12 20:41:08 +0000 (Fri, 12 Dec 2008)
New Revision: 1667
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
Log:
utilisation jaxx en snapshot pour avoir l'amelioration du rendu des nodes mais c'est pas encore ?\195?\167a.
ajout de TODO dans CellUI pour utiliser des PCS et le binding jaxx
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-12 19:51:39 UTC (rev 1666)
+++ isis-fish/trunk/pom.xml 2008-12-12 20:41:08 UTC (rev 1667)
@@ -306,7 +306,7 @@
<!--labs.project>isis-fish</labs.project-->
<!-- jaxx version -->
- <jaxx.version>0.7</jaxx.version>
+ <jaxx.version>0.8-SNAPSHOT</jaxx.version>
<!-- generator version -->
<generator.version>0.62</generator.version>
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-12 19:51:39 UTC (rev 1666)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-12 20:41:08 UTC (rev 1667)
@@ -113,9 +113,9 @@
getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
}
protected void valueChanged(boolean b){
- changed=b;
- save.setEnabled(b);
- cancel.setEnabled(b);
+ //TODO remove method valueChanged
+ // must use the setter to fire property changes, and make possible bindings
+ setChanged(b);
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -125,21 +125,25 @@
Cell c = (Cell)fieldCell.getSelectedItem();
getContextValue(InputAction.class).setValue(c);
getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
+ //fixme no :) as you select a new node, you should not do anything more on ui ?
refresh();
valueChanged(true);
}
protected void nameChanged(){
getContextValue(InputAction.class).getCell().setName(fieldCellName.getText());
+ //fixme no :) use a propertyChangeListener on the bean
refresh();
valueChanged(true);
}
protected void cellLandChanged(){
getContextValue(InputAction.class).getCell().setLand(fieldCellLand.isSelected());
+ //fixme no :) use a propertyChangeListener on the bean
refresh();
valueChanged(true);
}
protected void commentChanged(){
getContextValue(InputAction.class).getCell().setComment(fieldCellComment.getText());
+ //fixme no :) use a propertyChangeListener on the bean
refresh();
valueChanged(true);
}
1
0
r1666 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
by tchemit@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: tchemit
Date: 2008-12-12 19:51:39 +0000 (Fri, 12 Dec 2008)
New Revision: 1666
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
chargement des regions sans frezzer l'ordinateur :)
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-12 16:35:44 UTC (rev 1665)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 19:51:39 UTC (rev 1666)
@@ -100,11 +100,15 @@
return new DefaultComboBoxModel(Common.getRegionItem());
}
protected void regionChange(){
- String name = fieldCurrentRegion.getSelectedItem().toString();
+ final String name = fieldCurrentRegion.getSelectedItem().toString();
setInfoText(_("isisfish.message.loading.region", name));
- getContextValue(InputAction.class).loadRegion(name);
- setInfoText(_("isisfish.message.load.finished"));
- setTreeModel();
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ getContextValue(InputAction.class).loadRegion(name);
+ setInfoText(_("isisfish.message.load.finished"));
+ setTreeModel();
+ }
+ });
}
/* protected void setTreeModel(){
tree.setModel(getTreeModel());
@@ -277,10 +281,10 @@
}
}
}
- protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class type){
+ protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class<?> type){
+ Decorator deco = jaxx.runtime.PropertyDecorator.newDecorator(type, "name");
for (Object o : values){
- TopiaEntity topiaEntity = (TopiaEntity)o;
- Decorator deco = JXPathDecorator.newDecorator(type, "${name}$s");
+ TopiaEntity topiaEntity = (TopiaEntity)o;
builder.build(parent, deco , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
}
}
1
0
r1665 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: sletellier
Date: 2008-12-12 16:35:44 +0000 (Fri, 12 Dec 2008)
New Revision: 1665
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/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/PopulationBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.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/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
Log:
Remove entity works
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -97,6 +97,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$gears");
valueChanged(false);
refresh();
}
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -179,6 +179,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
valueChanged(false);
seasonInit = false;
refresh();
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -109,6 +109,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
valueChanged(false);
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-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -289,6 +289,9 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/" + species.getTopiaId() + "/$populations");
valueChanged(false);
refresh();
}
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -184,6 +184,9 @@
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species/" + species.getTopiaId() + "/$populations");
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -133,6 +133,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$ports");
valueChanged(false);
refresh();
}
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -165,6 +165,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels");
valueChanged(false);
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-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -98,6 +98,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$species");
valueChanged(false);
refresh();
}
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -160,6 +160,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$strategies");
valueChanged(false);
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-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -113,6 +113,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes");
valueChanged(false);
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-12-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -107,6 +107,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes");
valueChanged(false);
refresh();
}
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-12 16:23:58 UTC (rev 1664)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 16:35:44 UTC (rev 1665)
@@ -172,6 +172,8 @@
}
protected void remove(){
setInfoText(getContextValue(InputAction.class).remove());
+ getParentContainer(InputUI.class).setTreeModel();
+ getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
valueChanged(false);
refresh();
}
1
0
r1664 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
by sletellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: sletellier
Date: 2008-12-12 16:23:58 +0000 (Fri, 12 Dec 2008)
New Revision: 1664
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/FisheryRegionUI.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/PopulationMigrationEquationUI.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/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/ZoneUI.jaxx
Log:
Save popup works
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -98,15 +98,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Cell");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void goToZone(){
@@ -201,10 +201,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -113,16 +113,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$setOfVessels/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("SetOfVessels");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -130,7 +129,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(GearUI.class).setChanged(b);
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -366,10 +365,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
<JButton id='remove' text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -93,6 +93,7 @@
fieldMapfiles.setModel(model);
}
protected void valueChanged(boolean b){
+ changed = b;
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -155,16 +156,15 @@
protected void save(){
setMsg(_("isisfish.message.checking.cell"));
getContextValue(InputAction.class).saveFisheryRegion("FisheryRegion");
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root");
valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root");
setMsg(_("isisfish.message.save.finished"));
+ refresh();
}
protected void cancel(){
- getContextValue(InputAction.class).cancel("FisheryRegion");
+ getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root");
}
protected void check(){
getContextValue(InputAction.class).checkFisheryRegion();
@@ -312,10 +312,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='save' enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
- <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
<cell fill='horizontal' weightx='0.3'>
<JButton id='check' text="isisfish.common.check" onActionPerformed='check()'/>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -42,7 +42,9 @@
import fr.ifremer.isisfish.ui.WelcomePanelUI;
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.topia.TopiaException;
-
+ import jaxx.runtime.swing.navigation.NavigationTreeModel;
+ import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+
public GearTabUI (InputAction action){
setContextValue(action);
@@ -82,17 +84,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$gears/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Gear");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -105,9 +105,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
- save.setEnabled(b);
+ getParentContainer(GearUI.class).setChanged(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getGear().setName(fieldGearName.getText());
@@ -204,15 +202,15 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="save" enabled='{isActif()}' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id="save" enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' enabled='{isActif()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="create" text="isisfish.common.new" onActionPerformed='create()' enabled='{isActif()}'/>
+ <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()' enabled='{isActif()}'/>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -44,14 +44,31 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Metier;
+ init();
public GearUI (InputAction action){
-
+
setContextValue(action);
}
public void refresh() {
gearTabUI.refresh();
selectivityUI.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ gearTabUI.setActif((Boolean)evt.getNewValue());
+ selectivityUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ gearTabUI.setChanged((Boolean)evt.getNewValue());
+ selectivityUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void goToMetier(){
getParentContainer(InputUI.class).setTreeSelection("$root/$metiers");
}
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-12 16:23:58 UTC (rev 1664)
@@ -125,6 +125,7 @@
protected VesselType vesselType;
protected SetOfVessels setOfVessels;
protected Strategy strategy;
+ protected boolean isNull = true;
public InputAction() {
log.info("new instance");
@@ -133,22 +134,24 @@
ErrorDialogUI.showError(eee);
}
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;
- selected=null;
+// cell = null;
+// zone = null;
+// port = null;
+// species = null;
+// population = null;
+// gear = null;
+// metier = null;
+// tripType = null;
+// vesselType = null;
+// setOfVessels = null;
+// strategy = null;
+// selected=null;
if (!(value instanceof TopiaEntity)) {
// this is not a TopiaEntity value, so quit
+ isNull = true;
return;
}
+ isNull = false;
switch (IsisFishEntityEnum.valueOf(value.getClass())){
case Zone:
zone = (Zone) value;
@@ -185,8 +188,11 @@
strategy = (Strategy) value;
break;
}
- selected = (TopiaEntity) value;
+ selected = (TopiaEntity) value;
}
+ public boolean isNull(){
+ return isNull;
+ }
public void setPath(String path){
this.path = path;
}
@@ -558,7 +564,7 @@
* interface Tab to refresh after rollback and reload
* @return if ok return null else OutView error
*/
- public TopiaEntity cancel(String type) {
+ public TopiaEntity cancel() {
log.debug("cancel called");
try {
isisContext.rollbackTransaction();
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-12 16:23:58 UTC (rev 1664)
@@ -17,6 +17,7 @@
import javax.swing.event.TreeSelectionEvent;
import java.awt.Component;
import javax.swing.JOptionPane;
+import javax.swing.JTree;
import static org.codelutin.i18n.I18n._;
/** @author letellier */
@@ -25,6 +26,7 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
+ protected NavigationTreeNode currentNode = null;
public InputNavigationTreeSelectionAdapter(InputUI context, boolean register) {
super(InputUI.class, null, context, Strategy.PER_UI_TYPE);
@@ -74,13 +76,14 @@
// apply refresh method (should a contract for all this ui with a method refresh...)
try {
InputContent ui = (InputContent) newUI;
- boolean parameter = context.getContextValue(InputAction.class).getSelected() != null;
+ boolean parameter = !context.getContextValue(InputAction.class).isNull();
log.debug(parameter);
// Method setActif = newUI.getClass().getDeclaredMethod("setActif", Boolean.class);
// setActif.setAccessible(true);
// setActif.invoke(newUI, parameter);
ui.setActif(parameter);
ui.refresh();
+ currentNode = node;
// Method refresh = newUI.getClass().getDeclaredMethod("refresh");
// refresh.setAccessible(true);
// refresh.invoke(newUI);
@@ -92,32 +95,46 @@
@Override
protected boolean closeUI(TreeSelectionEvent event, Component component) throws Exception {
// by default, we says that component was succesfull closed
- return checkEdit(component);
+ boolean exit = checkEdit(event, component);
+ return exit;
}
- public boolean checkEdit(Component content) {
- boolean wasClosed = true;
+ public boolean checkEdit(TreeSelectionEvent event, Component content) {
+ boolean exit = true;
if (content != null){
InputContent ui = (InputContent) content;
+ System.out.println(ui + " " + ui.isChanged() + " " + ui.isActif());
if (ui.isActif()) {
if (ui.isChanged()) {
// ask user to close edition
// still in edit mode, must warn user
- boolean willQuit = askUser(content, _("isisfish.message.page.modified"));
- if (!willQuit) {
- return false;
+ int responce = askUser(content, _("isisfish.message.page.modified"));
+ if (responce == JOptionPane.NO_OPTION) {
+ context.getContextValue(InputAction.class).cancel();
+ exit = true;
}
+ else if (responce == JOptionPane.OK_OPTION){
+ context.getContextValue(InputAction.class).save();
+ ui.setChanged(false);
+ JTree tree = (JTree)event.getSource();
+ NavigationTreeModel model = (NavigationTreeModel)tree.getModel();
+ if (currentNode != null){
+ model.nodeChanged(currentNode);
+ }
+ exit = true;
+ }
+ else{
+ exit = false;
+ }
}
- context.getContextValue(InputAction.class).save();
- ui.setChanged(false);
}
}
- return wasClosed;
+ return exit;
}
- public boolean askUser(Component parent, String message) {
+ public int askUser(Component parent, String message) {
int response = JOptionPane.showConfirmDialog(parent, message,
- _("isisfish.input.menu.commit"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
- return response == JOptionPane.OK_OPTION;
+ _("isisfish.input.menu.commit"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
+ return response;
}
@Override
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -69,6 +69,8 @@
import fr.ifremer.isisfish.entities.FisheryRegion;
import jaxx.runtime.swing.navigation.NavigationTreeCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
+ import jaxx.runtime.Decorator;
+ import jaxx.runtime.JXPathDecorator;
/* tree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
@@ -244,22 +246,22 @@
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);
+ setNode(builder, cells, fisheryRegion.getCell().toArray(), CellUI.class, Cell.class);
+ setNode(builder, zones, fisheryRegion.getZone().toArray(), ZoneUI.class, Zone.class);
+ setNode(builder, ports, fisheryRegion.getPort().toArray(), PortUI.class, Port.class);
+ setNode(builder, gears, fisheryRegion.getGear().toArray(), GearUI.class, Gear.class);
+ setNode(builder, metiers, fisheryRegion.getMetier().toArray(), MetierUI.class, Metier.class);
+ setNode(builder, tripTypes, fisheryRegion.getTripType().toArray(), TripTypeUI.class, TripType.class);
+ setNode(builder, vesselTypes, fisheryRegion.getVesselType().toArray(), VesselTypeUI.class, VesselType.class);
+ setNode(builder, setOfVessels, fisheryRegion.getSetOfVessels().toArray(), SetOfVesselsUI.class, SetOfVessels.class);
+ setNode(builder, strategies, fisheryRegion.getStrategy().toArray(), StrategyUI.class, Strategy.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", "$populations", PopulationUI.class, null);
+ NavigationTreeNode populations = builder.build(speciesChild, "Populations", "../population", "$populations", PopulationUI.class, null);
if (specie.getPopulation() != null){
- setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class);
+ setNode(builder, populations, specie.getPopulation().toArray(), PopulationUI.class, Population.class);
}
}
@@ -275,14 +277,19 @@
}
}
}
- protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui){
+ protected void setNode(NavigationTreeModelBuilder builder, NavigationTreeNode parent, Object[] values, Class ui, Class type){
for (Object o : values){
TopiaEntity topiaEntity = (TopiaEntity)o;
- builder.build(parent, o.toString() , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
+ Decorator deco = JXPathDecorator.newDecorator(type, "${name}$s");
+ builder.build(parent, deco , "..[@topiaId=\"" + topiaEntity.getTopiaId() + "\"]", topiaEntity.getTopiaId(), ui, null);
}
}
- protected void setTreeSelection(String path){
- System.out.println(path);
+ public void repaintNode(String path){
+ NavigationTreeModel model = getContextValue(NavigationTreeModel.class);
+ NavigationTreeNode currentNode = model.findNode(path);
+ model.nodeChanged(currentNode);
+ }
+ public void setTreeSelection(String path){
NavigationTreeNode node = NavigationUtil.findNode(this, null, path);
TreePath pathToRoot = new TreePath(getContextValue(NavigationTreeModel.class).getPathToRoot(node));
navigation.setSelectionPath(pathToRoot);
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -192,22 +192,22 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$metiers/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(MetierUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
protected void openEditor(){
getContextValue(InputAction.class).openEditor("TargetFactor","new",fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation.class, fieldTargetFactorScript.getText(), fieldTargetFactorScript);
@@ -306,10 +306,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='false'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='false'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -165,16 +165,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$metiers/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
- seasonInit = false;
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -188,8 +188,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
+ getParentContainer(MetierUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
protected void zonesChanged(){
Object selected = fieldMetierSeasonChoice.getSelectedItem();
@@ -272,10 +273,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id ='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id ='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -96,17 +96,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$metiers/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -119,9 +117,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
+ getParentContainer(MetierUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]></script>
<row>
@@ -169,10 +167,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="save" text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id="save" text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id="cancel" text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id="cancel" text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -43,6 +43,8 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.TripType;
+
+ init();
public MetierUI (InputAction action){
setContextValue(action);
@@ -54,6 +56,24 @@
metierSeasonInfoUI.setSeasonInit(true);
metierSeasonInfoUI.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ metierTabUI.setActif((Boolean)evt.getNewValue());
+ metierSeasonSpeciesUI.setActif((Boolean)evt.getNewValue());
+ metierSeasonInfoUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ metierTabUI.setChanged((Boolean)evt.getNewValue());
+ metierSeasonSpeciesUI.setChanged((Boolean)evt.getNewValue());
+ metierSeasonInfoUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void goToTripType(){
getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes");
}
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -120,7 +120,7 @@
GenericCell c = new GenericCell(f.getName(), f, Formule.class);
model.addElement(c);
if (pop != null){
- if (((Equation)f).equals(pop.getGrowth())){
+ if (f.equals((Formule)pop.getGrowth())){
selected = c;
}
}
@@ -275,18 +275,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- Population population = (Population) topia;
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ population.getSpecies().getTopiaId() +"/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -299,9 +297,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]>
</script>
@@ -446,10 +444,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -80,16 +80,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$population/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -97,9 +97,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -127,10 +127,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -45,6 +45,7 @@
import fr.ifremer.isisfish.entities.Population;
protected Population pop = null;
+ init();
public PopulationEquationUI (InputAction action){
setContextValue(action);
@@ -58,21 +59,39 @@
naturalDeathRate.refresh();
meanWeight.refresh();
price.refresh();
- valueChanged(false);
}
}
+
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ naturalDeathRate.setActif((Boolean)evt.getNewValue());
+ meanWeight.setActif((Boolean)evt.getNewValue());
+ price.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ naturalDeathRate.setChanged((Boolean)evt.getNewValue());
+ meanWeight.setChanged((Boolean)evt.getNewValue());
+ price.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -80,7 +99,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -103,10 +122,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" enabled='{isActif()}' onActionPerformed='cancel()'/>
+ <JButton id='cancel' text="isisfish.common.cancel" enabled='{isChanged()}' onActionPerformed='cancel()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" enabled='{isActif()}' onActionPerformed='save()'/>
+ <JButton id='save' text="isisfish.common.save" enabled='{isChanged()}' onActionPerformed='save()'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -114,16 +114,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -131,8 +131,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]>
</script>
@@ -210,10 +211,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' enabled='{isActif()}' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='save' enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' enabled='{isActif()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -45,6 +45,7 @@
protected Population pop = null;
protected PopulationSeasonInfo popInfo = null;
+ init();
public PopulationMigrationEquationUI (InputAction action){
setContextValue(action);
@@ -68,6 +69,24 @@
emigrationEquation.refresh();
immigrationEquation.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ migrationEquation.setActif((Boolean)evt.getNewValue());
+ emigrationEquation.setActif((Boolean)evt.getNewValue());
+ immigrationEquation.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ migrationEquation.setChanged((Boolean)evt.getNewValue());
+ emigrationEquation.setChanged((Boolean)evt.getNewValue());
+ immigrationEquation.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
]]>
</script>
<row>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -48,6 +48,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+ init();
protected Population pop;
// protected PopulationSeasonInfo populationSeasonInfoSelected = null;
public PopulationMigrationUI (InputAction action){
@@ -79,6 +80,26 @@
fieldPopulationMigrationComment.setText("");
}
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationMigrationEquationUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationMigrationUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationImmigrationUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationEmigrationUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationMigrationEquationUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationMigrationUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationImmigrationUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationEmigrationUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void setFieldPopulationMigrationSeasonChooserModel(){
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (PopulationSeasonInfo psi : pop.getPopulationSeasonInfo()){
@@ -116,16 +137,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -133,9 +154,9 @@
root.setInfoText(txt);
}
public void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -179,10 +200,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -135,16 +135,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -152,9 +152,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -237,10 +237,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -165,15 +165,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Metier");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$metiers/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -186,9 +187,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
]]>
</script>
@@ -245,10 +246,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -46,6 +46,8 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Gear;
+
+ init();
public PopulationUI (InputAction action){
setContextValue(action);
}
@@ -60,6 +62,34 @@
populationMigrationUI.refresh();
setSpecies();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationBasicsUI.setActif((Boolean)evt.getNewValue());
+ populationGroupUI.setActif((Boolean)evt.getNewValue());
+ populationEquationUI.setActif((Boolean)evt.getNewValue());
+ populationZoneUI.setActif((Boolean)evt.getNewValue());
+ populationSeasonsUI.setActif((Boolean)evt.getNewValue());
+ populationCapturabilityUI.setActif((Boolean)evt.getNewValue());
+ populationRecruitementUI.setActif((Boolean)evt.getNewValue());
+ populationMigrationUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ populationBasicsUI.setChanged((Boolean)evt.getNewValue());
+ populationGroupUI.setChanged((Boolean)evt.getNewValue());
+ populationEquationUI.setChanged((Boolean)evt.getNewValue());
+ populationZoneUI.setChanged((Boolean)evt.getNewValue());
+ populationSeasonsUI.setChanged((Boolean)evt.getNewValue());
+ populationCapturabilityUI.setChanged((Boolean)evt.getNewValue());
+ populationRecruitementUI.setChanged((Boolean)evt.getNewValue());
+ populationMigrationUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void setSpecies(){
String[] paths = getContextValue(InputAction.class).getPath().split("/");
String topiaId = null;
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -160,16 +160,16 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
+ TopiaEntity species = (TopiaEntity) getContextValue(InputAction.class).getSpecies();
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + species.getTopiaId() + "/$populations/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Population");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$populations/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -177,7 +177,7 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
+ getParentContainer(PopulationUI.class).setChanged(b);
save.setEnabled(b);
cancel.setEnabled(b);
}
@@ -226,12 +226,12 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -120,17 +120,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$ports/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Port");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$ports/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -147,8 +145,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getPort().setName(fieldPortName.getText());
@@ -206,10 +204,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -150,22 +150,19 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$gears/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Gear");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$gears/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
- save.setEnabled(b);
+ getParentContainer(GearUI.class).setChanged(b);
}
protected void equationChanged(){
GenericCell g = (GenericCell)fieldSelectivityEquation.getSelectedItem();
@@ -252,10 +249,10 @@
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -152,17 +152,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$setOfVessels/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("SetOfVessels");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -175,9 +173,9 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
- changed=b;
- cancel.setEnabled(b);
+ getParentContainer(GearUI.class).setChanged(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getSetOfVessels().setName(fieldSetOfVesselsName.getText());
@@ -333,10 +331,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -44,6 +44,7 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Strategy;
+ init();
public SetOfVesselsUI (InputAction action){
setContextValue(action);
@@ -51,7 +52,23 @@
public void refresh() {
setOfVesselsTabsUI.refresh();
effortDescriptionUI.refresh();
- }
+ }
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ setOfVesselsTabsUI.setActif((Boolean)evt.getNewValue());
+ effortDescriptionUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ setOfVesselsTabsUI.setChanged((Boolean)evt.getNewValue());
+ effortDescriptionUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void goToStrategies(){
getParentContainer(InputUI.class).setTreeSelection("$root/$strategies");
}
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -73,6 +73,7 @@
fieldSpeciesComment.setText("");
goToPopulation.setEnabled(false);
}
+ valueChanged(false);
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Species");
@@ -84,18 +85,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId());
-
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$species/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Species");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -109,8 +107,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void setInfoText(String txt){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
@@ -212,10 +210,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -44,6 +44,7 @@
import fr.ifremer.isisfish.ui.WelcomePanelUI;
import org.codelutin.topia.persistence.TopiaEntity;
+ init();
public StrategyMonthInfoUI (InputAction action){
setContextValue(action);
@@ -74,17 +75,53 @@
strategyNovember.refresh();
strategyDecember.refresh();
}
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyJanuary.setActif((Boolean)evt.getNewValue());
+ strategyFebuary.setActif((Boolean)evt.getNewValue());
+ strategyMarch.setActif((Boolean)evt.getNewValue());
+ strategyApril.setActif((Boolean)evt.getNewValue());
+ strategyMay.setActif((Boolean)evt.getNewValue());
+ strategyJune.setActif((Boolean)evt.getNewValue());
+ strategyJuly.setActif((Boolean)evt.getNewValue());
+ strategyAugust.setActif((Boolean)evt.getNewValue());
+ strategySeptember.setActif((Boolean)evt.getNewValue());
+ strategyOctober.setActif((Boolean)evt.getNewValue());
+ strategyNovember.setActif((Boolean)evt.getNewValue());
+ strategyDecember.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyJanuary.setChanged((Boolean)evt.getNewValue());
+ strategyFebuary.setChanged((Boolean)evt.getNewValue());
+ strategyMarch.setChanged((Boolean)evt.getNewValue());
+ strategyApril.setChanged((Boolean)evt.getNewValue());
+ strategyMay.setChanged((Boolean)evt.getNewValue());
+ strategyJune.setChanged((Boolean)evt.getNewValue());
+ strategyJuly.setChanged((Boolean)evt.getNewValue());
+ strategyAugust.setChanged((Boolean)evt.getNewValue());
+ strategySeptember.setChanged((Boolean)evt.getNewValue());
+ strategyOctober.setChanged((Boolean)evt.getNewValue());
+ strategyNovember.setChanged((Boolean)evt.getNewValue());
+ strategyDecember.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$strategies/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Strategy");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void setInfoText(String txt){
@@ -92,9 +129,9 @@
root.setInfoText(txt);
}
public void valueChanged(boolean b){
+ changed = b;
save.setEnabled(b);
cancel.setEnabled(b);
- changed = b;
}
]]></script>
<Table constraints='BorderLayout.CENTER'>
@@ -150,10 +187,10 @@
<Table constraints='BorderLayout.SOUTH'>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' enabled='false' text="isisfish.common.save" onActionPerformed='save()'/>
+ <JButton id='save' enabled='{isChanged()}' text="isisfish.common.save" onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' enabled='false' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
+ <JButton id='cancel' enabled='{isChanged()}' text="isisfish.common.cancel" onActionPerformed='cancel()'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -119,7 +119,6 @@
}
protected void valueChanged(boolean b){
getParentContainer(StrategyMonthInfoUI.class).valueChanged(b);
- changed = b;
}
]]></script>
<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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -147,17 +147,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$strategies/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Strategy");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$strategies/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -171,8 +169,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]></script>
<row>
@@ -260,10 +258,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
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-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -42,13 +42,30 @@
<Boolean id='changed' javaBean='false'/>
<script><![CDATA[
+ init();
public StrategyUI (InputAction action){
setContextValue(action);
}
public void refresh() {
strategyTabUI.refresh();
strategyMonthInfoUI.refresh();
- }
+ }
+ protected void init(){
+ this.addPropertyChangeListener("actif", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyTabUI.setActif((Boolean)evt.getNewValue());
+ strategyMonthInfoUI.setActif((Boolean)evt.getNewValue());
+ }
+ });
+ this.addPropertyChangeListener("changed", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ strategyTabUI.setChanged((Boolean)evt.getNewValue());
+ strategyMonthInfoUI.setChanged((Boolean)evt.getNewValue());
+ }
+ });
+ }
]]></script>
<tab title='{_("isisfish.strategy.title")}'><StrategyTabUI id='strategyTabUI' constructorParams='getContextValue(InputAction.class)'/></tab>
<tab title='{_("isisfish.strategyMonthInfo.title")}'><StrategyMonthInfoUI id='strategyMonthInfoUI' constructorParams='getContextValue(InputAction.class)'/></tab>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -71,8 +71,8 @@
}
protected void valueChanged(boolean b){
changed=b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
protected void nameChanged(){
getContextValue(InputAction.class).getTripType().setName(fieldTripTypeName.getText());
@@ -100,17 +100,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$tripTypes/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("TripType");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$tripTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -168,15 +166,15 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='create' text="isisfish.common.new" onActionPerformed='create()' enabled='{isActif()}'/>
+ <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()' enabled='{isActif()}'/>
@@ -184,7 +182,7 @@
</row>
<row>
<cell columns ='2' fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continueVesselTypes" onActionPerformed='goToVesselTypes()' enabled='{isActif()}'/>
+ <JButton text="isisfish.input.continueVesselTypes" onActionPerformed='goToVesselTypes()'/>
</cell>
</row>
</Table>
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-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -94,17 +94,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$vesselTypes/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("VesselType");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$vesselTypes/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -117,32 +115,40 @@
root.setInfoText(txt);
}
protected void valueChanged(boolean b){
+ changed = b;
+ save.setEnabled(b);
cancel.setEnabled(b);
- save.setEnabled(b);
}
protected void goToSetOfVessels(){
getParentContainer(InputUI.class).setTreeSelection("$root/$setOfVessels");
}
protected void nameChanged(){
getContextValue(InputAction.class).getVesselType().setName(fieldVesselTypeName.getText());
+ valueChanged(true);
}
protected void lenghtChanged(){
getContextValue(InputAction.class).getVesselType().setLength(Integer.parseInt(fieldVesselTypeLength.getText()));
+ valueChanged(true);
}
protected void speedChanged(){
getContextValue(InputAction.class).getVesselType().setSpeed(Double.parseDouble(fieldVesselTypeSpeed.getText()));
+ valueChanged(true);
}
protected void tripDurationChanged(){
getContextValue(InputAction.class).getVesselType().setMaxTripDuration(new TimeUnit(Double.parseDouble(fieldVesselTypeMaxTripDuration.getText())));
+ valueChanged(true);
}
protected void activityRangeChanged(){
getContextValue(InputAction.class).getVesselType().setActivityRange(Double.parseDouble(fieldVesselTypeActivityRange.getText()));
+ valueChanged(true);
}
protected void minCrewChanged(){
getContextValue(InputAction.class).getVesselType().setMinCrewSize(Integer.parseInt(fieldVesselTypeMinCrewSize.getText()));
+ valueChanged(true);
}
protected void unitFuelCostChanged(){
getContextValue(InputAction.class).getVesselType().setUnitFuelCostOfTravel(Double.parseDouble(fieldVesselTypeUnitFuelCostOfTravel.getText()));
+ valueChanged(true);
}
protected void tripTypeChanged(){
Object[] values = vesselTypeTripType.getSelectedValues();
@@ -151,9 +157,11 @@
tripTypes.add((TripType)((GenericCell)o).getValue());
}
getContextValue(InputAction.class).getVesselType().setTripType(tripTypes);
+ valueChanged(true);
}
protected void commentChanged(){
getContextValue(InputAction.class).getVesselType().setComment(fieldVesselTypeComment.getText());
+ valueChanged(true);
}
]]></script>
<Table constraints='BorderLayout.CENTER'>
@@ -244,10 +252,10 @@
<Table>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isActif()}'/>
+ <JButton id='save' text="isisfish.common.save" onActionPerformed='save()' enabled='{isChanged()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isActif()}'/>
+ <JButton id='cancel' text="isisfish.common.cancel" onActionPerformed='cancel()' enabled='{isChanged()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 15:31:49 UTC (rev 1663)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-12 16:23:58 UTC (rev 1664)
@@ -70,8 +70,7 @@
}
@Override
- public void focusLost(FocusEvent e) {
- System.out.println(changed);
+ public void focusLost(FocusEvent e) {;
if (changed){
if (!askAndSave()){
getParentContainer(InputUI.class).setTreeSelection("$root/$zones"+getContextValue(InputAction.class).getZone().getTopiaId());
@@ -103,8 +102,8 @@
return result;
}
public void refresh() {
- Zone z = getContextValue(InputAction.class).getZone();
- if (z != null){
+ if (! getContextValue(InputAction.class).isNull()){
+ Zone z = getContextValue(InputAction.class).getZone();
DefaultListModel zoneCellsModel = new DefaultListModel();
java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
for (Cell c : cells){
@@ -160,17 +159,15 @@
}
protected void save(){
TopiaEntity topia = getContextValue(InputAction.class).save();
- getParentContainer(InputUI.class).setTreeModel();
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId());
+ valueChanged(false);
+ getParentContainer(InputUI.class).repaintNode("$root/$zones/" + topia.getTopiaId());
setInfoText(_("isisfish.message.save.finished"));
refresh();
- valueChanged(false);
}
protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel("Zone");
+ TopiaEntity topia = getContextValue(InputAction.class).cancel();
valueChanged(false);
refresh();
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones/"+topia.getTopiaId());
setInfoText(_("isisfish.message.cancel.finished"));
}
protected void remove(){
@@ -192,7 +189,6 @@
protected void zoneCellsChange(){
java.util.List<Cell> cells = new ArrayList<Cell>();
for (Object o : zoneCells.getSelectedValues()){
- System.out.println("zoneCellChanged " + o);
cells.add((Cell) o);
}
getContextValue(InputAction.class).getZone().setCell(cells);
@@ -200,14 +196,13 @@
refreshMap();
}
protected void nameChange(){
- System.out.println("InputAction " + getContextValue(InputAction.class) + " getZone "+getContextValue(InputAction.class).getZone()+" fieldZoneName.getText() "+ fieldZoneName.getText());
getContextValue(InputAction.class).getZone().setName(fieldZoneName.getText());
valueChanged(true);
}
protected void valueChanged(boolean b){
changed = b;
- cancel.setEnabled(b);
save.setEnabled(b);
+ cancel.setEnabled(b);
}
]]>
</script>
@@ -219,12 +214,11 @@
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JLabel enabled='{isActif()}' text="isisfish.zone.name"/>
-
</cell>
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldZoneName" enabled='{isActif()}' onKeyTyped='valueChanged(true)'/>
+ <JTextField id="fieldZoneName" enabled='{isActif()}' onKeyTyped='nameChange()'/>
<!-- onFocusLost='nameChange()' -->
</cell>
</row>
@@ -254,10 +248,10 @@
</row>
<row>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='save' text="isisfish.common.save" enabled='{isActif()}' onActionPerformed='save()'/>
+ <JButton id='save' text="isisfish.common.save" enabled='{isChanged()}' onActionPerformed='save()'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JButton id='cancel' text="isisfish.common.cancel" enabled='{isActif()}' onActionPerformed='cancel()'/>
+ <JButton id='cancel' text="isisfish.common.cancel" enabled='{isChanged()}' onActionPerformed='cancel()'/>
</cell>
</row>
<row>
1
0
r1663 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
by chatellier@users.labs.libre-entreprise.org 12 Dec '08
12 Dec '08
Author: chatellier
Date: 2008-12-12 15:31:49 +0000 (Fri, 12 Dec 2008)
New Revision: 1663
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Fix la creation d'un repertoire vide ne contenant aucune simulation
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-12 15:27:58 UTC (rev 1662)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-12 15:31:49 UTC (rev 1663)
@@ -851,6 +851,9 @@
isisfish.simulator.launcher.remote=on remote server
isisfish.simulator.launcher.subprocess=in subprocess
isisfish.simulator.simulaction.init=Error during simulation init \: %s
+isisfish.simulator.simulaction.loadOldSimulation=Can't load old simulation \: %s
+isisfish.simulator.simulaction.regionChange=Can't change region \: %s
+isisfish.simulator.simulaction.viewlogerror=Can't view log \: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
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-12 15:27:58 UTC (rev 1662)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-12 15:31:49 UTC (rev 1663)
@@ -851,6 +851,9 @@
isisfish.simulator.launcher.remote=sur un serveur distant
isisfish.simulator.launcher.subprocess=dans un sous processus
isisfish.simulator.simulaction.init=Erreur d'initialisation de la simulation \: %s
+isisfish.simulator.simulaction.loadOldSimulation=Erreur lors du chargement d'une ancienne simulation \: %s
+isisfish.simulator.simulaction.regionChange=Erreur lors du changement de region \: %s
+isisfish.simulator.simulaction.viewlogerror=Erreur de visualisation des logs \: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
1
0