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
April 2009
- 7 participants
- 108 discussions
r2112 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by tchemit@users.labs.libre-entreprise.org 16 Apr '09
by tchemit@users.labs.libre-entreprise.org 16 Apr '09
16 Apr '09
Author: tchemit
Date: 2009-04-16 13:42:48 +0000 (Thu, 16 Apr 2009)
New Revision: 2112
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
Log:
super binding sur table...
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-04-16 13:39:50 UTC (rev 2111)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-04-16 13:42:48 UTC (rev 2112)
@@ -82,19 +82,35 @@
protected void clearDoneJobs() {
getContextValue(SimulAction.class).clearDoneJobs();
}
+
+ protected void updateActions() {
+ setCanLaunch(!selectionModelQueueTab.isSelectionEmpty());
+ setCanShowLog(!selectionModelQueueTabDone.isSelectionEmpty());
+ setCanClear(queueTableDone.getModel().getRowCount()>0);
+ }
]]>
</script>
+
+ <Boolean id='canLaunch' javaBean='false'/>
+ <Boolean id='canShowLog' javaBean='false'/>
+ <Boolean id='canClear' javaBean='false'/>
+
+ <DefaultListSelectionModel id="selectionModelQueueTab" onValueChanged='updateActions()'/>
+ <DefaultListSelectionModel id="selectionModelQueueTabDone" onValueChanged='updateActions()'/>
+
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="0.5">
<JScrollPane>
- <JTable id="queueTable" model='{getContextValue(SimulationServiceTableModel.class, "new")}' selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"/>
+ <JTable id="queueTable" model='{getContextValue(SimulationServiceTableModel.class, "new")}' selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ selectionModel="{selectionModelQueueTab}"/>
</JScrollPane>
</cell>
</row>
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="0.5">
<JScrollPane>
- <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}' selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
+ <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}' selectionMode="{ListSelectionModel.SINGLE_SELECTION}"
+ selectionModel="{selectionModelQueueTabDone}" />
</JScrollPane>
</cell>
</row>
@@ -103,13 +119,13 @@
<JToggleButton id="autoLaunchButton" text="isisfish.queue.simulationLaunch"/>
</cell>
<cell fill="horizontal" weightx="0.3">
- <JButton id="stopSimuButton" text="isisfish.queue.stopSimulation" onActionPerformed='stopSimulation()' enabled='{queueTable.getSelectionModel().getMinSelectionIndex() != -1}' />
+ <JButton id="stopSimuButton" text="isisfish.queue.stopSimulation" onActionPerformed='stopSimulation()' enabled='{isCanLaunch()}' />
</cell>
<cell fill="horizontal" weightx="0.3">
- <JButton id="showLogButton" text="isisfish.queue.showLog" onActionPerformed='viewLog()' enabled='{!queueTableDone.getSelectionModel().isSelectionEmpty()}' />
+ <JButton id="showLogButton" text="isisfish.queue.showLog" onActionPerformed='viewLog()' enabled='{isCanShowLog()}' />
</cell>
<cell fill="horizontal" weightx="0.3">
- <JButton id="clearDoneJobsButton" text="isisfish.queue.clearDone" onActionPerformed='clearDoneJobs()' enabled='{queueTableDone.getModel().getRowCount() > 0}' />
+ <JButton id="clearDoneJobsButton" text="isisfish.queue.clearDone" onActionPerformed='clearDoneJobs()' enabled='{isCanClear()}' />
</cell>
</row>
</Table>
\ No newline at end of file
1
0
r2111 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 16 Apr '09
by chatellier@users.labs.libre-entreprise.org 16 Apr '09
16 Apr '09
Author: chatellier
Date: 2009-04-16 13:39:50 +0000 (Thu, 16 Apr 2009)
New Revision: 2111
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Fix utf8 caracter
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-16 13:02:03 UTC (rev 2110)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-16 13:39:50 UTC (rev 2111)
@@ -631,7 +631,7 @@
isisfish.month.october=octobre
isisfish.month.september=septembre
isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
-isisfish.params.clearFilter=Remise \uFFFD z\u00E9ro du filtre
+isisfish.params.clearFilter=Remise \u00E0 z\u00E9ro du filtre
isisfish.params.description=Description
isisfish.params.filter=Filtrer
isisfish.params.lblLauncher=Lanceur de simulation
1
0
r2110 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 16 Apr '09
by chatellier@users.labs.libre-entreprise.org 16 Apr '09
16 Apr '09
Author: chatellier
Date: 2009-04-16 13:02:03 +0000 (Thu, 16 Apr 2009)
New Revision: 2110
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
Log:
Remove beanbindings (only use jaxx bindings)
But not work
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-15 15:10:16 UTC (rev 2109)
+++ isis-fish/trunk/pom.xml 2009-04-16 13:02:03 UTC (rev 2110)
@@ -122,13 +122,6 @@
</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>
<version>1.6.1</version>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-04-15 15:10:16 UTC (rev 2109)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-04-16 13:02:03 UTC (rev 2110)
@@ -38,46 +38,20 @@
import javax.swing.JProgressBar;
import javax.swing.ListSelectionModel;
import javax.swing.table.TableCellRenderer;
- import org.jdesktop.beansbinding.AutoBinding;
- import org.jdesktop.beansbinding.BeanProperty;
- import org.jdesktop.beansbinding.Binding;
- import org.jdesktop.beansbinding.BindingGroup;
- import org.jdesktop.beansbinding.Bindings;
- import org.jdesktop.beansbinding.ELProperty;
- initBindings();
+ // TODO this code is magic
+ // lucky executed BEFORE ui
+ initContext();
- public void initBindings() {
+ public void initContext() {
SimulationService ss = SimulationService.getService();
-
- BindingGroup bindingGroup = new BindingGroup();
-
setContextValue(new SimulationServiceTableModel(ss, true), "new");
setContextValue(new SimulationServiceTableModel(ss, false), "done");
- queueTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- queueTableDone.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
queueTable.setDefaultRenderer(JProgressBar.class, new JProgressBarTableCellRenderer());
queueTableDone.setDefaultRenderer(JProgressBar.class, new JProgressBarTableCellRenderer());
-
- Binding binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_WRITE, SimulationService.getService(), ELProperty.create("${autoLaunch}"),autoLaunchButton, BeanProperty.create("selected"));
- bindingGroup.addBinding(binding);
-
- // binding for stop simulation button
- binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ,queueTable, ELProperty.create("${selectedElement != null}"),stopSimuButton, BeanProperty.create("enabled"));
- binding.setSourceNullValue(false);
- binding.setSourceUnreadableValue(false);
- bindingGroup.addBinding(binding);
-
- // binding for view log button
- binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ, queueTableDone, ELProperty.create("${selectedElement != null}"), showLogButton, BeanProperty.create("enabled"));
- binding.setSourceNullValue(false);
- binding.setSourceUnreadableValue(false);
- bindingGroup.addBinding(binding);
-
- bindingGroup.bind();
}
- public QueueUI (SimulAction action) {
+ public QueueUI(SimulAction action) {
setContextValue(action);
}
@@ -120,7 +94,7 @@
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="0.5">
<JScrollPane>
- <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}'/>
+ <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}' selectionMode="{ListSelectionModel.SINGLE_SELECTION}" />
</JScrollPane>
</cell>
</row>
@@ -129,13 +103,13 @@
<JToggleButton id="autoLaunchButton" text="isisfish.queue.simulationLaunch"/>
</cell>
<cell fill="horizontal" weightx="0.3">
- <JButton id="stopSimuButton" text="isisfish.queue.stopSimulation" onActionPerformed='stopSimulation()'/>
+ <JButton id="stopSimuButton" text="isisfish.queue.stopSimulation" onActionPerformed='stopSimulation()' enabled='{queueTable.getSelectionModel().getMinSelectionIndex() != -1}' />
</cell>
<cell fill="horizontal" weightx="0.3">
- <JButton id="showLogButton" text="isisfish.queue.showLog" onActionPerformed='viewLog()'/>
+ <JButton id="showLogButton" text="isisfish.queue.showLog" onActionPerformed='viewLog()' enabled='{!queueTableDone.getSelectionModel().isSelectionEmpty()}' />
</cell>
<cell fill="horizontal" weightx="0.3">
- <JButton id="clearDoneJobsButton" text="isisfish.queue.clearDone" onActionPerformed='clearDoneJobs()'/>
+ <JButton id="clearDoneJobsButton" text="isisfish.queue.clearDone" onActionPerformed='clearDoneJobs()' enabled='{queueTableDone.getModel().getRowCount() > 0}' />
</cell>
</row>
</Table>
\ No newline at end of file
1
0
r2109 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 15 Apr '09
by chatellier@users.labs.libre-entreprise.org 15 Apr '09
15 Apr '09
Author: chatellier
Date: 2009-04-15 15:10:16 +0000 (Wed, 15 Apr 2009)
New Revision: 2109
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
On ne traduit pas tout ;)
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-14 17:43:35 UTC (rev 2108)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-15 15:10:16 UTC (rev 2109)
@@ -141,7 +141,7 @@
isisfish.common.tag=Tag
isisfish.common.tripType=Type de trajet
isisfish.common.value=Valeur
-isisfish.common.warn=Attention
+isisfish.common.warn=Warning
isisfish.common.year=ann\u00E9e
isisfish.common.zone=Zone
isisfish.config.main.compileDirectory.description=le r\u00E9pertoire o\u00F9 sont compil\u00E9s les scripts
1
0
r2108 - isis-fish/trunk/src/main/resources/i18n
by jcouteau@users.labs.libre-entreprise.org 14 Apr '09
by jcouteau@users.labs.libre-entreprise.org 14 Apr '09
14 Apr '09
Author: jcouteau
Date: 2009-04-14 17:43:35 +0000 (Tue, 14 Apr 2009)
New Revision: 2108
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Quick run through translations
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-14 14:50:03 UTC (rev 2107)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-14 17:43:35 UTC (rev 2108)
@@ -141,7 +141,7 @@
isisfish.common.tag=Tag
isisfish.common.tripType=Type de trajet
isisfish.common.value=Valeur
-isisfish.common.warn=Warn
+isisfish.common.warn=Attention
isisfish.common.year=ann\u00E9e
isisfish.common.zone=Zone
isisfish.config.main.compileDirectory.description=le r\u00E9pertoire o\u00F9 sont compil\u00E9s les scripts
@@ -175,14 +175,14 @@
isisfish.config.main.simulationServer.description=l'url du serveur de simulations distant
isisfish.config.main.simulationShowOnlyError.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles avec erreur
isisfish.config.main.simulationShowOnlyQueue.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles effectu\u00E9es localement
-isisfish.config.main.smtpServer.description=le nom du serveur smpt \u00E0 utiliser pour envoyer les courriels
+isisfish.config.main.smtpServer.description=le nom du serveur smtp \u00E0 utiliser pour envoyer les courriels
isisfish.config.main.subSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement dans un sous process
isisfish.config.main.userMail.description=le courriel de l'utilisateur
isisfish.config.main.userName.description=le nom - pr\u00E9nom de l'utilisateur
isisfish.config.vcs.hostName.description=le nom du serveur vcs \u00E0 utiliser
isisfish.config.vcs.keyFile.description=le chemin complet du fichier de clef priv\u00E9e ssh2 \u00E0 utiliser lors d'une connexion s\u00E9curis\u00E9e
isisfish.config.vcs.localDatabasePath.description=
-isisfish.config.vcs.noPassPhrase.description=pour indiquer si la clef priv\u00E9e ssh2 utilis\u00E9e pour communiquer avec le serveur vcs contient est prot\u00E9g\u00E9 par une passe-phrase
+isisfish.config.vcs.noPassPhrase.description=pour indiquer si la clef priv\u00E9e ssh2 utilis\u00E9e pour communiquer avec le serveur vcs est prot\u00E9g\u00E9 par une passe-phrase
isisfish.config.vcs.passphrase.description=la passe-phrase utilis\u00E9e pour prot\u00E9ger la clef priv\u00E9e ssh
isisfish.config.vcs.remoteDatabase.description=le nom du module de donn\u00E9es sur le serveur vcs
isisfish.config.vcs.remotePath.description=le chemin jusqu'au parent du module de donn\u00E9es sur le serveur vcs
@@ -206,14 +206,14 @@
isisfish.effortDescription.fishingOperationDuration=Dur\u00E9e de la p\u00EAche
isisfish.effortDescription.fixedCrewSalary=Salaire d'\u00E9quipage fixe
isisfish.effortDescription.gearsNumberPerOperation=Nombre d'engins par op\u00E9ration
-isisfish.effortDescription.landingCosts=landingCosts
+isisfish.effortDescription.landingCosts=Co\u00FBts d'accastillage
isisfish.effortDescription.otherRunningCost=Autres co\u00FBts
-isisfish.effortDescription.repairAndMaintenanceGearCost=repairAndMaintenanceGearCost
+isisfish.effortDescription.repairAndMaintenanceGearCost=Co\u00FBts de maintenance
isisfish.effortDescription.title=inputEffortDescription
isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
isisfish.effortDescription.unitCostOfFishing=Co\u00FBt unitaire de la p\u00EAche
isisfish.equation.editor.title=Editeur d'\u00E9quation
-isisfish.error.acceptable.population=New value isn't acceptable value for this population
+isisfish.error.acceptable.population=La\t nouvelle valeur n'est pas une valeur valide pour cette population
isisfish.error.add.card=Erreur lors de l'ajout du r\u00E9sultat \u00E0 la carte.
isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
isisfish.error.add.result.data=Erreur lors de l'ajout du r\u00E9sultat au data.
@@ -351,9 +351,9 @@
isisfish.error.undefined.sector=aucun secteur de d\u00E9fini
isisfish.error.undefined.stategy=aucune strat\u00E9gie de d\u00E9fini
isisfish.error.undefined.stategy.months=La strat\u00E9gie n'est pas d\u00E9finie pour certain mois
-isisfish.error.undefined.zone.population=il n'y a pas de zone de population de d\u00E9finit
-isisfish.error.undefined.zone.recruitment=il n'y a pas de zone de recrutement de d\u00E9finit
-isisfish.error.undefined.zone.reproduction=il n'y a pas de zone de reproduction de d\u00E9finit
+isisfish.error.undefined.zone.population=il n'y a pas de zone de population de d\u00E9finie
+isisfish.error.undefined.zone.recruitment=il n'y a pas de zone de recrutement de d\u00E9finie
+isisfish.error.undefined.zone.reproduction=il n'y a pas de zone de reproduction de d\u00E9finie
isisfish.error.unsupported.equation.langage=unsupported langage '%1$s' for equation\: %2$s
isisfish.error.wait.simThread=Can't wait SimThread
isisfish.error.warning.title=Attention
@@ -444,7 +444,7 @@
isisfish.gear.name=Nom
isisfish.gear.rangeValues=Range of values
isisfish.gear.standardisationFactor=Facteur de standardisation
-isisfish.gear.technicalParameter=Technical parameter
+isisfish.gear.technicalParameter=Param\u00E8tre technique
isisfish.gear.title=Engin
isisfish.graphBean.graph.render=Choisir un rendu de graphe
isisfish.graphBean.graphPanel=defaultToolTip-fr.ifremer.graph.GraphBean.graphPanel
@@ -456,10 +456,10 @@
isisfish.graphBean.table=defaultToolTip-fr.ifremer.graph.GraphBean.table2
isisfish.graphBean.table3=defaultToolTip-fr.ifremer.graph.GraphBean.table3
isisfish.graphCombo.render.bar.horizontal=Rendu en barre horizontale
-isisfish.graphCombo.render.bar.horizontal.stacked=Rendu en barre horizontale empilee
+isisfish.graphCombo.render.bar.horizontal.stacked=Rendu en barre horizontale empil\u00E9e
isisfish.graphCombo.render.bar.vertical=Rendu en barre verticale
isisfish.graphCombo.render.bar.vertical.3d=Rendu en barre verticale 3D
-isisfish.graphCombo.render.bar.vertical.stacked=Rendu en barre verticale empilee
+isisfish.graphCombo.render.bar.vertical.stacked=Rendu en barre verticale empil\u00E9e
isisfish.graphCombo.render.line=Rendu en ligne
isisfish.graphCombo.render.min.max=Rendu en MinMax
isisfish.graphCombo.render.surface=Rendu en Aire
@@ -470,14 +470,14 @@
isisfish.infoItem.sum=defaultToolTip-fr.ifremer.resultat.InfoItemDate.sumButton
isisfish.infoItem.sum.year=Somme de \u00E9l\u00E9ment par ann\u00E9e
isisfish.infoItem.table=defaultToolTip-fr.ifremer.resultat.InfoItem.table30
-isisfish.input.continueCells=Continuer vers les cells
-isisfish.input.continueGears=Continuer vers les materiaux
+isisfish.input.continueCells=Continuer vers les mailles
+isisfish.input.continueGears=Continuer vers les engins
isisfish.input.continueMetiers=Continuer vers les metiers
isisfish.input.continuePopulations=Continuer vers les populations
isisfish.input.continuePorts=Continuer vers les ports
isisfish.input.continueSetOfVessels=Continuer vers les ensembles de navires
isisfish.input.continueSpecies=Continuer vers les esp\u00E8ces
-isisfish.input.continueStrategies=Continuer vers les strategies
+isisfish.input.continueStrategies=Continuer vers les strat\u00E9gies
isisfish.input.continueTripTypes=Continuer vers les types de trajets
isisfish.input.continueVesselTypes=Continuer vers les types de navires
isisfish.input.continueZones=Continuer vers les zones
@@ -519,7 +519,7 @@
isisfish.log.closeAppender=ferme l'appender [%1$s] pour la categorie %2$s
isisfish.log.mail.failed=Impossible d'envoyer le rapport par courriel. Le serveur smtp fonctionne ? (J'essaye de contacter < %1$s > smtp server)
isisfish.log.mail.send=Un rapport a \u00E9t\u00E9 envoy\u00E9 \u00E0 %1$s
-isisfish.log.mail.send.title=Send simulation %1$s by email
+isisfish.log.mail.send.title=Envoi de la simulation %1$s par email
isisfish.log.mailTo=Adresse du destinataire
isisfish.log.removeAppender=supprime l'appender [%1$s]
isisfish.log.restoreLogLevel=repositionne le niveau du logger %1$s du niveau %2$s au niveau %3$s
@@ -532,8 +532,8 @@
isisfish.log.tooltip.sendAll=Envoyer toute la simulation, ou uniquement le fichier de log
isisfish.log.tooltip.sendMail=Cliquer pour envoyer le courriel contentant les fichiers
isisfish.message.add.objets.simulation=Ajout des nouveaux objets cr\u00E9\u00E9s durant la simulation
-isisfish.message.backup.database.finished=backup database finished
-isisfish.message.backup.database.progress=backup database in progress
+isisfish.message.backup.database.finished=backup database termin\u00E9
+isisfish.message.backup.database.progress=backup database en cours
isisfish.message.cancel.finished=Cancel finished
isisfish.message.check.finished=v\u00E9rification termin\u00E9e
isisfish.message.check.region=
@@ -602,7 +602,7 @@
isisfish.message.update.finished=Mise \u00E0 jour termin\u00E9e
isisfish.metier.comments=Commentaires
isisfish.metier.name=Nom
-isisfish.metier.rangeValues=Range of values
+isisfish.metier.rangeValues=Param\u00E8tre d'engin
isisfish.metier.title=M\u00E9tier
isisfish.metierMonitor.metiers=M\u00E9tiers
isisfish.metierMonitor.strategies=Strat\u00E9gies
@@ -631,7 +631,7 @@
isisfish.month.october=octobre
isisfish.month.september=septembre
isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
-isisfish.params.clearFilter=Reset filtre
+isisfish.params.clearFilter=Remise \uFFFD z\u00E9ro du filtre
isisfish.params.description=Description
isisfish.params.filter=Filtrer
isisfish.params.lblLauncher=Lanceur de simulation
@@ -680,7 +680,7 @@
isisfish.populationCapturability.comments=Commentaires
isisfish.populationCapturability.selectCoefficient=S\u00E9lectionnez un coefficient par saison et par classe
isisfish.populationCapturability.title=Saisie de la capturabilit\u00E9
-isisfish.populationEquation.meanWeight=Poids principal
+isisfish.populationEquation.meanWeight=Poids moyen
isisfish.populationEquation.naturalDeathRate=Taux de mortalit\u00E9 naturelle
isisfish.populationEquation.price=Prix
isisfish.populationEquation.title=Saisie des \u00E9quations
@@ -706,14 +706,14 @@
isisfish.populationMigrationMigration.arrivalZone=Zone d'arriv\u00E9e
isisfish.populationMigrationMigration.coefficient=Coefficient
isisfish.populationMigrationMigration.departureZone=Zone de d\u00E9part
-isisfish.populationMigrationMigration.title=Population migration
+isisfish.populationMigrationMigration.title=Migration de population
isisfish.populationRecruitment.comments=Commentaires
isisfish.populationRecruitment.recruitmentDistribution=Distribution du recrutement
isisfish.populationRecruitment.reproductionEquation=Equation de reproduction
-isisfish.populationRecruitment.title=Saisie des recrutements
+isisfish.populationRecruitment.title=Saisie des reproductions
isisfish.populationSeasonInfo.arrival=Arriv\u00E9e
isisfish.populationSeasonInfo.departure=D\u00E9part
-isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
+isisfish.populationSeasonInfo.distributionSpawing=Distribution de la reproduction
isisfish.populationSeasonInfo.emigration=Emigration
isisfish.populationSeasonInfo.group=Groupe
isisfish.populationSeasonInfo.immigration=Immigration
@@ -722,13 +722,13 @@
isisfish.populationSeasonInfo.toString=%1$s saison %2$s-%3$s
isisfish.populationSeasons.changeGroup=Changement de groupe
isisfish.populationSeasons.comments=Commentaires
-isisfish.populationSeasons.distributionSpawning=R\u00E9partition des apparitions
+isisfish.populationSeasons.distributionSpawning=Distribution de la reproduction
isisfish.populationSeasons.selectSeason=S\u00E9lectionnez une saison
isisfish.populationSeasons.title=Saisons
isisfish.populationZones.betweenSpawningRecruitmentAreas=Correspondance entre les zones d'apparitions et de recrutement
isisfish.populationZones.selectPopulationAreas=S\u00E9lectionnez les zones des populations
isisfish.populationZones.selectRecruitmentAreas=S\u00E9lectionnez les zones de recrutement
-isisfish.populationZones.selectSpawningAreas=S\u00E9lectionnez les zones d'apparition
+isisfish.populationZones.selectSpawningAreas=S\u00E9lectionnez les zones de reproduction
isisfish.populationZones.title=Zones
isisfish.port.cell=Maille du port
isisfish.port.comments=Commentaires
@@ -804,14 +804,14 @@
isisfish.script.evaluate=\u00C9valuer
isisfish.script.export=Exporter des scripts dans une archive zip
isisfish.script.export.cancel=annuler
-isisfish.script.export.checkAll=(de)-select tout
+isisfish.script.export.checkAll=Tout (d\u00E9-)s\u00E9lectionner
isisfish.script.export.chooseDir=...
isisfish.script.export.ok=exporter
isisfish.script.export.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts \u00E0 exporter
isisfish.script.export.tooltip.chooseDir=Choisir le r\u00E9pertoire o\u00F9 exporter les scripts
isisfish.script.import=Importer des scripts depuis une archive zip
isisfish.script.import.cancel=annuler
-isisfish.script.import.checkAll=(de)-select tout
+isisfish.script.import.checkAll=Tout (d\u00E9-)s\u00E9lectionner
isisfish.script.import.labelAdd=Le(s) fichier(s) suivant(s) sera(ont) ajout\u00E9(s), Confirmer l'ajout
isisfish.script.import.labelOverwrite=Le(s) fichier(s) suivant(s) existe(nt) d\u00E9j\u00E0, Confirmer pour l'\u00E9crasement
isisfish.script.import.ok=importer
@@ -897,7 +897,7 @@
isisfish.species.length=Longueur
isisfish.species.name=Nom des esp\u00E8ces
isisfish.species.rubbinCode=Code Rubbin
-isisfish.species.scientificName=Scientific name
+isisfish.species.scientificName=Nom scientifique
isisfish.species.structured=Structur\u00E9
isisfish.ssh.askpassphrase.message=Entrez la passphrase pour la cl\u00E9 '%s' \:
isisfish.ssh.askpassphrase.title=D\u00E9verrouillage de cl\u00E9 SSH
1
0
r2107 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
14 Apr '09
Author: chatellier
Date: 2009-04-14 14:50:03 +0000 (Tue, 14 Apr 2009)
New Revision: 2107
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/MetierSeasonInfoZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
Log:
Fix season interval bar.
Bug that happened in init. (very hard to find ;) )
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 2009-04-14 14:04:36 UTC (rev 2106)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2009-04-14 14:50:03 UTC (rev 2107)
@@ -91,7 +91,11 @@
protected void metierSeasonChanged(){
setMetierSeasonSelected(fieldMetierSeasonInfo.getSelectedItem() != null);
if (isMetierSeasonSelected()){
- setMetierInfo((MetierSeasonInfoImpl)((GenericCell)fieldMetierSeasonInfo.getSelectedItem()).getValue());
+ MetierSeasonInfoImpl msii = (MetierSeasonInfoImpl)((GenericCell)fieldMetierSeasonInfo.getSelectedItem()).getValue();
+ if (log.isDebugEnabled()) {
+ log.debug("Metier season changed : " + msii);
+ }
+ setMetierInfo(msii);
getVerifier().addCurrentEntity(getMetierInfo());
}
editor.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 2009-04-14 14:04:36 UTC (rev 2106)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2009-04-14 14:50:03 UTC (rev 2107)
@@ -54,39 +54,46 @@
protected Interval interval = null;
protected boolean init = false;
- ip.addPropertyChangeListener(new PropertyChangeListener() {
-
+ /*
+ * Don't add both in same listener.
+ * When first is set, last value from getPopulationSeasonInfo()
+ * is erased by interval.getLast() default value.
+ */
+ ip.addPropertyChangeListener("first", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (getMetierSeasonInfo() != null){
getMetierSeasonInfo().setFirstMonth(new Month(interval.getFirst()));
+ }
+ }
+ });
+ ip.addPropertyChangeListener("last", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (getMetierSeasonInfo() != null){
getMetierSeasonInfo().setLastMonth(new Month(interval.getLast()));
- if (!init){
- // getVerifier().topiaChanged();
- }
}
}
});
save.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
getVerifier().topiaSave();
setCombo();
}
});
+
create.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
getContextValue(InputAction.class).createMetierSeasonInfo(getBean());
setCombo();
}
+
});
remove.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
getContextValue(InputAction.class).removeMetierSeasonInfo(getBean(), getMetierSeasonInfo());
@@ -120,18 +127,17 @@
ip.setModel(interval);
}
}
- protected void setSeason(){
- if (getMetierSeasonInfo() != null){
-
+ protected void setSeason() {
+ if (getMetierSeasonInfo() != null) {
try {
if (log.isDebugEnabled()) {
- log.debug("************** Interval ************");
+ log.debug("Refresh interval : ");
}
Month firstMonth = getMetierSeasonInfo().getFirstMonth();
if (firstMonth != null) {
interval.setFirst(firstMonth.getMonthNumber());
if (log.isDebugEnabled()) {
- log.debug(" first : " + interval.getFirst());
+ log.debug(" first : " + interval.getFirst());
}
} else {
interval.setFirst(0);
@@ -141,7 +147,7 @@
if (lastMonth != null) {
interval.setLast(lastMonth.getMonthNumber());
if (log.isDebugEnabled()) {
- log.debug(" last : " + interval.getLast());
+ log.debug(" last : " + interval.getLast());
}
} else {
interval.setLast(3);
@@ -153,14 +159,14 @@
}
}
}
- protected void setMetierZone(){
+ protected void setMetierZone() {
if (getMetierSeasonInfo() != null){
ListSelectionListener[] listeners = metierZones.getListSelectionListeners();
- for (ListSelectionListener listener : listeners){
+ for (ListSelectionListener listener : listeners) {
metierZones.removeListSelectionListener(listener);
}
metierZones.fillList(getRegion().getZone(), getMetierSeasonInfo().getZone());
- for (ListSelectionListener listener : listeners){
+ for (ListSelectionListener listener : listeners) {
metierZones.addListSelectionListener(listener);
}
}
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 2009-04-14 14:04:36 UTC (rev 2106)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-04-14 14:50:03 UTC (rev 2107)
@@ -56,17 +56,24 @@
protected Interval interval = null;
protected boolean init = false;
-ip.addPropertyChangeListener(new PropertyChangeListener() {
-
+/*
+ * Don't add both in same listener.
+ * When first is set, last value from getPopulationSeasonInfo()
+ * is erased by interval.getLast() default value.
+ */
+ip.addPropertyChangeListener("first", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
- if (getPopulationSeasonInfo() != null){
+ if (getPopulationSeasonInfo() != null) {
getPopulationSeasonInfo().setFirstMonth(new Month(interval.getFirst()));
+ }
+ }
+});
+ip.addPropertyChangeListener("last", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (getPopulationSeasonInfo() != null) {
getPopulationSeasonInfo().setLastMonth(new Month(interval.getLast()));
-
- if (!init){
- // getVerifier().topiaChanged();
- }
}
}
});
@@ -148,15 +155,20 @@
};
fieldPopulationSeasonReproductionDistribution.addMatrixListener(listener);
}
-protected void setInterval(){
- if(getPopulationSeasonInfo() != null){
+protected void setInterval() {
+ if(getPopulationSeasonInfo() != null) {
try {
- log.debug("************** Interval ************");
+ if (log.isDebugEnabled()) {
+ log.debug("Updating interval : ");
+ }
Month firstMonth = getPopulationSeasonInfo().getFirstMonth();
if (firstMonth != null) {
interval.setFirst(firstMonth.getMonthNumber());
- log.debug(" first : " + interval.getFirst());
+
+ if (log.isDebugEnabled()) {
+ log.debug(" first : " + interval.getFirst());
+ }
} else {
interval.setFirst(0);
}
@@ -164,7 +176,9 @@
Month lastMonth = getPopulationSeasonInfo().getLastMonth();
if (lastMonth != null) {
interval.setLast(lastMonth.getMonthNumber());
- log.debug(" last : " + interval.getLast());
+ if (log.isDebugEnabled()) {
+ log.debug(" last : " + interval.getLast());
+ }
} else {
interval.setLast(3);
}
@@ -190,9 +204,13 @@
setPopulationSeasonInfo((PopulationSeasonInfoImpl)fieldPopulationSeasonInfoChooser.getSelectedItem());
getVerifier().addCurrentEntity(getPopulationSeasonInfo());
setPopSeasonInfoNotNull(getPopulationSeasonInfo() != null);
- setInterval();
- setMatrix();
- init = false;
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ setInterval();
+ setMatrix();
+ init = false;
+ }
+ });
}
protected void setMatrix(){
fieldPopulationSeasonReproductionDistribution.setMatrix(getPopulationSeasonInfo().getLengthChangeMatrix());
1
0
r2106 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
14 Apr '09
Author: chatellier
Date: 2009-04-14 14:04:36 +0000 (Tue, 14 Apr 2009)
New Revision: 2106
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
Log:
Fix compilation
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-04-14 14:04:36 UTC (rev 2106)
@@ -134,7 +134,7 @@
editor.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
} catch (IOException ex) {
if (log.isErrorEnabled()) {
- log.error("Can't refresh editor", e);
+ log.error("Can't refresh editor", ex);
}
}
if (nameEquation != null){
1
0
r2105 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . input input/check simulator widget widget/editor
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
14 Apr '09
Author: chatellier
Date: 2009-04-14 13:55:22 +0000 (Tue, 14 Apr 2009)
New Revision: 2105
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
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/InputNavigationTreeSelectionAdapter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputTabbedPaneListener.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/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/NoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/RangeOfValuesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.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/StrategyTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResult.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultFrame.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfItemSelectedInList.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfListNotEmpty.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/FormInterval.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/HidablePanel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/Interval.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalGraphic.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalLabel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalPanel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/VCSConnectionState.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java
Log:
Update code style, logger, system out, depreciations, etc ...
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Common.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,6 +1,6 @@
/* *##%
- * Copyright (C) 2006
- * Ifremer, Code Lutin, C?dric Pineau, Benjamin Poussin
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -17,56 +17,63 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
+package fr.ifremer.isisfish.ui;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.simulator.SimulationProperties;
+import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
+import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
+
+/**
* Welcome.java
*
- * Created: 22 ao?t 2006 10:50:49
+ * Created: 22 août 2006 10:50:49
*
* @author poussin
* @version $Revision: 1302 $
*
* Last update: $Date: 2008-08-18 15:42:57 +0200 (Mon, 18 Aug 2008) $
* by : $Author: bpoussin $
+ *
+ * @deprecated (since 20091414) use xxxAction class instead)
*/
-package fr.ifremer.isisfish.ui;
-
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-import fr.ifremer.isisfish.simulator.SimulationProperties;
-import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
-import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
-import java.io.IOException;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
public class Common {
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(Common.class);
+
/**
- * Return regions
+ * Return regions.
*
* @return regions
*/
- static public Object[] getRegionItem() {
+ public static Object[] getRegionItem() {
List<String> regionNames = new ArrayList<String>();
-
+
// FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
// et que le changement lance un evenement sur la liste
regionNames.add(" ");
-
+
regionNames.addAll(RegionStorage.getRegionNames());
Object[] result = regionNames.toArray();
return result;
}
-
+
/**
- * Return old simulations
+ * Return old simulations.
*
* @return old simulations
*/
- static public Object[] getOldSimulationItem() {
+ public static Object[] getOldSimulationItem() {
try {
List<String> oldSimul = new ArrayList<String>();
@@ -80,16 +87,20 @@
// we must fill filterModel result with original items
filterModel.selectAll();
Object[] result = oldSimul.toArray();
-
+
// FIXME chatellier : Ajout d'une entrée vide pour forcer la sélection
// et que le changement lance un evenement sur la liste
- oldSimul.add(0," ");
-
+ oldSimul.add(0, " ");
+
return result;
} catch (ParseException ex) {
- Logger.getLogger(Common.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Can't get old simulations", ex);
+ }
} catch (IOException ex) {
- Logger.getLogger(Common.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Can't get old simulations", ex);
+ }
}
return null;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,35 +1,57 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.ui;
-import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
import java.util.ArrayList;
import java.util.List;
+
import javax.swing.JOptionPane;
+
+import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
+
/**
+ * WelcomeSaveVerifier.
+ *
+ * @author letellier
+ * @version $Revision: 2088 $
*
- * @author letellier
+ * Last update: $Date: 2009-04-08 12:24:31 +0200 (mer. 08 avril 2009) $
+ * by : $Author: chatellier $
*/
public class WelcomeSaveVerifier {
- protected List<fr.ifremer.isisfish.ui.SaveVerifier> verifiers = new ArrayList<fr.ifremer.isisfish.ui.SaveVerifier>();
+ protected List<SaveVerifier> verifiers = new ArrayList<SaveVerifier>();
+
public void addSaveVerifier(InputSaveVerifier inputVerifier) {
verifiers.add(inputVerifier);
}
- public boolean allIsSaved(){
+ public boolean allIsSaved() {
boolean exit = true;
int responce = JOptionPane.CANCEL_OPTION;
- for (fr.ifremer.isisfish.ui.SaveVerifier s : verifiers){
+ for (fr.ifremer.isisfish.ui.SaveVerifier s : verifiers) {
responce = s.checkEdit();
}
//boolean exit = checkEdit(event, component);
- if (responce == JOptionPane.OK_OPTION){
- }
- else if (responce == JOptionPane.CANCEL_OPTION){
+ if (responce == JOptionPane.OK_OPTION) {
+ } else if (responce == JOptionPane.CANCEL_OPTION) {
exit = false;
}
return exit;
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EquationEditorPaneUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -52,9 +52,10 @@
} else {
doc.setPage(e.getURL());
}
- } catch (Exception eee) {
- log.error("Error for : " + e.getURL(),eee);
- eee.printStackTrace();
+ } catch (Exception ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Error for : " + e.getURL(), ex);
+ }
}
}
}
@@ -84,8 +85,8 @@
checkWindow.setBackground(Color.white);
}
- } catch(Exception eee){
- System.out.println("Can't check script " + eee);
+ } catch(Exception e){
+ log.error("Can't check script", e);
}
}
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2005
+ * Copyright (C) 2005 - 2009
* Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,48 +17,27 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * IsisFish.java
- *
- * Created: 1 aout 2005 18:37:25 CEST
- *
- * @author Benjamin POUSSIN <poussin at codelutin.com>
- * @version $Revision: 1312 $
- *
- * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
- * by : $Author: sletellier $
- */
package fr.ifremer.isisfish.ui.input;
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.datastore.FormuleStorage;
-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.*;
-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.beans.PropertyChangeListener;
-import java.beans.VetoableChangeListener;
-import java.util.Date;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import static javax.swing.JOptionPane.showInputDialog;
+import static org.codelutin.i18n.I18n._;
+
+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 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;
@@ -68,22 +47,58 @@
import org.codelutin.util.FileUtil;
import org.codelutin.widget.editor.Editor;
-import javax.swing.JOptionPane;
-import static javax.swing.JOptionPane.showInputDialog;
-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 fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+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.PopulationSeasonInfoDAO;
+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.SpeciesDAO;
+import fr.ifremer.isisfish.entities.TargetSpecies;
+import fr.ifremer.isisfish.entities.TargetSpeciesDAO;
+import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.types.Month;
+import fr.ifremer.isisfish.ui.input.check.CheckRegion;
+import fr.ifremer.isisfish.ui.input.check.CheckResult;
+import fr.ifremer.isisfish.ui.input.check.CheckResultFrame;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+import fr.ifremer.isisfish.util.CellPointcomparator;
-/** @author letellier */
+/**
+ * All code used in input UI.
+ *
+ * Created: 1 aout 2005 18:37:25 CEST
+ *
+ * @author Benjamin POUSSIN <poussin at codelutin.com>
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
+ */
public class InputAction {
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(InputAction.class);
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(InputAction.class);
public InputAction() {
if (log.isDebugEnabled()) {
@@ -95,7 +110,6 @@
ErrorDialogUI.showError(eee);
}
-
/**
* Exporter la region dans un zip
*
@@ -104,13 +118,16 @@
public File importRegion() {
File file = null;
try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ 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);
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't import region", e);
+ }
+ showMsgBox(e);
}
return file;
}
@@ -123,21 +140,22 @@
public File importRegionAndRename() {
File file = null;
try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ file = FileUtil.getFile(".*.zip$",
+ _("isisfish.message.import.region.zipped"));
if (file != null) {
- String newName =
- showInputDialog(_("isisfish.message.name.imported.region"));
+ String newName = showInputDialog(_("isisfish.message.name.imported.region"));
RegionStorage.importAndRenameZip(file, newName);
}
} catch (Exception eee) {
- log.error("Can't import region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't import region", eee);
+ }
showMsgBox(eee);
}
return file;
}
-
/**
* Importer la region depuis un fichier XML de la version 2
*
@@ -146,14 +164,17 @@
public File importV2Region() {
File file = null;
try {
- file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml"));
+ file = FileUtil.getFile(".*.xml$",
+ _("isisfish.message.import.region.xml"));
if (file != null) {
new ImportFromV2(true).importXML(file);
}
} catch (Exception eee) {
- log.error("Can't import region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't import region", eee);
+ }
showMsgBox(eee);
}
return file;
@@ -171,14 +192,17 @@
String simulationName;
try {
//TODO Should use a shared model ?
- simulationName = selectSimulation(SimulationStorage.getSimulationNames());
+ simulationName = selectSimulation(SimulationStorage
+ .getSimulationNames());
if (simulationName == null) {
return null;
}
} catch (Exception e) {
String msg = _("isisfish.error.no.select.simulation");
- log.warn(msg);
+ if (log.isWarnEnabled()) {
+ log.warn(msg);
+ }
e.printStackTrace();
showMsgBox(e);
return null;
@@ -189,7 +213,9 @@
}
// 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;
}
@@ -197,15 +223,17 @@
return null;
}
-
if (log.isInfoEnabled()) {
log.info("new region name " + regionName);
}
try {
- SimulationStorage.getSimulation(simulationName).extractRegion(regionName);
+ SimulationStorage.getSimulation(simulationName).extractRegion(
+ regionName);
} catch (StorageException e) {
- log.error("Can't extract region", e);
+ if (log.isErrorEnabled()) {
+ log.error("Can't extract region", e);
+ }
showMsgBox(e);
}
return regionName;
@@ -219,7 +247,8 @@
public File exportRegion(RegionStorage regionStorage) {
File file = null;
try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ file = FileUtil.getFile(".*.zip$",
+ _("isisfish.message.import.region.zipped"));
if (file != null) {
int resp = JOptionPane.YES_OPTION;
if (file.exists()) {
@@ -231,7 +260,9 @@
}
}
} catch (Exception eee) {
- log.error("Can't export region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't export region", eee);
+ }
showMsgBox(eee);
}
return file;
@@ -251,7 +282,9 @@
RegionStorage.importAndRenameZip(zip, newName);
} catch (Exception eee) {
- log.error("Can't copy region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't copy region", eee);
+ }
showMsgBox(eee);
}
return newName;
@@ -267,8 +300,8 @@
String result = null;
try {
int resp = JOptionPane.showConfirmDialog(null, _(
- "isisfish.message.confirm.remove.region",
- regionStorage.getName()));
+ "isisfish.message.confirm.remove.region", regionStorage
+ .getName()));
if (resp == JOptionPane.YES_OPTION) {
regionStorage.delete(cvsDelete);
result = _("isisfish.message.region.removed");
@@ -277,7 +310,9 @@
result = _("isisfish.message.region.remove.canceled");
}
} catch (Exception eee) {
- log.error("Can't remove region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove region", eee);
+ }
showMsgBox(eee);
}
return result;
@@ -306,7 +341,9 @@
result = _("isisfish.message.commit.region.canceled");
}
} catch (Exception eee) {
- log.error("Can't export region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't export region", eee);
+ }
showMsgBox(eee);
}
return result;
@@ -319,11 +356,13 @@
* <p/>
* tree ans
*
+ * @param ui TODO
* @param name name of region
+ * @return loaded region
*/
public FisheryRegion loadRegion(jaxx.runtime.JAXXObject ui, String name) {
- if (log.isTraceEnabled()) {
- log.trace("loadRegion called");
+ if (log.isDebugEnabled()) {
+ log.debug("loadRegion : " + name);
}
try {
RegionStorage regionStorage = null;
@@ -343,7 +382,9 @@
}
return null;
} catch (Exception eee) {
- log.error("Can't load region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't load region", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -361,14 +402,16 @@
}
try {
if ("".equals(name)) {
-// showMsgBox("error " + _("isisfish.error.region.name.empty"));
+ // showMsgBox("error " + _("isisfish.error.region.name.empty"));
}
if (RegionStorage.getRegionNames().contains(name)) {
-// showMsgBox("Error " + _("isisfish.error.region.already.exists"));
+ // showMsgBox("Error " + _("isisfish.error.region.already.exists"));
}
RegionStorage.create(name);
} catch (Exception eee) {
- log.error("Can't create region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create region", eee);
+ }
showMsgBox(eee);
}
}
@@ -381,7 +424,6 @@
* nom de l'entite et pas du package.
* @return null ou un fenetre d'erreur
*/
- @SuppressWarnings("unchecked")
public TopiaEntity create(TopiaContext isisContext, String type) {
if (log.isTraceEnabled()) {
log.trace("create called for " + type);
@@ -394,7 +436,8 @@
Method method = MethodUtils.getAccessibleMethod(
IsisFishDAOHelper.class, "get" + type + "DAO",
TopiaContext.class);
- TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, isisContext);
+ TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(
+ null, isisContext);
TopiaEntity entity = dao.create("name", name);
entity.update();
@@ -402,7 +445,9 @@
return entity;
} catch (Exception eee) {
- log.error("Can't create entity", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create entity", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -419,7 +464,9 @@
}
try {
if (selected == null) {
- log.warn("Try to save null entity");
+ if (log.isWarnEnabled()) {
+ log.warn("Try to save null entity");
+ }
return null;
}
// on est pas en autoUpdate donc il faut faire le update avant le
@@ -428,7 +475,9 @@
selected.getTopiaContext().commitTransaction();
} catch (Exception eee) {
- log.error("Can't save region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't save region", eee);
+ }
showMsgBox(eee);
}
return selected;
@@ -449,11 +498,15 @@
isisContext.rollbackTransaction();
// reload the object
- if (selected != null) {
- selected = isisContext.findByTopiaId(selected.getTopiaId());
+ // can't be null here, or allready null before !!!
+ //if (selected != null) {
+ // FIXME don't modify parameters
+ selected = isisContext.findByTopiaId(selected.getTopiaId());
+ //}
+ } catch (Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't cancel modification in region", eee);
}
- } catch (Exception eee) {
- log.error("Can't cancel modification in region", eee);
showMsgBox(eee);
}
return selected;
@@ -477,20 +530,22 @@
boolean doDelete;
List<TopiaEntity> allWillBeRemoved = selected.getComposite();
if (allWillBeRemoved.size() > 0) {
- String text = _(
- "isisfish.message.delete.object",
- selected.toString());
+ 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);
+ _("isisfish.message.delete.entities"),
+ JOptionPane.YES_NO_OPTION);
doDelete = resp == JOptionPane.YES_OPTION;
} else {
- String text = _("isisfish.message.confirm.delete.object", selected.toString());
+ String text = _("isisfish.message.confirm.delete.object",
+ selected.toString());
int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
+ _("isisfish.message.delete.entity"),
+ JOptionPane.YES_NO_OPTION);
doDelete = resp == JOptionPane.YES_OPTION;
}
@@ -502,7 +557,9 @@
msg = _("isisfish.message.remove.canceled");
}
} catch (Exception eee) {
- log.error("Can't remove entity: " + selected, eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove entity: " + selected, eee);
+ }
showMsgBox(eee);
}
return msg;
@@ -518,9 +575,9 @@
try {
if (eq != null) {
String name = showInputDialog("");
- if ("".equals(name)) {
-// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
- }
+ /*if ("".equals(name)) {
+ showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
+ }*/
if (name != null) {
FormuleStorage storage = FormuleStorage.createFormule(eq
.getCategory(), name, eq.getLanguage());
@@ -528,7 +585,9 @@
}
}
} catch (Exception eee) {
- log.error("Can't save equation as model", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't save equation as model", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -545,23 +604,26 @@
public Object saveAsModel(String category, String language, String content) {
try {
String name = showInputDialog("isisfish.message.saveModel.dialog");
- if ("".equals(name)) {
-// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
- }
+ /*if ("".equals(name)) {
+ showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
+ }*/
if (name != null) {
- FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
+ FormuleStorage storage = FormuleStorage.createFormule(category,
+ name, language);
storage.setContent(content);
}
} catch (Exception eee) {
- log.error("Can't save equation as model", eee);
+ if (log.isErrorEnabled()) {
+ 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) {
+ public Object openEditor(String category, String name, Class javaInterface,
+ String content, Editor editor) {
if (log.isTraceEnabled()) {
log.trace("openEditor");
}
@@ -574,7 +636,9 @@
}
pane.dispose();
} catch (Exception eee) {
- log.error("Can't open editor", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't open editor", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -584,12 +648,13 @@
return FormuleStorage.getFormules(isisContext, name);
}
-// InputGear
+ // InputGear
public Object addSelectivity(Population pop, String equation, Gear gear) {
try {
- SelectivityDAO dao = IsisFishDAOHelper.getSelectivityDAO(pop.getTopiaContext());
+ SelectivityDAO dao = IsisFishDAOHelper.getSelectivityDAO(pop
+ .getTopiaContext());
Selectivity selectivity = dao.create();
selectivity.setGear(gear);
@@ -601,7 +666,9 @@
gear.update();
} catch (Exception eee) {
- log.error("Can't add selectivity", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't add selectivity", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -622,24 +689,27 @@
return null;
}
-// InputMetier
+ // InputMetier
public Object createSeasonInfo(Metier metier) {
if (log.isTraceEnabled()) {
log.trace("createSeasonInfo called");
}
try {
- MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper.getMetierSeasonInfoDAO(metier.getTopiaContext());
+ MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper
+ .getMetierSeasonInfoDAO(metier.getTopiaContext());
MetierSeasonInfo metierSeasonInfo = metierSeasonInfoPS.create();
metierSeasonInfo.setFirstMonth(Month.MONTH[0]);
metierSeasonInfo.setLastMonth(Month.MONTH[3]);
metier.addMetierSeasonInfo(metierSeasonInfo);
metierSeasonInfo.update();
metier.update();
-// isisContext.commitTransaction();
+ // isisContext.commitTransaction();
} catch (Exception eee) {
- log.error("Can't create MetierSeasonInfo", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create MetierSeasonInfo", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -654,33 +724,44 @@
metier.update();
metier.getTopiaContext().commitTransaction();
} catch (Exception eee) {
- log.error("Can't create MetierSeasonInfo", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create MetierSeasonInfo", eee);
+ }
showMsgBox(eee);
}
return null;
}
- public Object addTargetSpecies(Metier metier, MetierSeasonInfo m, Species species, String targetFactorEquationName, String targetFactorEquationContent, boolean primaryCatch) {
+ public Object addTargetSpecies(Metier metier, MetierSeasonInfo m,
+ Species species, String targetFactorEquationName,
+ String targetFactorEquationContent, boolean primaryCatch) {
if (log.isDebugEnabled()) {
- log.debug("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquationContent);
+ log.debug("addTargetSpecies called: " + metier + " " + species
+ + " " + primaryCatch + " " + targetFactorEquationContent);
}
try {
- TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(metier.getTopiaContext());
+ TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(metier
+ .getTopiaContext());
TargetSpecies targetSpecies = dao.create();
targetSpecies.setSpecies(species);
- targetSpecies.getTargetFactorEquation().setName(targetFactorEquationName);
- targetSpecies.getTargetFactorEquation().setContent(targetFactorEquationContent);
+ targetSpecies.getTargetFactorEquation().setName(
+ targetFactorEquationName);
+ targetSpecies.getTargetFactorEquation().setContent(
+ targetFactorEquationContent);
targetSpecies.setPrimaryCatch(primaryCatch);
m.addSpeciesTargetSpecies(targetSpecies);
} catch (Exception eee) {
- log.error("Can't add TargetSpecies", eee);
+ if (log.isErrorEnabled()) {
+ 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.isDebugEnabled()) {
log.debug("removeTargetSpecies called: " + targetSpecies);
}
@@ -689,32 +770,39 @@
m.removeSpeciesTargetSpecies(targetSpecies);
}
} catch (Exception eee) {
- log.error("Can't remove TargetSpecies", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove TargetSpecies", eee);
+ }
showMsgBox(eee);
}
return null;
}
-// SetOfVessels
+ // SetOfVessels
public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
if (log.isDebugEnabled()) {
- log.debug("addEffortDescription called: " + setOfVessels + " metier: " + metier);
+ log.debug("addEffortDescription called: " + setOfVessels
+ + " metier: " + metier);
}
try {
- EffortDescriptionDAO effortDescriptionPS = IsisFishDAOHelper.getEffortDescriptionDAO(metier.getTopiaContext());
+ EffortDescriptionDAO effortDescriptionPS = IsisFishDAOHelper
+ .getEffortDescriptionDAO(metier.getTopiaContext());
EffortDescription effortDescription = effortDescriptionPS.create();
effortDescription.setPossibleMetiers(metier);
effortDescription.update();
setOfVessels.addPossibleMetiers(effortDescription);
setOfVessels.update();
} catch (Exception eee) {
- log.error("Can't create EffortDescription", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create EffortDescription", eee);
+ }
showMsgBox(eee);
}
}
- public Object removeEffortDescription(SetOfVessels sov, EffortDescription effort) {
+ public Object removeEffortDescription(SetOfVessels sov,
+ EffortDescription effort) {
if (log.isTraceEnabled()) {
log.trace("remove called");
}
@@ -722,34 +810,39 @@
sov.removePossibleMetiers(effort);
sov.getTopiaContext().commitTransaction();
} catch (Exception eee) {
- log.error("Can't remove entity: " + effort, eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove entity: " + effort, eee);
+ }
showMsgBox(eee);
}
return null;
}
-// Population
- public Species getSpeciesByTopiaId(TopiaContext context, String topiaId){
+ // Population
+ public Species getSpeciesByTopiaId(TopiaContext context, String topiaId) {
Species result = null;
try {
SpeciesDAO dao = IsisFishDAOHelper.getSpeciesDAO(context);
result = dao.findByTopiaId(topiaId);
- } catch (TopiaException ex) {
- Logger.getLogger(InputAction.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (TopiaException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get species", e);
+ }
}
return result;
}
+
public Population createPopulation(TopiaContext context, Species species) {
if (log.isTraceEnabled()) {
log.trace("create called");
}
try {
String name = "Population_new";
-
+
PopulationDAO dao = IsisFishDAOHelper.getPopulationDAO(context);
Population pop = dao.create();
pop.setName(name);
-
+
species.addPopulation(pop);
pop.setSpecies(species);
species.update();
@@ -757,16 +850,21 @@
context.commitTransaction();
return pop;
} catch (Exception eee) {
- log.error("Can't create Population", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create Population", eee);
+ }
showMsgBox(eee);
}
return null;
}
public void createPopulationSeasonInfo(Population pop) {
- log.debug("createSeasonInfo called");
+ if (log.isDebugEnabled()) {
+ log.debug("createSeasonInfo called");
+ }
try {
- PopulationSeasonInfoDAO dao = IsisFishDAOHelper.getPopulationSeasonInfoDAO(pop.getTopiaContext());
+ PopulationSeasonInfoDAO dao = IsisFishDAOHelper
+ .getPopulationSeasonInfoDAO(pop.getTopiaContext());
PopulationSeasonInfo seasonInfo = dao.create();
seasonInfo.setFirstMonth(Month.MONTH[0]);
seasonInfo.setLastMonth(Month.MONTH[3]);
@@ -774,51 +872,62 @@
seasonInfo.setPopulation(pop);
seasonInfo.update();
pop.update();
-// isisContext.commitTransaction();
+ // isisContext.commitTransaction();
} catch (Exception eee) {
- log.error("Can't create PopulationSeasonInfo", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create PopulationSeasonInfo", eee);
+ }
showMsgBox(eee);
}
}
- public void removePopulationSeasonInfo(Population pop, PopulationSeasonInfo populationSeasonInfo) {
- log.debug("removeSeasonInfo called");
+ public void removePopulationSeasonInfo(Population pop,
+ PopulationSeasonInfo populationSeasonInfo) {
+ if (log.isDebugEnabled()) {
+ log.debug("removeSeasonInfo called");
+ }
try {
pop.removePopulationSeasonInfo(populationSeasonInfo);
pop.update();
pop.getTopiaContext().commitTransaction();
} catch (Exception eee) {
- log.error("Can't remove PopulationSeasonInfo", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove PopulationSeasonInfo", eee);
+ }
showMsgBox(eee);
}
}
- public void createMetierSeasonInfo(Metier metier){
- log.debug("createSeasonInfo called");
+ public void createMetierSeasonInfo(Metier metier) {
+ if (log.isDebugEnabled()) {
+ log.debug("createSeasonInfo called");
+ }
try {
- MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper.getMetierSeasonInfoDAO(metier.getTopiaContext());
+ MetierSeasonInfoDAO metierSeasonInfoPS = IsisFishDAOHelper
+ .getMetierSeasonInfoDAO(metier.getTopiaContext());
MetierSeasonInfo metierSeasonInfo = metierSeasonInfoPS.create();
metierSeasonInfo.setFirstMonth(Month.MONTH[0]);
metierSeasonInfo.setLastMonth(Month.MONTH[3]);
metier.addMetierSeasonInfo(metierSeasonInfo);
metierSeasonInfo.update();
metier.update();
-// isisContext.commitTransaction();
-
- }catch(Exception eee){
+ // isisContext.commitTransaction();
+ } catch (Exception eee) {
log.error("Can't create MetierSeasonInfo", eee);
showMsgBox(eee);
}
}
- public void removeMetierSeasonInfo(Metier metier, MetierSeasonInfo info){
- log.debug("createSeasonInfo called");
+ public void removeMetierSeasonInfo(Metier metier, MetierSeasonInfo info) {
+ if (log.isDebugEnabled()) {
+ log.debug("createSeasonInfo called");
+ }
try {
metier.removeMetierSeasonInfo(info);
metier.update();
metier.getTopiaContext().commitTransaction();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create MetierSeasonInfo", eee);
showMsgBox(eee);
}
@@ -829,7 +938,8 @@
log.trace("createRecruitmentDistributionontext called: " + pop);
}
try {
- String val = JOptionPane.showInputDialog(_("isisfish.message.recruitment.number.month"));
+ String val = JOptionPane
+ .showInputDialog(_("isisfish.message.recruitment.number.month"));
int num = -1;
if (val != null && !"".equals(val)) {
try {
@@ -846,7 +956,8 @@
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 = pop.getRecruitmentDistribution();
if (mat != null) {
@@ -856,15 +967,18 @@
pop.update();
}
} catch (Exception eee) {
- log.error("Can't remove PopulationSeasonInfo", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove PopulationSeasonInfo", eee);
+ }
showMsgBox(eee);
}
return null;
}
-// Migration
+ // Migration
- public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
+ public Object addMigration(PopulationSeasonInfo info,
+ PopulationGroup group, Zone departure, Zone arrival, double coeff) {
if (log.isTraceEnabled()) {
log.trace("addMigration called");
}
@@ -874,14 +988,16 @@
info.setMigrationMatrix(mat);
} catch (Exception eee) {
- log.error("Can't add migration", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't add migration", eee);
+ }
showMsgBox(eee);
}
return null;
}
-
- public Object addEmigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, double coeff) {
+ public Object addEmigration(PopulationSeasonInfo info,
+ PopulationGroup group, Zone departure, double coeff) {
if (log.isTraceEnabled()) {
log.trace("addEmigration called");
}
@@ -891,13 +1007,16 @@
info.setEmigrationMatrix(mat);
} catch (Exception eee) {
- log.error("Can't add emigration", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't add emigration", eee);
+ }
showMsgBox(eee);
}
return null;
}
- public Object addImmigration(PopulationSeasonInfo info, PopulationGroup group, Zone arrival, double coeff) {
+ public Object addImmigration(PopulationSeasonInfo info,
+ PopulationGroup group, Zone arrival, double coeff) {
if (log.isTraceEnabled()) {
log.trace("addImmigration called");
}
@@ -907,7 +1026,9 @@
info.setImmigrationMatrix(mat);
} catch (Exception eee) {
- log.error("Can't add immigration", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't add immigration", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -930,7 +1051,8 @@
srcMap = srcMap.substring(0, srcMap.length() - ".shp".length());
File ssx = new File(srcMap + ".ssx");
- RegionStorage regionStorage = RegionStorage.getRegion(fisheryRegion.getName());
+ RegionStorage regionStorage = RegionStorage
+ .getRegion(fisheryRegion.getName());
File destDir = regionStorage.getMapRepository();
// copy shp file
@@ -942,7 +1064,9 @@
if (ssx.exists()) {
FileUtil.copy(ssx, destSsx);
} else {
- log.info("Ssx file don't exist, try to generate it");
+ if (log.isInfoEnabled()) {
+ log.info("Ssx file don't exist, try to generate it");
+ }
}
List<String> maps = fisheryRegion.getMapFileList();
@@ -950,7 +1074,9 @@
fisheryRegion.setMapFileList(maps);
}
} catch (Exception eee) {
- log.error("Can't copy .shp or .ssx file for: " + shp, eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't copy .shp or .ssx file for: " + shp, eee);
+ }
showMsgBox(eee);
}
return null;
@@ -968,7 +1094,8 @@
List<String> maps = fisheryRegion.getMapFileList();
- RegionStorage regionStorage = RegionStorage.getRegion(fisheryRegion.getName());
+ RegionStorage regionStorage = RegionStorage.getRegion(fisheryRegion
+ .getName());
File mapDir = regionStorage.getMapRepository();
for (Object map : selectedMaps) {
@@ -983,7 +1110,9 @@
fisheryRegion.setMapFileList(maps);
} catch (Exception eee) {
- log.error("Can't remove map", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove map", eee);
+ }
showMsgBox(eee);
}
return null;
@@ -1010,12 +1139,18 @@
try {
TopiaContext isisContext = fisheryRegion.getTopiaContext();
-// frame.setInfoText(_("isisfish.message.checking.cell"));
- int latNumber = (int) Math.round((fisheryRegion.getMaxLatitude() - fisheryRegion.getMinLatitude()) / fisheryRegion.getCellLengthLatitude());
- int lonNumber = (int) Math.round((fisheryRegion.getMaxLongitude() - fisheryRegion.getMinLongitude()) / fisheryRegion.getCellLengthLongitude());
+ // frame.setInfoText(_("isisfish.message.checking.cell"));
+ int latNumber = (int) Math
+ .round((fisheryRegion.getMaxLatitude() - fisheryRegion
+ .getMinLatitude())
+ / fisheryRegion.getCellLengthLatitude());
+ int lonNumber = (int) Math
+ .round((fisheryRegion.getMaxLongitude() - fisheryRegion
+ .getMinLongitude())
+ / fisheryRegion.getCellLengthLongitude());
-// frame.setProgressMin(0);
-// frame.setProgressMax(latNumber * lonNumber);
+ // frame.setProgressMin(0);
+ // frame.setProgressMax(latNumber * lonNumber);
int progresscpt = 0;
// il faut peut-etre creer ou supprimer des mailles
@@ -1025,13 +1160,18 @@
Collections.sort(cells, cellPointcomparator);
Point2D.Float point = new Point2D.Float();
- for (float lati = fisheryRegion.getMinLatitude(); lati < fisheryRegion.getMaxLatitude(); lati += fisheryRegion.getCellLengthLatitude()) {
+ 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()) {
+ 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);
+ int position = Collections.binarySearch(cells, point,
+ cellPointcomparator);
if (position >= 0) {
// deja existant on l'enleve de la liste, et on ne cree rien
cells.remove(position);
@@ -1044,7 +1184,7 @@
cell.setLand(false);
cell.update();
}
-// frame.setProgressValue(++progresscpt);
+ // frame.setProgressValue(++progresscpt);
}
}
@@ -1065,7 +1205,9 @@
}
isisContext.commitTransaction();
} catch (Exception eee) {
- log.error(_("isisfish.error.save.region"), eee);
+ if (log.isErrorEnabled()) {
+ log.error(_("isisfish.error.save.region"), eee);
+ }
showMsgBox(eee);
}
}
@@ -1075,17 +1217,18 @@
if (log.isTraceEnabled()) {
log.trace("check called: ");
}
-// frame.setInfoText(_("isisfish.message.check.region"));
+ // frame.setInfoText(_("isisfish.message.check.region"));
CheckResult result = new CheckResult();
CheckRegion.check(fisheryRegion, result);
CheckResultFrame dialog = new CheckResultFrame();
dialog.setCheckResult(result);
dialog.setVisible(true);
} catch (Exception eee) {
- log.error(_("isisfish.error.check.region"), eee);
+ if (log.isErrorEnabled()) {
+ log.error(_("isisfish.error.check.region"), eee);
+ }
showMsgBox(eee);
}
return null;
}
-
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,10 +1,45 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.ui.input;
+import java.awt.Component;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTree;
+import javax.swing.event.TreeSelectionEvent;
+
+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.NavigationTreeModelBuilder;
+import jaxx.runtime.swing.navigation.NavigationTreeSelectionAdapterWithCardLayout;
+import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder.ChildBuilder;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.persistence.TopiaEntity;
+
import fr.ifremer.isisfish.entities.Cell;
import fr.ifremer.isisfish.entities.FisheryRegion;
import fr.ifremer.isisfish.entities.Gear;
@@ -16,32 +51,20 @@
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 org.hibernate.transaction.JOTMTransactionManagerLookup;
-
-/** @author letellier */
+/**
+ * InputNavigationTreeSelectionAdapter.
+ *
+ * @author letellier
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
+ */
public class InputNavigationTreeSelectionAdapter extends NavigationTreeSelectionAdapterWithCardLayout {
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
+ /** Class logger. */
+ private static final Log log = LogFactory.getLog(InputNavigationTreeSelectionAdapter.class);
protected NavigationTreeNode currentNode = null;
protected InputContentUI currentUI = null;
@@ -77,7 +100,7 @@
@Override
protected void goBackToPreviousNode(TreeSelectionEvent event, Exception e) {
if (e != null) {
-// ErrorDialogUI.showError(e);
+ // FIXME add logger here ?
e.printStackTrace();
}
// go back to previous node
@@ -99,7 +122,9 @@
context.getContextValue(InputSaveVerifier.class).addCurrentPanel(currentUI);
currentNode = node;
} catch (Exception e) {
- log.debug(e.getMessage(), e);
+ if (log.isErrorEnabled()) {
+ log.error("Can't open ui", e);
+ }
}
}
@@ -110,17 +135,17 @@
InputSaveVerifier verif = context.getContextValue(InputSaveVerifier.class);
int responce = verif.checkEdit();
//boolean exit = checkEdit(event, component);
- if (responce == JOptionPane.OK_OPTION){
+ if (responce == JOptionPane.OK_OPTION) {
JTree tree = (JTree) event.getSource();
NavigationTreeModel model = (NavigationTreeModel) tree.getModel();
if (currentNode != null) {
model.nodeChanged(currentNode);
}
}
- else if (responce == JOptionPane.CANCEL_OPTION){
+ else if (responce == JOptionPane.CANCEL_OPTION) {
exit = false;
}
- if (exit){
+ if (exit) {
verif.removeAllPanels();
}
return exit;
@@ -234,9 +259,10 @@
true, fr.ifremer.isisfish.entities.Strategy.class, fisheryRegion.getStrategy(), StrategyUI.class, null);
} catch (Exception ex) {
- log.error(ex.getMessage(), ex);
+ if (log.isErrorEnabled()) {
+ log.error(ex.getMessage(), ex);
+ }
}
return builder.getModel();
}
-
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -48,8 +48,6 @@
import fr.ifremer.isisfish.entities.Formule;
import fr.ifremer.isisfish.entities.Equation;
import fr.ifremer.isisfish.entities.EquationImpl;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import java.lang.reflect.Method;
import org.apache.commons.beanutils.MethodUtils;
import org.codelutin.topia.persistence.TopiaEntity;
@@ -135,7 +133,9 @@
try {
editor.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
} catch (IOException ex) {
- Logger.getLogger(InputOneEquationUI.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Can't refresh editor", e);
+ }
}
if (nameEquation != null){
setComboModel();
@@ -168,12 +168,12 @@
setComboModel();
setInfoText(_("isisfish.message.saveModel.finished"));
}
-protected void openEditor(){
+protected void openEditor() {
Formule e = (Formule)combo.getSelectedItem();
- if (e != null){
- getContextValue(InputAction.class).openEditor(e.getCategory(), e.getName(), clazz, e.getContent(), editor);
+ if (e != null) {
+ getContextValue(InputAction.class).openEditor(e.getCategory(), e.getName(), clazz, e.getContent(), editor);
}
- else{
+ else {
getContextValue(InputAction.class).openEditor(nameEquation, "new", clazz, editor.getText(), editor);
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputTabbedPaneListener.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputTabbedPaneListener.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputTabbedPaneListener.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,30 +1,55 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.ui.input;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
+ * InputTabbedPaneListener.
*
* @author letellier
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
*/
-public class InputTabbedPaneListener implements ChangeListener{
+public class InputTabbedPaneListener implements ChangeListener {
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(InputTabbedPaneListener.class);
+
protected int cacheSelectedIndex = -1;
-
+
@Override
public void stateChanged(ChangeEvent e) {
try {
- JTabbedPane pane = (JTabbedPane)e.getSource();
+ JTabbedPane pane = (JTabbedPane) e.getSource();
pane.removeChangeListener(this);
int selectedIndex = pane.getSelectedIndex();
- if (cacheSelectedIndex != -1){
+ if (cacheSelectedIndex != -1) {
pane.setSelectedIndex(cacheSelectedIndex);
}
InputContentUI ui = (InputContentUI) pane.getSelectedComponent();
@@ -36,22 +61,25 @@
cacheSelectedIndex = pane.getSelectedIndex();
pane.addChangeListener(this);
} catch (Exception ex) {
- Logger.getLogger(MetierUI.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Can't refresh", ex);
+ }
}
}
- /*
+ /**
* Ask you to save if modification are made
- * @param ui selected
+ * @param context
* @return true to change tab
*/
protected boolean closeUI(InputContentUI context) throws Exception {
boolean exit = true;
// by default, we says that component was succesfull closed
- InputSaveVerifier verif = context.getContextValue(InputSaveVerifier.class);
+ InputSaveVerifier verif = context
+ .getContextValue(InputSaveVerifier.class);
int responce = verif.checkEdit();
//boolean exit = checkEdit(event, component);
- if (responce == JOptionPane.CANCEL_OPTION){
+ if (responce == JOptionPane.CANCEL_OPTION) {
exit = false;
}
return exit;
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -97,20 +97,23 @@
protected DefaultComboBoxModel getFieldCurrentRegionModel(){
return new DefaultComboBoxModel(Common.getRegionItem());
}
-protected void regionChange() {
- final String name = fieldCurrentRegion.getSelectedItem().toString();
- if (log.isDebugEnabled()) {
- log.debug("Region change, selected : " + name);
+protected void regionChange(ItemEvent e) {
+ // event launched twice with itemchange listener
+ if (e.getStateChange() == ItemEvent.SELECTED) {
+ final String name = fieldCurrentRegion.getSelectedItem().toString();
+ if (log.isDebugEnabled()) {
+ log.debug("Region change, selected : " + name);
+ }
+ setInfoText(_("isisfish.message.loading.region", name));
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ loadRegion(name);
+ getVerifier().setIsisContext(getContextValue(TopiaContext.class));
+ setInfoText(_("isisfish.message.load.finished"));
+ setTreeModel();
+ }
+ });
}
- setInfoText(_("isisfish.message.loading.region", name));
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- loadRegion(name);
- getVerifier().setIsisContext(getContextValue(TopiaContext.class));
- setInfoText(_("isisfish.message.load.finished"));
- setTreeModel();
- }
- });
}
protected void loadRegion(String name) {
if (log.isDebugEnabled()) {
@@ -249,7 +252,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldCurrentRegion" model='{getFieldCurrentRegionModel()}' onItemStateChanged='regionChange()'/>
+ <JComboBox id="fieldCurrentRegion" model='{getFieldCurrentRegionModel()}' onItemStateChanged='regionChange(event)' />
</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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -124,11 +124,15 @@
if (getMetierSeasonInfo() != null){
try {
- log.debug("************** Interval ************");
+ if (log.isDebugEnabled()) {
+ log.debug("************** Interval ************");
+ }
Month firstMonth = getMetierSeasonInfo().getFirstMonth();
if (firstMonth != null) {
interval.setFirst(firstMonth.getMonthNumber());
- log.debug(" first : " + interval.getFirst());
+ if (log.isDebugEnabled()) {
+ log.debug(" first : " + interval.getFirst());
+ }
} else {
interval.setFirst(0);
}
@@ -136,13 +140,16 @@
Month lastMonth = getMetierSeasonInfo().getLastMonth();
if (lastMonth != null) {
interval.setLast(lastMonth.getMonthNumber());
- log.debug(" last : " + interval.getLast());
+ if (log.isDebugEnabled()) {
+ log.debug(" last : " + interval.getLast());
+ }
} else {
interval.setLast(3);
}
} catch (Exception e) {
- log.error("Unexpected origin.", e);
- // Only trace the error and go on.
+ if (log.isErrorEnabled()) {
+ log.error("Can't display season", e);
+ }
}
}
}
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,7 +1,6 @@
<!--
/* *##%
- * Copyright (C) 2005
- * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -19,7 +18,7 @@
*##%*/
/* *
- * IsisFish.java
+ * MetierTabUI.
*
* Created: 1 aout 2005 18:37:25 CEST
*
@@ -57,13 +56,16 @@
jaxx.runtime.SwingUtil.fillComboBox(fieldMetierGear, getRegion().getGear(), getBean().getGear(),true);
init = false;
}
- } catch (Exception ex) {
- Logger.getLogger(MetierTabUI.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't refresh", e);
+ }
}
}
protected void gearChanged(){
- if (!init)
+ if (!init) {
getBean().setGear((Gear)fieldMetierGear.getSelectedItem());
+ }
}
]]></script>
<Table id='bady'>
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,8 +1,6 @@
-
<!--
/* *##%
- * Copyright (C) 2005
- * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -20,7 +18,7 @@
*##%*/
/* *
- * IsisFish.java
+ * MetierUI.
*
* Created: 1 aout 2005 18:37:25 CEST
*
@@ -57,7 +55,7 @@
]]></script>
<JPanel id='body' layout='{new BorderLayout()}'>
<JTabbedPane id="metierTab" name="Metier" constraints='BorderLayout.CENTER' >
- <tab title='{_("isisfish.metier.title")}'><MetierTabUI id="metierTabUI" constructorParams='this'/></tab>
+ <tab title='{_("isisfish.metier.title")}'><MetierTabUI id="metierTabUI" constructorParams='this'/></tab>
<tab title='{_("isisfish.metierSeasonInfoZone.title")}'><MetierSeasonInfoZoneUI id="metierSeasonInfoUI" constructorParams='this'/></tab>
<tab title='{_("isisfish.metierSeasonInfoSpecies.title")}'><MetierSeasonInfoSpeciesUI id="metierSeasonSpeciesUI" constructorParams='this'/></tab>
</JTabbedPane>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,3 +1,34 @@
+<!--
+/* *##%
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/**
+ * NoneUI.
+ *
+ * Created: 1 aout 2005 18:37:25 CEST
+ *
+ * @author Benjamin POUSSIN <poussin at codelutin.com>
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
+ */
+ -->
<JPanel layout='{new BorderLayout()}'>
<JLabel id='none' horizontalAlignment="0" text="isisfish.input.selectRegion" constraints='BorderLayout.CENTER'/>
</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,34 +1,21 @@
/* *##%
-* Copyright (C) 2005
-* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
-/* *
-* OpenMapEvents.java
-*
-* Created: 5 septembre 2005 03:21:41 CEST
-*
-* @author Benjamin POUSSIN <poussin at codelutin.com>
-* @version $Revision: 202 $
-*
-* Last update: $Date: 2006-06-30 18:39:09 +0200 (ven, 30 jun 2006) $
-* by : $Author: bpoussin $
-*/
-
package fr.ifremer.isisfish.ui.input;
import java.awt.event.MouseEvent;
@@ -37,23 +24,30 @@
import org.apache.commons.logging.LogFactory;
import com.bbn.openmap.Layer;
-import com.bbn.openmap.event.DistanceMouseMode;
import com.bbn.openmap.event.MapMouseListener;
import com.bbn.openmap.event.MapMouseMode;
-import com.bbn.openmap.event.NullMouseMode;
import com.bbn.openmap.event.ProjectionEvent;
import com.bbn.openmap.event.SelectMouseMode;
import fr.ifremer.isisfish.map.IsisMapBean;
+/**
+ * OpenMapEvents.java
+ *
+ * Created: 5 septembre 2005 03:21:41 CEST
+ *
+ * @author Benjamin POUSSIN <poussin at codelutin.com>
+ * @version $Revision: 202 $
+ *
+ * Last update: $Date: 2006-06-30 18:39:09 +0200 (ven, 30 jun 2006) $
+ * by : $Author: bpoussin $
+ */
public abstract class OpenMapEvents extends Layer implements MapMouseListener { // OpenMapEvents
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = -8365120112075269288L;
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(OpenMapEvents.class);
- public OpenMapEvents (IsisMapBean map, MapMouseMode mouseMode, int selectMode){
+ public OpenMapEvents(IsisMapBean map, MapMouseMode mouseMode, int selectMode) {
super();
this.mouseMode = mouseMode;
this.map = map;
@@ -63,188 +57,187 @@
map.addMapMouseListener(this);
}
- public void projectionChanged(ProjectionEvent e){
+
+ public void projectionChanged(ProjectionEvent e) {
// do nothing, it's not reel layer
}
/**
- * SelectMouseMode property: Null, Distance, Nav, Select
- */
+ * SelectMouseMode property: Null, Distance, Nav, Select
+ */
protected MapMouseMode mouseMode = null;
protected IsisMapBean map = null;
protected int selectMode = 1;
/**
- * OnMouseDragged property.
- */
+ * OnMouseDragged property.
+ */
protected String onMouseDragged = null;
/**
- * Get onMouseDragged property.
- *
- *@return OnMouseDragged property.
- */
+ * Get onMouseDragged property.
+ *
+ * @return OnMouseDragged property.
+ */
public String getOnMouseDragged() {
return this.onMouseDragged;
}
/**
- * Set onMouseDragged property.
- *
- *@param onMouseDragged New onMouseDragged property.
- */
+ * Set onMouseDragged property.
+ *
+ * @param onMouseDragged New onMouseDragged property.
+ */
public void setOnMouseDragged(String onMouseDragged) {
this.onMouseDragged = onMouseDragged;
}
/**
- * OnMouseEntered property.
- */
+ * OnMouseEntered property.
+ */
protected String onMouseEntered = null;
/**
- * Get onMouseEntered property.
- *
- *@return OnMouseEntered property.
- */
+ * Get onMouseEntered property.
+ *
+ * @return OnMouseEntered property.
+ */
public String getOnMouseEntered() {
return this.onMouseEntered;
}
/**
- * Set onMouseEntered property.
- *
- *@param onMouseEntered New onMouseEntered property.
- */
+ * Set onMouseEntered property.
+ *
+ * @param onMouseEntered New onMouseEntered property.
+ */
public void setOnMouseEntered(String onMouseEntered) {
this.onMouseEntered = onMouseEntered;
}
/**
- * OnMouseExited property.
- */
+ * OnMouseExited property.
+ */
protected String onMouseExited = null;
/**
- * Get onMouseExited property.
- *
- *@return OnMouseExited property.
- */
+ * Get onMouseExited property.
+ *
+ * @return OnMouseExited property.
+ */
public String getOnMouseExited() {
return this.onMouseExited;
}
/**
- * Set onMouseExited property.
- *
- *@param onMouseExited New onMouseExited property.
- */
+ * Set onMouseExited property.
+ *
+ * @param onMouseExited New onMouseExited property.
+ */
public void setOnMouseExited(String onMouseExited) {
this.onMouseExited = onMouseExited;
}
/**
- * OnMouseMoved property.
- */
+ * OnMouseMoved property.
+ */
protected String onMouseMoved = null;
/**
- * Get onMouseMoved property.
- *
- *@return OnMouseMoved property.
- */
+ * Get onMouseMoved property.
+ *
+ * @return OnMouseMoved property.
+ */
public String getOnMouseMoved() {
return this.onMouseMoved;
}
/**
- * Set onMouseMoved property.
- *
- *@param onMouseMoved New onMouseMoved property.
- */
+ * Set onMouseMoved property.
+ *
+ * @param onMouseMoved New onMouseMoved property.
+ */
public void setOnMouseMoved(String onMouseMoved) {
this.onMouseMoved = onMouseMoved;
}
/**
- * OnMousePressed property.
- */
+ * OnMousePressed property.
+ */
protected String onMousePressed = null;
/**
- * Get onMousePressed property.
- *
- *@return OnMousePressed property.
- */
+ * Get onMousePressed property.
+ *
+ * @return OnMousePressed property.
+ */
public String getOnMousePressed() {
return this.onMousePressed;
}
/**
- * Set onMousePressed property.
- *
- *@param onMousePressed New onMousePressed property.
- */
+ * Set onMousePressed property.
+ *
+ * @param onMousePressed New onMousePressed property.
+ */
public void setOnMousePressed(String onMousePressed) {
this.onMousePressed = onMousePressed;
}
/**
- * OnMouseReleased property.
- */
+ * OnMouseReleased property.
+ */
protected String onMouseReleased = null;
/**
- * Get onMouseReleased property.
- *
- *@return OnMouseReleased property.
- */
+ * Get onMouseReleased property.
+ *
+ * @return OnMouseReleased property.
+ */
public String getOnMouseReleased() {
return this.onMouseReleased;
}
/**
- * Set onMouseReleased property.
- *
- *@param onMouseReleased New onMouseReleased property.
- */
+ * Set onMouseReleased property.
+ *
+ * @param onMouseReleased New onMouseReleased property.
+ */
public void setOnMouseReleased(String onMouseReleased) {
this.onMouseReleased = onMouseReleased;
}
public String[] getMouseModeServiceList() {
- return new String[] {
- SelectMouseMode.modeID
- };
+ return new String[] { SelectMouseMode.modeID };
}
- public boolean mouseClicked(MouseEvent e){
+ public boolean mouseClicked(MouseEvent e) {
onMouseClicked();
return true;
}
- public boolean mouseDragged(MouseEvent e){
+ public boolean mouseDragged(MouseEvent e) {
return false;
}
- public void mouseEntered(MouseEvent e){
+ public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
- public void mouseMoved(){
+ public void mouseMoved() {
}
- public boolean mouseMoved(MouseEvent e){
+ public boolean mouseMoved(MouseEvent e) {
return false;
}
- public boolean mousePressed(MouseEvent e){
+ public boolean mousePressed(MouseEvent e) {
return false;
}
- public boolean mouseReleased(MouseEvent e){
+ public boolean mouseReleased(MouseEvent e) {
return false;
}
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -169,14 +169,15 @@
interval.setLast(3);
}
} catch (Exception e) {
- log.error("Unexpected origin.", e);
- // Only trace the error and go on.
+ if (log.isErrorEnabled()) {
+ log.error("Can't display interval", e);
+ }
}
}
}
protected void setCombo(){
if (getBean() != null){
- jaxx.runtime.SwingUtil.fillComboBox(fieldPopulationSeasonInfoChooser,getBean().getPopulationSeasonInfo(), getPopulationSeasonInfo(), true);
+ jaxx.runtime.SwingUtil.fillComboBox(fieldPopulationSeasonInfoChooser,getBean().getPopulationSeasonInfo(), getBean().getPopulationSeasonInfo(), true);
}
}
protected void seasonGroupChanged(){
@@ -184,7 +185,7 @@
getPopulationSeasonInfo().setGroupChange(fieldPopulationSeasonGroupChange.isSelected());
}
}
-protected void seasonChanged(){
+protected void seasonChanged(ActionEvent event) {
init = true;
setPopulationSeasonInfo((PopulationSeasonInfoImpl)fieldPopulationSeasonInfoChooser.getSelectedItem());
getVerifier().addCurrentEntity(getPopulationSeasonInfo());
@@ -208,7 +209,7 @@
</cell>
<cell fill='horizontal' weightx='1.0'>
<JComboBox id="fieldPopulationSeasonInfoChooser"
- onActionPerformed='seasonChanged()'
+ onActionPerformed='seasonChanged(event)'
enabled='{isActif()}'/>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/RangeOfValuesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/RangeOfValuesUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/RangeOfValuesUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -23,24 +23,26 @@
});
boolean init = false;
-public void refresh(){
+public void refresh() {
Gear gear = getVerifier().getEntity(Gear.class);
setBean((GearImpl) gear);
java.util.List<Object> values = new ArrayList<Object>();
- for (String value : fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes())
+ for (String value : fr.ifremer.isisfish.types.RangeOfValues.getPossibleTypes()) {
values.add(value);
- if (getBean() != null){
- if (values != null){
+ }
+ if (getBean() != null) {
+ if (values != null) {
init = true;
jaxx.runtime.SwingUtil.fillComboBox(fieldGearParamType, values, getBean().getPossibleValue() == null ? null : getBean().getPossibleValue().getType(), true);
init = false;
}
}
}
-protected void paramChanged(){
- if (fieldGearParamType.getSelectedItem() != null){
- if (!init)
+protected void paramChanged() {
+ if (fieldGearParamType.getSelectedItem() != null) {
+ if (!init) {
getBean().setPossibleValue(new RangeOfValues(fieldGearParamType.getSelectedItem().toString().concat("[" + fieldGearParamPossibleValue.getText() + "]")));
+ }
}
}
]]></script>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -107,12 +107,12 @@
remove.setEnabled(false);
}
-protected void setSelectivityTableModel(){
- DefaultTableModel model = new DefaultTableModel(){
+protected void setSelectivityTableModel() {
+ DefaultTableModel model = new DefaultTableModel() {
@Override
public boolean isCellEditable(int row, int column) {
boolean result = false;
- if (column > 0){
+ if (column > 0) {
result =true;
}
return result;
@@ -121,8 +121,8 @@
Collection<Selectivity> selectivity = getBean().getPopulationSelectivity();
java.util.List<Population> populations = new ArrayList<Population>();
java.util.List<Equation> equations = new ArrayList<Equation>();
- if (selectivity != null){
- for (Selectivity s : selectivity){
+ if (selectivity != null) {
+ for (Selectivity s : selectivity) {
populations.add(s.getPopulation());
equations.add(s.getEquation());
}
@@ -134,20 +134,20 @@
EquationTableEditor cellEditor = new EquationTableEditor();
selectivityTable.getColumnModel().getColumn(1).setCellEditor(cellEditor);
}
-protected void add(){
+protected void add() {
getAction().addSelectivity((Population)getPopulation(), selectivityEquation.getEditor().getText(), getBean());
setSelectivityTableModel();
}
-protected void remove(){
+protected void remove() {
getAction().removeSelectivity(getBean(), (Selectivity) getBean().getPopulationSelectivity((Population) selectivityTable.getValueAt(selectivityTable.getSelectedRow(), 0)));
setSelectivityTableModel();
}
protected DefaultComboBoxModel getSelectivityPopulationModel(){
java.util.List<Species> species = getRegion().getSpecies();
DefaultComboBoxModel selectivityPopulationModel = new DefaultComboBoxModel();
- if (species != null){
+ if (species != null) {
selectivityPopulationModel.addElement(new GenericCell(" ", null, null));
- for (Species s : species){
+ for (Species s : species) {
if (s.getPopulation() != null){
for (Population p : s.getPopulation()){
selectivityPopulationModel.addElement(new GenericCell(p.getName(), p, Population.class));
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -69,7 +69,7 @@
getVerifier().setDeleteButton(remove);
SetOfVessels setOfVessels = (SetOfVessels)getVerifier().getEntity(SetOfVessels.class);
setBean((SetOfVesselsImpl) setOfVessels);
- if (getBean() != null){
+ if (getBean() != null) {
init = true;
jaxx.runtime.SwingUtil.fillComboBox(fieldSetOfVesselsPort,getRegion().getPort(), getBean().getPort(), true);
jaxx.runtime.SwingUtil.fillComboBox(fieldSetOfVesselsVesselType,getRegion().getVesselType(), getBean().getVesselType(), true);
@@ -78,12 +78,14 @@
}
}
protected void portChanged(){
- if (!init)
+ if (!init) {
getBean().setPort((Port)fieldSetOfVesselsPort.getSelectedItem());
+ }
}
protected void vesselTypeChanged(){
- if (!init)
+ if (!init) {
getBean().setVesselType((VesselType)fieldSetOfVesselsVesselType.getSelectedItem());
+ }
}
]]>
</script>
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 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -76,12 +76,12 @@
setSetOfVesselsModel();
}
}
-protected void setSetOfVesselsModel(){
+protected void setSetOfVesselsModel() {
ActionListener[] listeners = fieldStrategySetOfVessels.getActionListeners();
for (ActionListener listener : listeners){
fieldStrategySetOfVessels.removeActionListener(listener);
}
- jaxx.runtime.SwingUtil.fillComboBox(fieldStrategySetOfVessels,getRegion().getSetOfVessels(), getBean().getSetOfVessels(), true);
+ jaxx.runtime.SwingUtil.fillComboBox(fieldStrategySetOfVessels,getRegion().getSetOfVessels(), getBean().getSetOfVessels(), true);
for (ActionListener listener : listeners){
fieldStrategySetOfVessels.addActionListener(listener);
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -229,8 +229,10 @@
next.setEnabled(false);
finish.setEnabled(true);
}
- protected void finish(){
- log.debug("wizardGroupFinish called");
+ protected void finish() {
+ if (log.isDebugEnabled()) {
+ log.debug("wizardGroupFinish called");
+ }
try {
// remove all old group
@@ -326,9 +328,12 @@
}
popBasic.refresh();
cancel();
- }catch(Exception eee){
- log.error("Can't create PopulationGroup", eee);
}
+ catch(Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't create PopulationGroup", e);
+ }
+ }
}
protected void cancel(){
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
-* Copyright (C) 2002, 2003 Code Lutin
+* Copyright (C) 2002 - 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Static public License
@@ -16,20 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
-* CheckSaisie.java
-*
-* Created: 9 janv. 2004
-*
-* @author Benjamin Poussin <poussin at codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-
package fr.ifremer.isisfish.ui.input.check;
import static org.codelutin.i18n.I18n._;
@@ -66,6 +52,18 @@
import fr.ifremer.isisfish.types.Month;
import fr.ifremer.isisfish.util.EvaluatorHelper;
+/**
+ * CheckSaisie.java
+ *
+ * Created: 9 janv. 2004
+ *
+ * @author Benjamin Poussin <poussin at codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
public class CheckRegion { // CheckSaisie
/*
// check equation compilation
@@ -345,7 +343,7 @@
result.addWarning(region, _("isisfish.error.empty.name"));
}
- List<Zone> secteurs = region.getZone();;
+ List<Zone> secteurs = region.getZone();
if(secteurs.size() == 0){
result.addWarning(region, _("isisfish.error.undefined.sector"));
}else{
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResult.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResult.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResult.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
-* Copyright (C) 2002, 2003 Code Lutin
+* Copyright (C) 2002 - 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,19 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
-* CheckResult.java
-*
-* Created: 9 janv. 2004
-*
-* @author Benjamin Poussin <poussin at codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
+
package fr.ifremer.isisfish.ui.input.check;
import java.util.LinkedHashSet;
@@ -37,8 +26,17 @@
import java.util.LinkedList;
/**
-* Classe permettant de créer le résultat d'une vérification de la bonne saisie des objets
-*/
+ * Classe permettant de créer le résultat d'une vérification de la bonne saisie des objets.
+ *
+ * Created: 9 janv. 2004
+ *
+ * @author Benjamin Poussin <poussin at codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
public class CheckResult { // CheckResult
LinkedHashSet order = new LinkedHashSet();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultFrame.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultFrame.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultFrame.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002, 2003 Code Lutin
+ * Copyright (C) 2002 - 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,8 +16,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * CheckResultFrame.java
+package fr.ifremer.isisfish.ui.input.check;
+
+import static org.codelutin.i18n.I18n._;
+
+import javax.swing.JFrame;
+import javax.swing.WindowConstants;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+
+/**
+ * CheckResultFrame.
*
* Created: 10 janv. 2004
*
@@ -28,25 +37,19 @@
* Mise a jour: $Date$
* par : $Author$
*/
-
-package fr.ifremer.isisfish.ui.input.check;
-
-import static org.codelutin.i18n.I18n._;
-
-import javax.swing.JFrame;
-import javax.swing.WindowConstants;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-
public class CheckResultFrame extends JFrame { // CheckResultFrame
- CheckResultTableModel model;
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -3425876562425941700L;
+
+ protected CheckResultTableModel model;
- public CheckResultFrame(CheckResult checkResult){
+ public CheckResultFrame(CheckResult checkResult) {
this();
setCheckResult(checkResult);
}
- public CheckResultFrame(){
+ public CheckResultFrame() {
super(_("isisfish.message.result.verif.region"));
model = new CheckResultTableModel(new CheckResult());
JTable table = new JTable(model);
@@ -59,7 +62,7 @@
this.getContentPane().add(new JScrollPane(table));
}
- public void setCheckResult(CheckResult checkResult){
+ public void setCheckResult(CheckResult checkResult) {
model.setCheckResult(checkResult);
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableModel.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableModel.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002, 2003 Code Lutin
+ * Copyright (C) 2002 - 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,8 +16,27 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * CheckResultTableModel.java
+package fr.ifremer.isisfish.ui.input.check;
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JTable;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableColumnModel;
+
+import org.codelutin.topia.persistence.TopiaEntity;
+import org.codelutin.topia.persistence.TopiaId;
+
+/**
+ * CheckResultTableModel.
*
* Created: 10 janv. 2004
*
@@ -28,91 +47,73 @@
* Mise a jour: $Date$
* par : $Author$
*/
+public class CheckResultTableModel extends AbstractTableModel implements
+ Comparator { // CheckResultTableModel
-package fr.ifremer.isisfish.ui.input.check;
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 328398134761266970L;
-import javax.swing.table.AbstractTableModel;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.awt.Component;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.JTable;
-import java.awt.Color;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import javax.swing.table.TableColumnModel;
-import java.util.Comparator;
-import java.util.TreeSet;
-import javax.swing.table.JTableHeader;
+ protected CheckResult checkResult;
+ protected ArrayList data;
+ protected int sortedBy = -1;
+ protected boolean ascending = true;
-import org.codelutin.topia.persistence.TopiaEntity;
-import org.codelutin.topia.persistence.TopiaId;
-
-import java.util.Collections;
-
-public class CheckResultTableModel extends AbstractTableModel implements Comparator { // CheckResultTableModel
-
- CheckResult checkResult;
- ArrayList data;
- int sortedBy = -1;
- boolean ascending = true;
-
- public CheckResultTableModel(CheckResult checkResult){
+ public CheckResultTableModel(CheckResult checkResult) {
setCheckResult(checkResult);
}
- public void setCheckResult(CheckResult checkResult){
+ public void setCheckResult(CheckResult checkResult) {
this.checkResult = checkResult;
computeData();
}
- protected void computeData(){
+ protected void computeData() {
data = new ArrayList();
- for(Iterator i=checkResult.order.iterator(); i.hasNext();){
- TopiaEntity o = (TopiaEntity)i.next();
+ for (Iterator i = checkResult.order.iterator(); i.hasNext();) {
+ TopiaEntity o = (TopiaEntity) i.next();
String type = TopiaId.getClassNameAsString(o.getTopiaId());
- addOneData(o, type, "error", (List)checkResult.error.get(o), data);
- addOneData(o, type, "warning", (List)checkResult.warning.get(o), data);
- addOneData(o, type, "info", (List)checkResult.info.get(o), data);
+ addOneData(o, type, "error", (List) checkResult.error.get(o), data);
+ addOneData(o, type, "warning", (List) checkResult.warning.get(o),
+ data);
+ addOneData(o, type, "info", (List) checkResult.info.get(o), data);
}
fireTableDataChanged();
}
- protected void addOneData(Object o, String type, String level, List list, Collection result){
- if(list != null && list.size() != 0){
- for(Iterator m=list.iterator(); m.hasNext();){
+ protected void addOneData(Object o, String type, String level, List list,
+ Collection result) {
+ if (list != null && list.size() != 0) {
+ for (Iterator m = list.iterator(); m.hasNext();) {
Object message = m.next();
- result.add(new Object[]{type, o, level, message});
+ result.add(new Object[] { type, o, level, message });
}
}
}
- String [] titles = new String[]{"Class", "Object", "Level", "Message"};
- public String getColumnName(int column){
+ String[] titles = new String[] { "Class", "Object", "Level", "Message" };
+
+ public String getColumnName(int column) {
return titles[column];
}
- public int getRowCount(){
+ public int getRowCount() {
return data.size();
}
- public int getColumnCount(){
+ public int getColumnCount() {
return 4;
}
- public Object getValueAt(int row, int column){
- Object [] rowData = (Object[])data.get(row);
+ public Object getValueAt(int row, int column) {
+ Object[] rowData = (Object[]) data.get(row);
return rowData[column];
}
- public void setSortedBy(int column){
- if(column == sortedBy){
+ public void setSortedBy(int column) {
+ if (column == sortedBy) {
ascending = !ascending;
- }else{
+ } else {
sortedBy = column;
ascending = true;
}
@@ -120,12 +121,13 @@
fireTableDataChanged();
}
- public int compare(Object o1, Object o2){
- Object [] data1 = (Object[])o1;
- Object [] data2 = (Object[])o2;
+ public int compare(Object o1, Object o2) {
+ Object[] data1 = (Object[]) o1;
+ Object[] data2 = (Object[]) o2;
- int result = data1[sortedBy].toString().compareTo(data2[sortedBy].toString());
- return ascending?result:-result;
+ int result = data1[sortedBy].toString().compareTo(
+ data2[sortedBy].toString());
+ return ascending ? result : -result;
}
public void addMouseListenerToHeaderInTable(final JTable table) {
@@ -145,4 +147,3 @@
}
} // CheckResultTableModel
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableRenderer.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckResultTableRenderer.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002, 2003 Code Lutin
+ * Copyright (C) 2002 - 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,7 +16,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
+package fr.ifremer.isisfish.ui.input.check;
+
+import javax.swing.table.DefaultTableCellRenderer;
+import java.awt.Component;
+import javax.swing.JTable;
+import java.awt.Color;
+
+/**
* CheckResultTableRenderer.java
*
* Created: 10 janv. 2004
@@ -28,27 +35,24 @@
* Mise a jour: $Date$
* par : $Author$
*/
+public class CheckResultTableRenderer extends DefaultTableCellRenderer { // CheckResultTableRenderer
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8015604773747460458L;
-package fr.ifremer.isisfish.ui.input.check;
-
-import javax.swing.table.DefaultTableCellRenderer;
-import java.awt.Component;
-import javax.swing.JTable;
-import java.awt.Color;
-
-public class CheckResultTableRenderer extends DefaultTableCellRenderer { // CheckResultTableRenderer
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column){
- super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
- if(!isSelected){
- if("error".equals(table.getValueAt(row, 2))){
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+ super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
+ row, column);
+ if (!isSelected) {
+ if ("error".equals(table.getValueAt(row, 2))) {
setBackground(Color.red);
- }else if("warning".equals(table.getValueAt(row, 2))){
+ } else if ("warning".equals(table.getValueAt(row, 2))) {
setBackground(Color.orange);
- }else if("info".equals(table.getValueAt(row, 2))){
+ } else if ("info".equals(table.getValueAt(row, 2))) {
setBackground(Color.cyan);
}
}
return this;
}
} // CheckResultTableRenderer
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/AdvancedParamsUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -42,7 +42,6 @@
import javax.swing.table.DefaultTableModel;
import java.util.Map.Entry;
-
tableTagValue.addMouseListener(new MouseListener() {
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -50,8 +50,6 @@
import org.codelutin.math.matrix.gui.JAXXMatrixEditor;
import javax.swing.table.DefaultTableModel;
import java.text.ParseException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import java.awt.event.ItemEvent;
import javax.swing.table.TableModel;
import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
@@ -87,9 +85,9 @@
}
public ParamsUI(SimulAction action){
-
setContextValue(action);
}
+
public void refresh(){
SimulationService.getService().removeSimulationServiceListener(simulationListener);
SimulationService.getService().addSimulationServiceListener(simulationListener);
@@ -112,7 +110,7 @@
}
}
}
-protected void regionChange(ItemEvent e){
+protected void regionChange(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
// le premier item est " " pour ne pas avoir de selection par defaut
final String selected = fieldSimulParamsRegion.getSelectedItem().toString();
@@ -139,8 +137,10 @@
getParentContainer(SensitivityUI.class).getSensitivityTabUI().setRegion((FisheryRegionImpl) getContextValue(SimulAction.class).getSimulationParameter().getRegion().getFisheryRegion());
getParentContainer(SensitivityUI.class).getSensitivityTabUI().setTreeModel();
} catch (StorageException ex) {
- log.debug(ex.getMessage(), ex);
- };
+ if (log.isErrorEnabled()) {
+ log.debug("Cant reload factors", ex);
+ }
+ }
}
}
protected void setFactor(){
@@ -341,9 +341,13 @@
getContextValue(SimulAction.class).setOldSimulatorNames(fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.filterSimulation(getContextValue(SimulAction.class).getOldSimulationItem()));
refresh();
} catch (ParseException ex) {
- Logger.getLogger(ParamsUI.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Can't select simulation filter", ex);
+ }
} catch (IOException ex) {
- Logger.getLogger(ParamsUI.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Can't select simulation filter", ex);
+ }
}
}
protected ComboBoxModel getSimulParamsSelectModel() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/PreScriptsUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,7 +1,6 @@
<!--
/* *##%
- * Copyright (C) 2005
- * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -18,8 +17,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * IsisFish.java
+/**
+ * PreScriptUI.
*
* Created: 1 aout 2005 18:37:25 CEST
*
@@ -32,16 +31,19 @@
-->
<JPanel id="simulPreScripts" layout='{new BorderLayout()}'>
<script><![CDATA[
- public PreScriptsUI (SimulAction action){
-
+ public PreScriptsUI(SimulAction action) {
setContextValue(action);
}
- public void refresh(){
- }
- protected void save(){
+
+ protected void save() {
getContextValue(SimulAction.class).getSimulationParameter().setPreScript(fieldSimulPreScript.getText());
}
- protected void backParameter(){
+
+ protected void refresh() {
+
+ }
+
+ protected void backParameter() {
SimulUI simul = getParentContainer(SimulUI.class);
simul.selTab(0);
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -131,7 +131,9 @@
}
public void init() {
- log.debug("Init ");
+ if (log.isDebugEnabled()) {
+ log.debug("Init ");
+ }
try {
param = new SimulationParameter();
List<String> resultNames = getResultNames();
@@ -198,7 +200,9 @@
showMsgBox(e);
} finally {
try {
- fos.close();
+ if (fos != null) {
+ fos.close();
+ }
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("Can't save simulation", e);
@@ -227,8 +231,8 @@
} catch (Exception eee) {
if (log.isWarnEnabled()) {
log.warn("Can't find result name script", eee);
- showMsgBox(eee);
}
+ showMsgBox(eee);
}
return result;
}
@@ -282,7 +286,9 @@
* @param simulName name of simulation to load
*/
public void loadOldSimulation(String simulName) {
- log.debug("call loadOldSimulation: " + simulName);
+ if (log.isDebugEnabled()) {
+ log.debug("call loadOldSimulation: " + simulName);
+ }
try {
this.simulName = simulName;
simulStorage = SimulationStorage.getSimulation(simulName);
@@ -302,11 +308,15 @@
// Chargement des facteurs
File f = simulStorage.getMexicoDesignPlan(SimulationStorage.getSimulationDirectory(simulName));
if (f != null){
- log.debug("Import design plan from : " + f.getPath());
+ if (log.isDebugEnabled()) {
+ log.debug("Import design plan from : " + f.getPath());
+ }
designPlan = MexicoHelper.getDesignPlanFromXML(f.getPath());
factors.clear();
- for (Factor factor : designPlan.getFactors()){
- log.debug("Find factor : " + factor.getName());
+ for (Factor factor : designPlan.getFactors()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Find factor : " + factor.getName());
+ }
factors.put(factor.getPath() + factor.getName(), factor);
}
}
@@ -503,8 +513,6 @@
* Return old simulations.
*
* @return old simulations
- *
- * @deprecated use fr.ifremer.isisfish.ui.Common.getOldSimulationItem()
*/
public List<String> getOldSimulationItem() {
@@ -923,8 +931,9 @@
f.setDomain(domain);
f.setComment(comment);
f.setPath(path + domain.getVariableName());
- if (exist)
+ if (exist) {
removeFactor(f);
+ }
addFactor(f, c);
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -42,6 +42,8 @@
* TODO ce code depuis le xml...
*
* @author chemit
+ *
+ * @deprecated since 20090414, use jaxx bindings instead
*/
public class SimulatorListeners {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfItemSelectedInList.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfItemSelectedInList.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfItemSelectedInList.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,3 +1,21 @@
+/* *##%
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.widget;
import javax.swing.event.ListSelectionListener;
@@ -6,7 +24,9 @@
import javax.swing.JList;
import javax.swing.JButton;
-/** Enable a button if the associated list is not empty */
+/**
+ * Enable a button if the associated list is not empty.
+ */
public class EnabledIfItemSelectedInList implements ListSelectionListener {
private final JComponent button;
private final JList list;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfListNotEmpty.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfListNotEmpty.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfListNotEmpty.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,3 +1,21 @@
+/* *##%
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.widget;
import javax.swing.JButton;
@@ -6,7 +24,9 @@
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
-/** Enable a button if the associated list is not empty */
+/**
+ * Enable a button if the associated list is not empty.
+ */
public class EnabledIfListNotEmpty implements ListDataListener {
private JComponent target;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/ErrorDialogUI.jaxx 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,10 +1,42 @@
+<!--
+/* *##%
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/**
+ * ErrorDialogUI.java
+ *
+ * @author letellier
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
+ */
+-->
+
<JDialog title='isisfish.error.dialog.title'>
<script>
-/** le dialogue pour afficher les erreurs */
+/** Le dialogue pour afficher les erreurs. */
protected static ErrorDialogUI instance;
public static void showError(Exception e) {
- if (instance == null) { instance = new ErrorDialogUI(); }
+ if (instance == null) {
+ instance = new ErrorDialogUI();
+ }
instance.getErrorMessage().setText(e.getMessage());
StringWriter w = new StringWriter();
e.printStackTrace(new PrintWriter(w));
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/FormInterval.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/FormInterval.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/FormInterval.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,7 +1,20 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* *##%
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.ui.widget;
@@ -10,30 +23,26 @@
import java.awt.event.WindowEvent;
/**
-* La classe de test
-*/
-
-
-
-public class FormInterval extends Frame{
- /** */
+ * FormInterval.
+ */
+public class FormInterval extends Frame {
+
+ /** serialVersionUID. */
private static final long serialVersionUID = 4911081593147906648L;
- /**
- */
- class Quitter extends WindowAdapter{
- public void windowClosing(WindowEvent e){
- e.getWindow().dispose();}
+ class QuitListener extends WindowAdapter {
+ public void windowClosing(WindowEvent e) {
+ e.getWindow().dispose();
+ }
}
- public FormInterval(Interval i){
+ public FormInterval(Interval i) {
IntervalPanel ip = new IntervalPanel();
this.add(ip);
// ip.setEnabled(false);
ip.setModel(i);
- this.addWindowListener(new Quitter());
+ this.addWindowListener(new QuitListener());
pack();
}
}
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/HidablePanel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/HidablePanel.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/HidablePanel.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,9 +17,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * HidablePanel.java
- *
+package fr.ifremer.isisfish.ui.widget;
+
+import javax.swing.JPanel;
+
+/**
+ * HidablePanel.
+ *
* Created: 7 mars 2006 22:48:25
*
* @author poussin
@@ -27,25 +31,12 @@
*
* Last update: $Date$
* by : $Author$
- */
-
-package fr.ifremer.isisfish.ui.widget;
-
-import javax.swing.JPanel;
-
-
-/**
- * @author poussin
*
+ * @deprecated since 20090414 seams to be unused
*/
-
public class HidablePanel extends JPanel {
- /**
- *
- */
- private static final long serialVersionUID = 4153300672681154582L;
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4153300672681154582L;
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/Interval.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/Interval.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/Interval.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
-/**##%%
- * Copyright (C) 2002, 2003 Code Lutin
+/* ##%%
+ * Copyright (C) 2002 - 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,19 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%%**/
-/**
- * Interval.java
- *
- * Created: Wed Oct 4 2000
- *
- * @author POUSSIN Benjamin <bpoussin at free.fr>
- * Copyright COGITEC
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-
package fr.ifremer.isisfish.ui.widget;
import java.io.Serializable;
@@ -40,12 +27,18 @@
* particulier car il est circulaire. Par exemple si min=0, max=100, first=75 et
* bien last peut etre egal à 25 donc inferieur a first. Dans ce cas si l'on
* demande contains 50 il repond faux et contains 99 retourne vrai.
+ *
+ * Created: Wed Oct 4 2000
+ *
+ * @author POUSSIN Benjamin <bpoussin at free.fr> Copyright COGITEC
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
*/
public class Interval extends Observable implements Serializable, Cloneable { // Interval
- /**
- *
- */
+ /** serialVersionUID. */
private static final long serialVersionUID = 245693725840885583L;
private int min = 0;
@@ -117,8 +110,7 @@
/**
* Set the value of first.
*
- * @param v
- * Value to assign to first.
+ * @param v Value to assign to first.
*/
public void setFirst(int v) {
if (first != v) {
@@ -140,8 +132,7 @@
/**
* Set the value of last.
*
- * @param v
- * Value to assign to last.
+ * @param v Value to assign to last.
*/
public void setLast(int v) {
if (last != v) {
@@ -152,24 +143,26 @@
}
/**
- * Set the value of last.
+ * Move.
*
- * @param v
- * Value to assign to last.
+ * @param decal decal to move
*/
public void move(int decal) {
int first = this.first + decal;
- while (first < getMin())
+ while (first < getMin()) {
first = getMax() - getMin() + first + 1;
- if (first > getMax())
+ }
+ if (first > getMax()) {
first = first % (getMax() + 1);
+ }
int last = this.last + decal;
- while (last < getMin())
+ while (last < getMin()) {
last = getMax() - getMin() + last + 1;
- if (last > getMax())
+ }
+ if (last > getMax()) {
last = last % (getMax() + 1);
-
+ }
if (this.first != first || this.last != last) {
this.first = first;
this.last = last;
@@ -180,20 +173,27 @@
/**
* Retourne vrai si l'entier est dans l'interval.
+ *
+ * @param integerToCheck integer to check
+ * @return <tt>true</tt> if integerToCheck is in interval
*/
- public boolean contains(int entier) {
- if (getFirst() <= getLast())
- return getFirst() <= entier && entier <= getLast();
- return (getMin() <= entier && entier <= getLast())
- || (getFirst() <= entier && entier <= getMax());
+ public boolean contains(int integerToCheck) {
+ if (getFirst() <= getLast()) {
+ return getFirst() <= integerToCheck && integerToCheck <= getLast();
+ }
+
+ boolean result = (getMin() <= integerToCheck && integerToCheck <= getLast())
+ || (getFirst() <= integerToCheck && integerToCheck <= getMax());
+ return result;
}
/**
* @return le nombre d'element de l'interval
*/
public int getNbElem() {
- if (getFirst() <= getLast())
+ if (getFirst() <= getLast()) {
return getLast() - getFirst() + 1;
+ }
return (getMax() - getFirst()) + (getLast() - getMin()) + 2;
}
@@ -203,6 +203,8 @@
/**
* retourne une chaine XML qui represente l'objet.
+ *
+ * @deprecated since 20090414 (unused)
*/
public String toXML() {
return "<Interval min=\"" + getMin() + "\" max=\"" + getMax()
@@ -211,7 +213,9 @@
}
/**
- * Retourne une representation string de la valeur donne
+ * Retourne une representation string de la valeur donne.
+ *
+ * @deprecated since 20090414 (unused)
*/
public String getString(int entier) {
return String.valueOf(entier);
@@ -219,6 +223,8 @@
/**
* Retourne une representation entiere de la valeur String donne
+ *
+ * @deprecated since 20090414 (unused)
*/
public int getString(String ch) {
return Integer.parseInt(ch);
@@ -247,7 +253,7 @@
}
@Override
- public Interval clone(){
+ public Interval clone() {
Interval result = new Interval();
result.setFirst(this.getFirst());
result.setLast(this.getLast());
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalGraphic.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalGraphic.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalGraphic.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,11 +1,23 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* ##%%
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%%**/
package fr.ifremer.isisfish.ui.widget;
-
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Graphics;
@@ -18,37 +30,45 @@
import java.util.Observer;
import javax.swing.JComponent;
-class IntervalGraphic extends JComponent implements Observer{ // IntervalGraphic
+/**
+ * IntervalGraphic.
+ *
+ * Created: Wed Oct 4 2000
+ *
+ * @author poussin
+ * @version $Revision: 1919 $
+ *
+ * Mise a jour: $Date: 2009-03-09 15:40:20 +0100 (lun. 09 mars 2009) $
+ * par : $Author: sletellier $
+ */
+public class IntervalGraphic extends JComponent implements Observer { // IntervalGraphic
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = -6795996897731533693L;
- /**
- * des constantes
- */
+
+ /* some constants. */
private static final int HANDLE_WITH = 5;
private static final Cursor DEFAULT_CURSOR = new Cursor(Cursor.DEFAULT_CURSOR);
private static final Cursor W_RESIZE_CURSOR = new Cursor(Cursor.W_RESIZE_CURSOR);
private static final Cursor E_RESIZE_CURSOR = new Cursor(Cursor.E_RESIZE_CURSOR);
private static final Cursor MOVE_CURSOR = new Cursor(Cursor.MOVE_CURSOR);
- //les couleurs
+ /* Colors. */
private Color backColor = Color.blue;
private Color foreColor = Color.yellow;
private Color lineColor = Color.yellow.darker();
-
-
protected Interval model;
/**
- * rapport entre le model et la vu
- */
+ * rapport entre le model et la vu
+ */
protected float coef;
/**
- * decalage de la position de la souris lors d'un drag par rapport
- * a la position de l'element 1
- */
+ * decalage de la position de la souris lors d'un drag par rapport
+ * a la position de l'element 1
+ */
protected float delta;
//tous pour changer la selection avec la souris
@@ -60,14 +80,14 @@
//si vrai le composant est editable
private boolean enable = true;
- class MouseClick extends MouseAdapter{
- public void mouseEntered( MouseEvent e ){
+ class MouseClick extends MouseAdapter {
+ public void mouseEntered( MouseEvent e) {
mouseCursor = getCursor();
}
- public void mousePressed( MouseEvent e ){
- int mouseX=e.getX();
+ public void mousePressed( MouseEvent e) {
+ int mouseX = e.getX();
- if(model.getFirst() <= model.getLast()){
+ if(model.getFirst() <= model.getLast()) {
inDrag = (model.getFirst()*coef - HANDLE_WITH < mouseX) &&
(mouseX < (model.getLast()+1)*coef + HANDLE_WITH);
}
@@ -79,30 +99,31 @@
((model.getFirst()*coef - HANDLE_WITH < mouseX) &&
(mouseX <= getSize().width));
}
- if(inDrag)
+ if(inDrag) {
delta = mouseX - (model.getFirst()*coef);
+ }
}
- public void mouseReleased( MouseEvent e ){
+ public void mouseReleased( MouseEvent e) {
inDrag = false;
}
}
- class MouseMove extends MouseMotionAdapter{
- public void mouseMoved( MouseEvent e ){
- if (!inDrag && enable){
+ class MouseMove extends MouseMotionAdapter {
+ public void mouseMoved( MouseEvent e ) {
+ if (!inDrag && enable) {
int x = e.getX();
//on determine sur quel section on est
if((model.getFirst()*coef - HANDLE_WITH < x ) &&
- (x < model.getFirst()*coef + HANDLE_WITH)){
+ (x < model.getFirst()*coef + HANDLE_WITH)) {
cursorType = 0;
setCursor(W_RESIZE_CURSOR);
}else if(((model.getLast()+1)*coef - HANDLE_WITH <x ) &&
- (x < (model.getLast()+1)*coef + HANDLE_WITH)){
+ (x < (model.getLast()+1)*coef + HANDLE_WITH)) {
cursorType = 2;
setCursor(E_RESIZE_CURSOR);
delta = x - (model.getLast()*coef);
- }else{
+ } else {
boolean bool =
((model.getFirst() <= model.getLast()) &&
(model.getFirst()*coef + HANDLE_WITH < x) &&
@@ -115,11 +136,11 @@
((model.getFirst()*coef + HANDLE_WITH < x) &&
(x <= getSize().width))));
- if ( bool ){
+ if (bool) {
cursorType = 1;
setCursor(MOVE_CURSOR);
}
- else{
+ else {
cursorType = 4;
setCursor(DEFAULT_CURSOR);
}
@@ -161,8 +182,9 @@
}
public void setModel(Interval m){
- if(this.model != null)
+ if(this.model != null) {
this.model.deleteObserver(this);
+ }
this.model = m;
this.model.addObserver(this);
update(this.model, null);
@@ -175,7 +197,7 @@
/**
* Dessine sur le graphique l'interval courant
*/
- protected void redraw( Graphics g ){
+ protected void redraw( Graphics g ) {
coef = (float)getSize().width / (float)(model.getMax()+1);
int width = getSize().width;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalLabel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalLabel.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalLabel.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,7 +1,20 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* ##%%
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%%**/
package fr.ifremer.isisfish.ui.widget;
@@ -10,21 +23,31 @@
import javax.swing.JLabel;
/**
-* La vue en label
-*/
+ * La vue en label.
+ *
+ * Created: Wed Oct 4 2000
+ *
+ * @author poussin
+ * @version $Revision: 1919 $
+ *
+ * Mise a jour: $Date: 2009-03-09 15:40:20 +0100 (lun. 09 mars 2009) $
+ * par : $Author: sletellier $
+ */
class IntervalLabel extends JLabel implements Observer {
- /** */
+
+ /** serialVersionUID. */
private static final long serialVersionUID = -6269941008930677478L;
+
private Interval model = null;
private Object[] renderArray;
- public IntervalLabel(Interval m){
+ public IntervalLabel(Interval m) {
super();
setModel(m);
}
- public void setModel(Interval m){
- if(this.model != null) {
+ public void setModel(Interval m) {
+ if (this.model != null) {
this.model.deleteObserver(this);
}
this.model = m;
@@ -36,16 +59,17 @@
this.renderArray = renderArray;
}
- public void update(Observable o, Object arg){
+ public void update(Observable o, Object arg) {
setText(toString(model.getFirst()) + " - " + toString(model.getLast()));
}
protected String toString(int val) {
+ String result = null;
if (renderArray != null && renderArray.length > val) {
- return String.valueOf(renderArray[val]);
+ result = String.valueOf(renderArray[val]);
} else {
- return String.valueOf(val);
+ result = String.valueOf(val);
}
+ return result;
}
}
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalPanel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalPanel.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/IntervalPanel.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,24 +1,23 @@
-/**##%%
-* Copyright (C) 2002, 2003 Code Lutin
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%%**/
+/* ##%%
+ * Copyright (C) 2002, 2003 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%%**/
package fr.ifremer.isisfish.ui.widget;
-//import org.codelutin.i18n.*;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.Observable;
@@ -26,42 +25,49 @@
import javax.swing.JPanel;
/**
-* Widget permettant d'editer graphiquement un interval.
-*/
+ * Widget permettant d'editer graphiquement un interval.
+ *
+ * Created: Wed Oct 4 2000
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
public class IntervalPanel extends JPanel implements Observer {
- /** */
+ /** serialVersionUID. */
private static final long serialVersionUID = 4245022583233407638L;
private final static int DEFAULT_WIDTH = 110;
private final static int DEFAULT_HEIGHT = 50;
- public static void main(String args[]){
+ public static void main(String args[]) {
Interval i = new Interval(0, 11);
FormInterval f = new FormInterval(i);
f.setVisible(true);
}
-
-
private Interval model = null;
private IntervalGraphic graph;
private IntervalLabel label;
- public IntervalPanel(){
+ public IntervalPanel() {
this(null);
}
- public IntervalPanel(Interval model){
+ public IntervalPanel(Interval model) {
this(model, DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
- public IntervalPanel(Interval model, int width, int height){
- if(model == null) {
- model = new Interval(0,0);
+
+ public IntervalPanel(Interval model, int width, int height) {
+ if (model == null) {
+ model = new Interval(0, 0);
}
this.model = model;
setPreferredSize(new Dimension(width, height));
- this.setLayout(new GridLayout(2,1));
+ this.setLayout(new GridLayout(2, 1));
graph = new IntervalGraphic(this.model);
label = new IntervalLabel(this.model);
@@ -71,29 +77,29 @@
this.add(graph);
}
- public Interval getModel(){
+ public Interval getModel() {
return model;
}
- public void setModel(Interval model){
- if(this.model != null) {
+ public void setModel(Interval model) {
+ if (this.model != null) {
this.model.deleteObserver(this);
}
- this.model = model;
+ this.model = model;
model.addObserver(this);
graph.setModel(model);
label.setModel(model);
}
- public void setEnabled(boolean enable){
+ public void setEnabled(boolean enable) {
graph.setEnabled(enable);
label.setEnabled(enable);
}
-
- public void update(Observable o, Object arg){
+
+ public void update(Observable o, Object arg) {
if (arg instanceof String) {
- String props = (String)arg;
+ String props = (String) arg;
if (props.contains("min")) {
firePropertyChange("min", null, getModel().getMin());
}
@@ -105,7 +111,7 @@
}
if (props.contains("last")) {
firePropertyChange("last", null, getModel().getLast());
- }
+ }
}
}
@@ -114,8 +120,3 @@
}
}
-
-
-
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/VCSConnectionState.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/VCSConnectionState.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/VCSConnectionState.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ * Copyright (C) 2002-2009 Code Lutin, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -19,7 +19,6 @@
package fr.ifremer.isisfish.ui.widget;
-
import fr.ifremer.isisfish.IsisFish;
import javax.swing.Icon;
import javax.swing.JLabel;
@@ -28,17 +27,19 @@
import org.codelutin.util.Resource;
/**
- *
+ * VCSConnectionState.
* @author poussin
* @version $Revision$
*
* Last update: $Date$
* by : $Author$
+ *
+ * @deprecated since 20090414 (unused)
*/
public class VCSConnectionState extends JLabel {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(VCSConnectionState.class);
+ private static Log log = LogFactory.getLog(VCSConnectionState.class);
public VCSConnectionState() {
Icon icon;
@@ -46,7 +47,7 @@
if (connected) {
icon = Resource.getIcon("images/stock_connect.png");
} else {
- icon = Resource.getIcon("images/stock_disconnect.png");
+ icon = Resource.getIcon("images/stock_disconnect.png");
}
setIcon(icon);
}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/VCSConnectionState.java
___________________________________________________________________
Name: svn:keywords
+ Author Revision Date
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,34 +1,21 @@
/* *##%
-* Copyright (C) 2002, 2003 Code Lutin
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
-/* *
-* EquationTableEditor.java
-*
-* Created: 23 mars 2004
-*
-* @author Benjamin Poussin <poussin at codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
package fr.ifremer.isisfish.ui.widget.editor;
import static org.codelutin.i18n.I18n._;
@@ -49,19 +36,29 @@
import java.util.HashSet;
import java.util.Iterator;
+/**
+ * EquationTableEditor.
+ *
+ * Created: 23 mars 2004
+ *
+ * @author Benjamin Poussin <poussin at codelutin.com>
+ * Copyright Code Lutin
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
public class EquationTableEditor extends JButton implements TableCellEditor { // EquationTableEditor
- /**
- *
- */
- private static final long serialVersionUID = -2483612426979170213L;
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -2483612426979170213L;
- HashSet<CellEditorListener> listeners = new HashSet<CellEditorListener>();
+ protected HashSet<CellEditorListener> listeners = new HashSet<CellEditorListener>();
- EquationEditorPaneUI frame = null;
- Equation equation = null;
+ protected EquationEditorPaneUI frame = null;
+ protected Equation equation = null;
- public EquationTableEditor(){
+ public EquationTableEditor() {
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
getFrame().setVisible(true);
@@ -69,8 +66,8 @@
});
}
- protected EquationEditorPaneUI getFrame(){
- if(frame == null){
+ protected EquationEditorPaneUI getFrame() {
+ if (frame == null) {
frame = new EquationEditorPaneUI();
frame.getOkButton().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -86,8 +83,9 @@
return frame;
}
- public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column){
- equation = (Equation)value;
+ public Component getTableCellEditorComponent(JTable table, Object value,
+ boolean isSelected, int row, int column) {
+ equation = (Equation) value;
String name = _("isisfish.common.empty");
if (equation != null) {
@@ -95,22 +93,25 @@
}
this.setText(name);
try {
- getFrame().setEquation(equation.getCategory(), equation.getName(), equation.getJavaInterface(), equation.getContent());
+ getFrame().setEquation(equation.getCategory(), equation.getName(),
+ equation.getJavaInterface(), equation.getContent());
} catch (Exception eee) {
- throw new IsisFishRuntimeException("Can't create file to edit equation", eee);
+ throw new IsisFishRuntimeException(
+ "Can't create file to edit equation", eee);
}
return this;
}
- public void addCellEditorListener(CellEditorListener l){
+ public void addCellEditorListener(CellEditorListener l) {
listeners.add(l);
}
- public void removeCellEditorListener(CellEditorListener l){
+
+ public void removeCellEditorListener(CellEditorListener l) {
listeners.remove(l);
}
- public Object getCellEditorValue(){
-// Equation equation = getFrame().getEquationEditorPane().getEquation();
+ public Object getCellEditorValue() {
+ // Equation equation = getFrame().getEquationEditorPane().getEquation();
if (equation != null) {
String content = getFrame().getEditor().getText();
equation.setContent(content);
@@ -118,32 +119,36 @@
return equation;
}
- public boolean isCellEditable(EventObject anEvent){
+ public boolean isCellEditable(EventObject anEvent) {
return true;
}
- public boolean shouldSelectCell(EventObject anEvent){
+
+ public boolean shouldSelectCell(EventObject anEvent) {
return true;
}
- public void cancelCellEditing(){
+ public void cancelCellEditing() {
ChangeEvent e = new ChangeEvent(this);
- for(Iterator i=listeners.iterator(); i.hasNext();){
- CellEditorListener l=(CellEditorListener)i.next();
+ for (Iterator i = listeners.iterator(); i.hasNext();) {
+ CellEditorListener l = (CellEditorListener) i.next();
l.editingCanceled(e);
}
- if(frame != null)
+ if (frame != null) {
frame.dispose();
+ }
}
- public boolean stopCellEditing(){
+
+ public boolean stopCellEditing() {
ChangeEvent e = new ChangeEvent(this);
- for(Iterator i=listeners.iterator(); i.hasNext();){
- CellEditorListener l=(CellEditorListener)i.next();
+ for (Iterator i = listeners.iterator(); i.hasNext();) {
+ CellEditorListener l = (CellEditorListener) i.next();
l.editingStopped(e);
}
- if(frame != null)
+ if (frame != null) {
frame.dispose();
+ }
return true;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -1,34 +1,58 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* *##%
+ * Copyright (C) 2002 - 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.ui.widget.editor;
/**
+ * GenericCell.
*
* @author letellier
+ * Copyright Code Lutin
+ * @version $Revision: 1628 $
+ *
+ * Mise a jour: $Date: 2008-11-28 10:25:59 +0100 (ven 28 nov 2008) $
+ * par : $Author: chatellier $
*/
-public class GenericCell{
+public class GenericCell {
private String name;
private Object value;
private Class type;
- public GenericCell(String n, Object c, Class t){
+
+ public GenericCell(String n, Object c, Class t) {
name = n;
value = c;
type = t;
}
+
@Override
- public String toString(){
+ public String toString() {
return name;
}
- public Object getValue(){
+
+ public Object getValue() {
return value;
}
- public String getName(){
+
+ public String getName() {
return name;
}
- public Class getType(){
+
+ public Class getType() {
return type;
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java 2009-04-14 13:43:46 UTC (rev 2104)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java 2009-04-14 13:55:22 UTC (rev 2105)
@@ -175,7 +175,9 @@
}
} catch (Exception eee) {
- log.warn("Can't get entity object for combobox", eee);
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get entity object for combobox", eee);
+ }
}
break;
case Boolean:
@@ -234,8 +236,10 @@
}
}
}
- log.info("getCellEditorValue [" + type + "] [mapping:" + mapping + "="
+ if (log.isInfoEnabled()) {
+ log.info("getCellEditorValue [" + type + "] [mapping:" + mapping + "="
+ editor);
+ }
//+ editor==null?null:editor.getClass().getSimpleName());
return editor;
}
@@ -289,9 +293,11 @@
result = cub.convert((String) result, type);
}
- log.info("getCellEditorValue [" + type + "] [mapping:" + mapping
+ if (log.isInfoEnabled()) {
+ log.info("getCellEditorValue [" + type + "] [mapping:" + mapping
+ "]= " + result);
-
+ }
+
return result;
}
@@ -341,7 +347,9 @@
* @see javax.swing.CellEditor#cancelCellEditing()
*/
public void cancelCellEditing() {
- log.debug("cancelCellEditing");
+ if (log.isDebugEnabled()) {
+ log.debug("cancelCellEditing");
+ }
ChangeEvent e = new ChangeEvent(this);
for (CellEditorListener listener : listeners) {
listener.editingCanceled(e);
@@ -374,7 +382,9 @@
*/
public boolean stopCellEditing() {
// to prevent concurent modification exception
- log.debug("stopCellEditing");
+ if (log.isDebugEnabled()) {
+ log.debug("stopCellEditing");
+ }
CellEditorListener[] list = listeners
.toArray(new CellEditorListener[listeners.size()]);
@@ -427,8 +437,10 @@
public int getSelectedValue() {
int selectedYear = getSelectedYear();
int selectedMounth = getSelectedMounth();
- log.info("selected mounth " + selectedMounth);
- log.info("selected year " + selectedYear);
+ if (log.isInfoEnabled()) {
+ log.info("selected mounth " + selectedMounth);
+ log.info("selected year " + selectedYear);
+ }
return selectedMounth + selectedYear * 12;
}
1
0
r2104 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
14 Apr '09
Author: chatellier
Date: 2009-04-14 13:43:46 +0000 (Tue, 14 Apr 2009)
New Revision: 2104
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
Log:
Fix duplicated entity (need improvement, strange bug)
Fix listener on reloaded object.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-14 12:46:21 UTC (rev 2103)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-14 13:43:46 UTC (rev 2104)
@@ -1,13 +1,26 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
package fr.ifremer.isisfish.ui.input;
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
-import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+import static org.codelutin.i18n.I18n._;
+
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@@ -15,61 +28,77 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
+
import javax.swing.JButton;
import javax.swing.JOptionPane;
+
import jaxx.runtime.JAXXAction;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXInitialContext;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+
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 org.codelutin.topia.TopiaContext;
import org.codelutin.topia.TopiaException;
+import org.codelutin.topia.framework.TopiaContextImpl;
import org.codelutin.topia.persistence.TopiaDAO;
import org.codelutin.topia.persistence.TopiaEntity;
-import static org.codelutin.i18n.I18n._;
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.ui.SaveVerifier;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+
/**
+ * InputSaveVerifier.
*
* @author letellier
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
*/
-public class InputSaveVerifier implements JAXXAction, fr.ifremer.isisfish.ui.SaveVerifier {
+public class InputSaveVerifier implements JAXXAction, SaveVerifier {
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(InputAction.class);
+
protected JButton currentNewButton = null;
protected JButton currentDeleteButton = null;
protected JButton currentSaveButton = null;
protected JButton currentCancelButton = null;
+
+ protected ActionListener saveListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaSave();
+ }
+ };
- protected ActionListener saveListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaSave();
- }
- };
protected ActionListener cancelListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaCancel();
- }
- };
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaCancel();
+ }
+ };
+
protected ActionListener newListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaCreate();
- }
- };
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaCreate();
+ }
+ };
+
protected ActionListener deleteListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaRemove();
+ }
+ };
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaRemove();
- }
- };
-
protected String type = null;
protected boolean editable = false;
@@ -79,16 +108,15 @@
protected String currentOnglet = null;
protected TopiaContext isisContext = null;
- protected List<TopiaEntity> currentEntities = new ArrayList <TopiaEntity>();
- protected List<InputContentUI> currentPanels = new ArrayList <InputContentUI>();
+ protected List<TopiaEntity> currentEntities = new ArrayList<TopiaEntity>();
+ protected List<InputContentUI> currentPanels = new ArrayList<InputContentUI>();
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(InputAction.class);
protected InputUI rootUI;
protected SensitivityTabUI sensUI;
- public InputSaveVerifier(){
+ public InputSaveVerifier() {
}
+
@Override
public JAXXInitialContext init(JAXXContext parentContent, Object... datas) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -114,11 +142,12 @@
public int askUser(String message) {
int response = JOptionPane.showConfirmDialog(rootUI, message,
- _("isisfish.input.menu.commit"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
+ _("isisfish.input.menu.commit"),
+ JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
return response;
}
- protected void topiaChanged(){
+ protected void topiaChanged() {
changed = true;
setPanelsActifs();
setEnabled(currentSaveButton, true);
@@ -126,7 +155,8 @@
setEnabled(currentNewButton, false);
setEnabled(currentDeleteButton, false);
}
- protected void noModif(){
+
+ protected void noModif() {
changed = false;
setPanelsActifs();
setEnabled(currentSaveButton, false);
@@ -134,8 +164,9 @@
setEnabled(currentNewButton, true);
setEnabled(currentDeleteButton, editable);
}
- protected void setEnabled(JButton b, boolean enabled){
- if (b != null){
+
+ protected void setEnabled(JButton b, boolean enabled) {
+ if (b != null) {
b.setEnabled(enabled);
}
}
@@ -154,22 +185,26 @@
String msg = "";
try {
boolean doDelete;
- TopiaEntity topiaEntity = (TopiaEntity)currentNode.getJAXXContextValue(rootUI);
+ TopiaEntity topiaEntity = (TopiaEntity) currentNode
+ .getJAXXContextValue(rootUI);
List<TopiaEntity> allWillBeRemoved = topiaEntity.getComposite();
if (allWillBeRemoved.size() > 0) {
- String text = _(
- "isisfish.message.delete.object", currentEntities.get(0).toString());
+ String text = _("isisfish.message.delete.object",
+ currentEntities.get(0).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);
+ _("isisfish.message.delete.entities"),
+ JOptionPane.YES_NO_OPTION);
doDelete = resp == JOptionPane.YES_OPTION;
} else {
- String text = _("isisfish.message.confirm.delete.object", currentEntities.get(0).toString());
+ String text = _("isisfish.message.confirm.delete.object",
+ currentEntities.get(0).toString());
int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
+ _("isisfish.message.delete.entity"),
+ JOptionPane.YES_NO_OPTION);
doDelete = resp == JOptionPane.YES_OPTION;
}
@@ -181,7 +216,9 @@
msg = _("isisfish.message.remove.canceled");
}
} catch (Exception eee) {
- log.error("Can't remove entity: " + currentEntities.get(0), eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't remove entity: " + currentEntities.get(0), eee);
+ }
ErrorDialogUI.showError(eee);
}
rootUI.setInfoText(msg);
@@ -191,9 +228,8 @@
noModif();
}
+ protected void topiaCreate() {
- protected void topiaCreate(){
-
if (log.isTraceEnabled()) {
log.trace("create called for " + type);
}
@@ -205,41 +241,48 @@
Method method = MethodUtils.getAccessibleMethod(
IsisFishDAOHelper.class, "get" + type + "DAO",
TopiaContext.class);
- TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, isisContext);
+ TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(
+ null, isisContext);
TopiaEntity entity = dao.create("name", name);
entity.update();
isisContext.commitTransaction();
- String path = currentNode.getParent().getContextPath() + "/" + entity.getTopiaId();
- if (!editable){
+ String path = currentNode.getParent().getContextPath() + "/"
+ + entity.getTopiaId();
+ if (!editable) {
path = currentNode.getContextPath() + "/" + entity.getTopiaId();
}
-
+
rootUI.setTreeModel();
rootUI.setTreeSelection(path);
rootUI.setInfoText(_("isisfish.message.creation.finished"));
} catch (Exception eee) {
- log.error("Can't create entity", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't create entity", eee);
+ }
showMsgBox(eee);
}
}
-
- public void topiaSave(){
+
+ public void topiaSave() {
try {
noModif();
- for (TopiaEntity t : currentEntities){
+ for (TopiaEntity t : currentEntities) {
t.update();
- if (log.isDebugEnabled())
+ if (log.isDebugEnabled()) {
log.debug("updating : " + t);
+ }
}
isisContext.commitTransaction();
rootUI.repaintNode(currentNode.getContextPath());
rootUI.setInfoText(_("isisfish.message.save.finished"));
} catch (TopiaException eee) {
- log.error("Can't save region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't save region", eee);
+ }
showMsgBox(eee);
}
}
@@ -252,17 +295,28 @@
try {
noModif();
isisContext.rollbackTransaction();
- List<TopiaEntity> canceledEntity = new ArrayList<TopiaEntity>();
- for (TopiaEntity t : currentEntities){
- t = isisContext.findByTopiaId(t.getTopiaId());
+ List<TopiaEntity> canceledEntity = currentEntities;
+ currentEntities = new ArrayList<TopiaEntity>();
+
+ // TODO a quoi ca sert de recharger les entités ?
+ for (TopiaEntity t : canceledEntity) {
+ TopiaEntity t2 = isisContext.findByTopiaId(t.getTopiaId());
+
+ // desynchronise la précédente
+ // fix : org.hibernate.NonUniqueObjectException: a different object with the
+ // same identifier value was already associated with the session
+ //((TopiaContextImpl)isisContext).getHibernate().evict(t2);
+ t.setTopiaId(null);
+
rootUI.repaintNode(currentNode.getContextPath());
rootUI.setTreeSelection(currentNode.getContextPath());
- canceledEntity.add(t);
+ addCurrentEntity(t2);
}
- currentEntities = canceledEntity;
rootUI.setInfoText(_("isisfish.message.cancel.finished"));
} catch (Exception eee) {
- log.error("Can't cancel modification in region", eee);
+ if (log.isErrorEnabled()) {
+ log.error("Can't cancel modification in region", eee);
+ }
showMsgBox(eee);
}
}
@@ -270,51 +324,59 @@
protected void showMsgBox(Exception eee) {
ErrorDialogUI.showError(eee);
}
- protected void setPanelsActifs(){
- if (!currentPanels.isEmpty()){
- for (InputContentUI panel : currentPanels){
+
+ protected void setPanelsActifs() {
+ if (!currentPanels.isEmpty()) {
+ for (InputContentUI panel : currentPanels) {
panel.setActif(editable);
}
}
}
- public void refreshAll(){
- for (InputContentUI panel : currentPanels){
+
+ public void refreshAll() {
+ for (InputContentUI panel : currentPanels) {
panel.refresh();
panel.setActif(editable);
}
}
+
public void addCurrentEntity(TopiaEntity currentEntity) {
- if (currentEntity != null){
+ if (currentEntity != null) {
editable = true;
isisContext = currentEntity.getTopiaContext();
- currentEntity.addPropertyChangeListener(new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()){
- log.debug("PropertyChanged : " + evt.getPropertyName() + " New Value : " + evt.getNewValue());
- }
- topiaChanged();
- }
- });
+ currentEntity
+ .addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()) {
+ log.debug("PropertyChanged : "
+ + evt.getPropertyName()
+ + " New Value : " + evt.getNewValue());
+ }
+ topiaChanged();
+ }
+ });
TopiaEntity entity = getEntity(currentEntity.getClass());
- if (entity != null){
+ if (entity != null) {
currentEntities.remove(entity);
}
this.currentEntities.add(currentEntity);
setPanelsActifs();
}
}
- public void removeAllEntity(){
+
+ public void removeAllEntity() {
currentEntities.clear();
editable = false;
noModif();
setPanelsActifs();
}
+
public void addCurrentPanel(InputContentUI... panels) {
- for (InputContentUI ui : panels){
+ for (InputContentUI ui : panels) {
editable = !currentEntities.isEmpty();
this.currentPanels.add(ui);
- if (rootUI == null){
+ if (rootUI == null) {
ui.setSens(true);
ui.setLayer(true);
}
@@ -322,7 +384,8 @@
ui.setActif(editable);
}
}
- public void removeAllPanels(){
+
+ public void removeAllPanels() {
currentPanels.clear();
}
@@ -330,12 +393,12 @@
return editable;
}
- public void setSaveButton(JButton saveButton){
+ public void setSaveButton(JButton saveButton) {
setSaveButton(saveButton, true);
}
- public void setSaveButton(JButton saveButton, Boolean listener){
- if (listener){
+ public void setSaveButton(JButton saveButton, Boolean listener) {
+ if (listener) {
saveButton.removeActionListener(saveListener);
saveButton.addActionListener(saveListener);
}
@@ -344,12 +407,12 @@
this.currentSaveButton = saveButton;
}
- public void setNewButton(JButton saveButton, String name){
+ public void setNewButton(JButton saveButton, String name) {
setNewButton(saveButton, name, true);
}
- public void setNewButton(JButton newButton, String t, Boolean listener){
- if (listener){
+ public void setNewButton(JButton newButton, String t, Boolean listener) {
+ if (listener) {
newButton.removeActionListener(newListener);
newButton.addActionListener(newListener);
}
@@ -359,7 +422,7 @@
this.currentNewButton = newButton;
}
- public void setCancelButton(JButton cancelButton){
+ public void setCancelButton(JButton cancelButton) {
cancelButton.removeActionListener(cancelListener);
cancelButton.addActionListener(cancelListener);
cancelButton.setText(_("isisfish.common.cancel"));
@@ -367,12 +430,12 @@
this.currentCancelButton = cancelButton;
}
- public void setDeleteButton(JButton deleteButton){
+ public void setDeleteButton(JButton deleteButton) {
setDeleteButton(deleteButton, true);
}
-
- public void setDeleteButton(JButton deleteButton, boolean listener){
- if (listener){
+
+ public void setDeleteButton(JButton deleteButton, boolean listener) {
+ if (listener) {
deleteButton.removeActionListener(deleteListener);
deleteButton.addActionListener(deleteListener);
}
@@ -380,7 +443,7 @@
deleteButton.setText(_("isisfish.common.remove"));
this.currentDeleteButton = deleteButton;
}
-
+
public TopiaContext getIsisContext() {
return isisContext;
}
@@ -389,9 +452,9 @@
return currentEntities;
}
- public <E extends TopiaEntity> E getEntity(Class<E> clazz){
- for (TopiaEntity te : currentEntities){
- if (clazz.isInstance(te)){
+ public <E extends TopiaEntity> E getEntity(Class<E> clazz) {
+ for (TopiaEntity te : currentEntities) {
+ if (clazz.isInstance(te)) {
return (E) te;
}
}
@@ -429,11 +492,11 @@
void setRootPanel(InputUI inputUI) {
this.rootUI = inputUI;
}
-
+
public SensitivityTabUI getSensPanel() {
return sensUI;
}
-
+
public void setSensPanel(SensitivityTabUI sensUI) {
this.sensUI = sensUI;
}
1
0
r2103 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
by chatellier@users.labs.libre-entreprise.org 14 Apr '09
14 Apr '09
Author: chatellier
Date: 2009-04-14 12:46:21 +0000 (Tue, 14 Apr 2009)
New Revision: 2103
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
Improve code style , logger & co ...
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 2009-04-10 15:17:12 UTC (rev 2102)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-04-14 12:46:21 UTC (rev 2103)
@@ -97,10 +97,10 @@
protected DefaultComboBoxModel getFieldCurrentRegionModel(){
return new DefaultComboBoxModel(Common.getRegionItem());
}
-protected void regionChange(){
+protected void regionChange() {
final String name = fieldCurrentRegion.getSelectedItem().toString();
if (log.isDebugEnabled()) {
- log.debug(" selected " + name);
+ log.debug("Region change, selected : " + name);
}
setInfoText(_("isisfish.message.loading.region", name));
SwingUtilities.invokeLater(new Runnable() {
@@ -112,18 +112,21 @@
}
});
}
-protected void loadRegion(String name){
+protected void loadRegion(String name) {
+ if (log.isDebugEnabled()) {
+ log.debug("Loadregion : " + name);
+ }
setRegion((FisheryRegionImpl)getAction().loadRegion(this, name));
- if (getRegion() == null){
+ if (getRegion() == null) {
regionNull();
}
- else{
+ else {
setTreeModel();
getCardlayoutPrincipal().show(inputPanePrincipal,"normale");
}
}
protected void setTreeModel(){
- if (getRegion() != null){
+ if (getRegion() != null) {
String regionName = getRegion().getName();
setContextValue(getRegion());
NavigationTreeModel model = InputNavigationTreeSelectionAdapter.getTreeModel(regionName, getRegion());
@@ -137,76 +140,77 @@
}
}
-public void repaintNode(String path){
+public void repaintNode(String path) {
NavigationTreeModel model = getContextValue(NavigationTreeModel.class);
NavigationTreeNode currentNode = model.findNode(path);
model.nodeChanged(currentNode);
}
-public void setTreeSelection(String path){
+public void setTreeSelection(String path) {
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){
+protected void setInfoText(String s) {
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(s);
}
-protected void newRegion(){
+protected void newRegion() {
String name = fieldNewRegion.getText();
setInfoText(_("isisfish.message.creating.region", name));
getContextValue(InputAction.class).newRegion(name);
- setInfoText(_("isisfish.message.creating.region", name));
setFieldCurrentRegionModel();
fieldCurrentRegion.setSelectedItem(name);
JButtonNewRegion.setEnabled(false);
fieldNewRegion.setText("");
setInfoText(_("isisfish.message.creation.finished"));
}
-protected void regionNull(){
+protected void regionNull() {
getCardlayoutPrincipal().show(inputPanePrincipal,"none");
DefaultTreeModel model = new DefaultTreeModel(null);
navigation.setModel(model);
}
-protected void newChanged(){
+protected void newChanged() {
JButtonNewRegion.setEnabled(true);
}
-protected void importRegion(){
- setInfoText(_("isisfish.message.import.zip" + getContextValue(InputAction.class).importRegion()));
+protected void importRegion() {
+ setInfoText(_("isisfish.message.import.zip"));
+ getContextValue(InputAction.class).importRegion();
setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.import.finished"));
}
-protected void importRegionAndRename(){
- setInfoText(_("isisfish.message.import.zip" + getContextValue(InputAction.class).importRegionAndRename()));
+protected void importRegionAndRename() {
+ setInfoText(_("isisfish.message.import.zip"));
+ getContextValue(InputAction.class).importRegionAndRename();
setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.import.finished"));
}
-protected void importV2Region(){
+protected void importV2Region() {
setInfoText(_("isisfish.message.import.xml.v2.file") + getContextValue(InputAction.class).importV2Region());
setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.import.finished"));
}
-protected void importRegionFromSimulation(){
+protected void importRegionFromSimulation() {
setInfoText(_("isisfish.message.import", getContextValue(InputAction.class).importRegionFromSimulation()));
}
-protected void exportRegion(){
+protected void exportRegion() {
setInfoText(_("isisfish.message.export.zip", getContextValue(InputAction.class).exportRegion(getRegionStorage())));
setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.export.done"));
}
-protected void copyRegion(){
+protected void copyRegion() {
setInfoText(_("isisfish.message.copy.region", getContextValue(InputAction.class).copyRegion(getRegionStorage())));
setFieldCurrentRegionModel();
setInfoText(_("isisfish.message.copy.finished"));
}
-protected void removeRegion(){
- setInfoText(_("isisfish.message.removing.region" + getRegionStorage().getName()));
+protected void removeRegion() {
+ setInfoText(_("isisfish.message.removing.region", getRegionStorage().getName()));
setInfoText(getContextValue(InputAction.class).removeRegion(getRegionStorage(), false));
setFieldCurrentRegionModel();
regionNull();
}
-protected void commitRegionInCVS(){
- setInfoText(_("isisfish.message.commiting.region" + getRegionStorage().getName()));
+protected void commitRegionInCVS() {
+ setInfoText(_("isisfish.message.commiting.region", getRegionStorage().getName()));
setInfoText(getContextValue(InputAction.class).commitRegionInCVS(getRegionStorage()));
}
]]>
@@ -216,7 +220,7 @@
<JMenuItem text="isisfish.input.menu.importRegion" onActionPerformed="importRegion()" accelerator="accNew"/>
<JMenuItem text="isisfish.input.menu.importRenameRegion" onActionPerformed="importRegionAndRename()" accelerator="accNew"/>
<JMenuItem text="isisfish.input.menu.importRegionV2" onActionPerformed="importV2Region()" accelerator="accNew"/>
- <JMenuItem text="isisfish.input.menu.importRegionSimulation" onActionPerformed="importRegionFromSimulation()" accelerator="accImportFromSimulation"/>
+ <JMenuItem text="isisfish.input.menu.importRegionSimulation" onActionPerformed="importRegionFromSimulation()" accelerator="accImportFromSimulation"/>
<JMenuItem text="isisfish.input.menu.exportRegion" enabled='{getRegion() != null}' onActionPerformed="exportRegion()" accelerator="accExport"/>
<JMenuItem text="isisfish.input.menu.copyRegion" enabled='{getRegion() != null}' onActionPerformed="copyRegion()" accelerator="accExport"/>
<JSeparator/>
1
0