Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
r2739 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 04 Nov '09
by chatellier@users.labs.libre-entreprise.org 04 Nov '09
04 Nov '09
Author: chatellier
Date: 2009-11-04 18:15:48 +0000 (Wed, 04 Nov 2009)
New Revision: 2739
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Clean i18n properties file
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-11-04 18:14:13 UTC (rev 2738)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-11-04 18:15:48 UTC (rev 2739)
@@ -22,7 +22,6 @@
Can't\ read\ ssh\ key\ \:\ %s=
Can't\ simulate\ %s=
Check\ state\ of\ local\ repository\:\ %s=
-Checkout\ pom.xml\ to\ %s=
Command\ '%s'\ fail\ to\ execute=
Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
Error\ during\ vcs\ initialisation=
@@ -164,7 +163,6 @@
isisfish.config.main.locale.description=user locale
isisfish.config.main.login.description=
isisfish.config.main.password.description=
-isisfish.config.main.projectName.description=name of project
isisfish.config.main.regionMap.description=
isisfish.config.main.remoteCaparmor.description=
isisfish.config.main.resultExport.description=
@@ -202,10 +200,8 @@
isisfish.config.vcs.localDatabasePath.description=
isisfish.config.vcs.noPassPhrase.description=
isisfish.config.vcs.passphrase.description=
-isisfish.config.vcs.remoteDatabase.description=
isisfish.config.vcs.remotePath.description=
isisfish.config.vcs.type.description=
-isisfish.config.vcs.typeRepo.description=
isisfish.config.vcs.useSshConnexion.description=
isisfish.config.vcs.userName.description=
isisfish.config.vcs.userPassword.description=
@@ -284,7 +280,6 @@
isisfish.error.import.file=Can't import file %1$s
isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
isisfish.error.init.map=Can't init map.
-isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
isisfish.error.input.addentity=Can't add entity "%s"
isisfish.error.input.cancelentity=Can't cancel modification on entity
isisfish.error.input.createentity=Can't create entity
@@ -614,7 +609,6 @@
isisfish.message.copy.finished=Copy finished
isisfish.message.copy.region=Copy region
isisfish.message.creating.region=Creating region %1$s
-isisfish.message.creation.done=creation done %1$s
isisfish.message.creation.finished=Creation finished
isisfish.message.delete.canceled=delete canceled
isisfish.message.delete.entities=Delete entities
@@ -671,7 +665,6 @@
isisfish.message.simulation.execution=Simulation execution
isisfish.message.simulation.prepare=Preparing simulation
isisfish.message.tray.disabled=SystemTray disabled
-isisfish.message.update.finished=update finished
isisfish.metier.comments=Comments
isisfish.metier.name=Name
isisfish.metier.rangeValues=Range of values
@@ -944,8 +937,6 @@
isisfish.script.save=Save
isisfish.script.save.tooltip=Sauve le script
isisfish.script.title=Script Editor
-isisfish.script.vcs.localaddition=This file is not present on remote repository
-isisfish.script.vcs.localmodification=This file has local modifications
isisfish.season.toString=season %1$s-%2$s
isisfish.selectivity.equation=Equation
isisfish.selectivity.selectPopulation=Select a population
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-11-04 18:14:13 UTC (rev 2738)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-11-04 18:15:48 UTC (rev 2739)
@@ -22,7 +22,6 @@
Can't\ read\ ssh\ key\ \:\ %s=
Can't\ simulate\ %s=
Check\ state\ of\ local\ repository\:\ %s=
-Checkout\ pom.xml\ to\ %s=
Command\ '%s'\ fail\ to\ execute=
Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
Error\ during\ vcs\ initialisation=
@@ -164,7 +163,6 @@
isisfish.config.main.locale.description=la locale utilisateur
isisfish.config.main.login.description=le login pour se connecter au serveur de simulations distant
isisfish.config.main.password.description=le mot de passe pour se connecter au serveur de simulations distant
-isisfish.config.main.projectName.description=le nom du projet
isisfish.config.main.regionMap.description=le nom du r\u00E9pertoire contenant les maps d'une r\u00E9gion
isisfish.config.main.remoteCaparmor.description=lance les simulations sur un serveur distant
isisfish.config.main.resultExport.description=TODO
@@ -202,10 +200,8 @@
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 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
isisfish.config.vcs.type.description=le type de communication vcs utilis\u00E9
-isisfish.config.vcs.typeRepo.description=le type de r\u00E9pository vcs utilis\u00E9
isisfish.config.vcs.useSshConnexion.description=pour indiquer si l'on utilise une connexion s\u00E9curis\u00E9e pour communiquer avec le serveur vcs (ssh2)
isisfish.config.vcs.userName.description=le login de l'utilisateur sur le serveur vcs
isisfish.config.vcs.userPassword.description=
@@ -284,7 +280,6 @@
isisfish.error.import.file=Can't import file %1$s
isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
isisfish.error.init.map=Can't init map.
-isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
isisfish.error.input.addentity=Impossible d'ajouter l'entit\u00E9 "%s"
isisfish.error.input.cancelentity=Impossible d'annuler les modifications
isisfish.error.input.createentity=Impossible de cr\u00E9er une nouvelle entit\u00E9
@@ -614,7 +609,6 @@
isisfish.message.copy.finished=Copie termin\u00E9e
isisfish.message.copy.region=Copier la r\u00E9gion
isisfish.message.creating.region=En train de cr\u00E9er la r\u00E9gion %1$s
-isisfish.message.creation.done=Cr\u00E9ation termin\u00E9e %1$s
isisfish.message.creation.finished=Cr\u00E9ation termin\u00E9e
isisfish.message.delete.canceled=Suppression annul\u00E9e
isisfish.message.delete.entities=Supprimer les entit\u00E9s
@@ -671,7 +665,6 @@
isisfish.message.simulation.execution=Simulation execution
isisfish.message.simulation.prepare=Pr\u00E9paration de la simulation
isisfish.message.tray.disabled=Icone de notification d\u00E9sactiv\u00E9e
-isisfish.message.update.finished=Mise \u00E0 jour termin\u00E9e
isisfish.metier.comments=Commentaires
isisfish.metier.name=Nom
isisfish.metier.rangeValues=Param\u00E8tre d'engin
@@ -944,8 +937,6 @@
isisfish.script.save=Sauver
isisfish.script.save.tooltip=Sauve le script
isisfish.script.title=Editeur de scripts
-isisfish.script.vcs.localaddition=Ce fichier n'est pas pr\u00E9sent sur le d\u00E9p\u00F4t
-isisfish.script.vcs.localmodification=Ce fichier a des moficiations locale
isisfish.season.toString=saison %1$s-%2$s
isisfish.selectivity.equation=Equation
isisfish.selectivity.selectPopulation=S\u00E9lectionnez une population
1
0
r2738 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . input sensitivity simulator
by chatellier@users.labs.libre-entreprise.org 04 Nov '09
by chatellier@users.labs.libre-entreprise.org 04 Nov '09
04 Nov '09
Author: chatellier
Date: 2009-11-04 18:14:13 +0000 (Wed, 04 Nov 2009)
New Revision: 2738
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomePanelUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
Log:
Replace JaxxMatrixEditor by MatrixPanelEditor and use proper jaxx change events.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomePanelUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomePanelUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomePanelUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -18,12 +18,26 @@
*##%*/
-->
<JPanel layout='{new BorderLayout()}'>
- <script>
- <![CDATA[
- public void setContent(Container c) {
+ <script><![CDATA[
+
+ protected WelcomeSaveVerifier getVerifier() {
+ return getContextValue(WelcomeSaveVerifier.class);
+ }
+
+ public void setContent(Component c) {
this.add(c, BorderLayout.CENTER);
}
+ public void close(JFrame f) {
+ if (getVerifier().allIsSaved()) {
+ exit(f);
+ }
+ }
+
+ protected void exit(JFrame f) {
+ f.dispose();
+ }
+
/**
* Change status message and stop progress bar if running.
*
@@ -42,20 +56,6 @@
public void setStatusMessage(String message, boolean running) {
statusBar.setStatusMessage(message, running);
}
-
- public void close(JFrame f) {
- if (getVerifier().allIsSaved()) {
- exit(f);
- }
- }
-
- protected void exit(JFrame f) {
- f.dispose();
- }
-
- protected WelcomeSaveVerifier getVerifier() {
- return getContextValue(WelcomeSaveVerifier.class);
- }
]]>
</script>
<StatusBarUI id='statusBar' constraints="BorderLayout.SOUTH" />
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -25,34 +25,35 @@
import fr.ifremer.isisfish.ui.input.InputAction;
import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
- // chatellier already done in SimulAction constructor
- //simulUI.getContextValue(SimulAction.class).init();
-
- //queueUI.setContextValue(simulUI.getContextValue(SimulAction.class));
- public void selTab(int i){
- simulTabs.setSelectedIndex(i);
+ /** Change tab selection. */
+ public void setQueueTabSelection() {
+ simulTabs.setSelectedIndex(5);
}
- public void refresh() {
+
+ /*public void refresh() {
simulUI.refresh();
sensitivityUI.refresh();
- }
+ }*/
]]>
</script>
<JTabbedPane id="simulTabs" tabPlacement='{JTabbedPane.LEFT}' constraints="BorderLayout.CENTER">
<tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/book.gif"))}'>
- <fr.ifremer.isisfish.ui.input.InputUI id='inputUI' constructorParams='new JAXXInitialContext().add(getContextValue(WelcomeSaveVerifier.class)).add(new InputAction()).add(new InputSaveVerifier()).add(this)'/>
+ <fr.ifremer.isisfish.ui.input.InputUI id='inputUI'
+ constructorParams='new JAXXInitialContext().add(getContextValue(WelcomeSaveVerifier.class)).add(new InputAction()).add(new InputSaveVerifier())' />
</tab>
<tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/simulation.gif"))}'>
- <fr.ifremer.isisfish.ui.simulator.SimulUI id='simulUI' constructorParams='new JAXXInitialContext().add(new SimulAction()).add(this)'/>
+ <fr.ifremer.isisfish.ui.simulator.SimulUI id='simulUI'
+ constructorParams='new JAXXInitialContext().add(new SimulAction()).add(this)' />
</tab>
<tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/sensitivities.gif"))}'>
- <fr.ifremer.isisfish.ui.sensitivity.SensitivityUI id="sensitivityUI" constructorParams='new JAXXInitialContext().add(new InputAction()).add(new InputSaveVerifier()).add(new SimulAction()).add(this)'/>
+ <fr.ifremer.isisfish.ui.sensitivity.SensitivityUI id="sensitivityUI"
+ constructorParams='new JAXXInitialContext().add(new InputAction()).add(new InputSaveVerifier()).add(new SimulAction()).add(this)' />
</tab>
<tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/calc.gif"))}'>
- <fr.ifremer.isisfish.ui.result.ResultView/>
+ <fr.ifremer.isisfish.ui.result.ResultView />
</tab>
<tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/bookPage.gif"))}'>
- <fr.ifremer.isisfish.ui.script.ScriptUI/>
+ <fr.ifremer.isisfish.ui.script.ScriptUI />
</tab>
<tab title=' ' icon='{new ImageIcon(getClass().getResource("/images/Queue.gif"))}'>
<fr.ifremer.isisfish.ui.queue.QueueUI />
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -55,15 +55,19 @@
toolTipManager.setInitialDelay(0);
toolTipManager.setDismissDelay(60000);
- protected void openFrame(Container c, String title) {
+ protected void openFrame(Component c, String title) {
JFrame f = new JFrame();
f.setLayout(new BorderLayout());
- WelcomePanelUI welcome = new WelcomePanelUI(new JAXXInitialContext().add(verifier).add(this));
+
+ JAXXInitialContext childContext = new JAXXInitialContext().add(verifier).add(this);
+ WelcomePanelUI welcome = new WelcomePanelUI(childContext);
+
welcome.setContent(c);
f.add(welcome, BorderLayout.CENTER);
f.setTitle(title);
f.setSize(new Dimension(800, 600));
f.setDefaultCloseOperation(f.DO_NOTHING_ON_CLOSE);
+
allFrameOpened.put(f, welcome);
f.addWindowListener(new WindowAdapter() {
@Override
@@ -72,6 +76,7 @@
allFrameOpened.get(f).close(f);
}
});
+ org.nuiton.widget.SwingUtil.center(f);
f.setVisible(true);
}
public void close() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -23,20 +23,15 @@
<fr.ifremer.isisfish.entities.PopulationImpl id='bean' javaBean='null'/>
<script><![CDATA[
-
import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.PopulationImpl;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
-MatrixPanelListener listener = new MatrixPanelListener() {
- @Override
- public void matrixChanged(MatrixPanelEvent event) {
- if (getBean() != null && fieldPopulationCapturability.getMatrix() != null) {
- getBean().setCapturability(fieldPopulationCapturability.getMatrix().copy());
- }
+protected void populationCapturabilityMatrixChanged(MatrixPanelEvent event) {
+ if (getBean() != null && fieldPopulationCapturability.getMatrix() != null) {
+ getBean().setCapturability(fieldPopulationCapturability.getMatrix().copy());
}
-};
+}
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -64,13 +59,13 @@
if (getBean() != null){
if (getBean().getCapturability() != null) {
- fieldPopulationCapturability.removeMatrixPanelListener(listener);
+ //fieldPopulationCapturability.removeMatrixPanelListener(listener);
fieldPopulationCapturability.setMatrix(getBean().getCapturability().copy());
}
}
// TODO add only once, not at all refresh
- fieldPopulationCapturability.addMatrixListener(listener);
+ //fieldPopulationCapturability.addMatrixListener(listener);
}
@Override
@@ -88,9 +83,10 @@
</row>
<row>
<cell columns='2' fill='both' weightx='1.0' weighty='0.5'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id ='fieldPopulationCapturability'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationCapturability'
matrix='{getBean().getCapturability() == null ? null : getBean().getCapturability().copy()}'
- enabled='{isActif()}' decorator='boxed' _bean='{PopulationImpl.class}' _method='"Capturability"'/>
+ enabled='{isActif()}' decorator='boxed' _bean='{PopulationImpl.class}' _method='"Capturability"'
+ onMatrixChanged="populationCapturabilityMatrixChanged(event)" />
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -43,7 +43,6 @@
import fr.ifremer.isisfish.entities.PopulationImpl;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
addPropertyChangeListener("populationGroup", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -177,9 +176,9 @@
<JLabel text="isisfish.populationGroup.naturalDeathRate" enabled='{isPopGroupNotNull()}'/>
</cell>
<cell columns='2' fill='both' weightx='1.0' weighty='0.5'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id='fieldPopulationGroupNaturalDeathRate'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id='fieldPopulationGroupNaturalDeathRate'
enabled='false' decorator='boxed' _bean='{PopulationImpl.class}' _method='"NaturalDeathRateMatrix"' />
- <!-- this bindings totaly break UI
+ <!-- this bindings totally break UI
matrix='{getBean() == null || getPopulationGroup() == null ? null : ((AbstractMatrixND)getBean().getNaturalDeathRateMatrix()).getSubMatrixOnSemantic(0, getPopulationGroup())}' -->
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -34,13 +34,10 @@
import fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.PopulationGroup;
import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
import fr.ifremer.isisfish.entities.Zone;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -91,8 +88,7 @@
remove.setEnabled(false);
setAddButton();
- // TODO add listener only once
- populationMigrationEmigrationTable.addMatrixListener(new MatrixPanelListener() {
+ /*populationMigrationEmigrationTable.addMatrixListener(new MatrixPanelListener() {
@Override
public void matrixChanged(MatrixPanelEvent arg0) {
remove.setEnabled(populationMigrationEmigrationTable.getTable().getSelectedRow() != -1);
@@ -100,8 +96,16 @@
popInfo.setMigrationMatrix(populationMigrationEmigrationTable.getMatrix().clone());
}
}
- });
+ });*/
}
+
+ protected void populationMigrationEmigrationMatrixChanged(MatrixPanelEvent event) {
+ remove.setEnabled(populationMigrationEmigrationTable.getTable().getSelectedRow() != -1);
+ if (popInfo != null){
+ popInfo.setMigrationMatrix(populationMigrationEmigrationTable.getMatrix().clone());
+ }
+ }
+
protected void setFieldPopulationMigrationMigrationGroupChooserModel(){
if (getBean() != null && getBean().getPopulationGroup() != null){
jaxx.runtime.SwingUtil.fillComboBox(fieldPopulationMigrationEmigrationGroupChooser,getBean().getPopulationGroup(), null, true);
@@ -120,35 +124,35 @@
Double.parseDouble(fieldPopulationMigrationEmigrationCoefficient.getText()));
populationMigrationEmigrationTable.setMatrix(getPopInfo().getEmigrationMatrix().clone());
}
- protected void remove(){
+
+ protected void remove() {
+ log.debug("removeEmigration called");
+ try {
+ int row = populationMigrationEmigrationTable.getTable().getSelectedRow();
+ Object group = populationMigrationEmigrationTable.getTable().getValueAt(row, 0);
+ Object departure = populationMigrationEmigrationTable.getTable().getValueAt(row, 1);
- log.debug("removeEmigration called");
- try {
- int row = populationMigrationEmigrationTable.getTable().getSelectedRow();
- Object group = populationMigrationEmigrationTable.getTable().getValueAt(row, 0);
- Object departure = populationMigrationEmigrationTable.getTable().getValueAt(row, 1);
-
- MatrixND mat = popInfo.getEmigrationMatrix().clone();
- mat.setValue(group, departure, 0);
- popInfo.setEmigrationMatrix(mat);
- remove.setEnabled(false);
- }catch(Exception eee){
- log.error("Can't remove migration", eee);
- }
+ MatrixND mat = popInfo.getEmigrationMatrix().clone();
+ mat.setValue(group, departure, 0);
+ popInfo.setEmigrationMatrix(mat);
+ remove.setEnabled(false);
+ } catch(Exception eee) {
+ log.error("Can't remove migration", eee);
+ }
}
- protected void groupChanged(){
+ protected void groupChanged() {
setGPopSelected(fieldPopulationMigrationEmigrationGroupChooser.getSelectedItem() != null);
setAddButton();
}
- protected void coefChanged(){
+ protected void coefChanged() {
setCoefNonVide(!fieldPopulationMigrationEmigrationCoefficient.getText().equals(""));
setAddButton();
}
- protected void zoneChanged(){
+ protected void zoneChanged() {
setZoneDepartSelected(fieldPopulationMigrationEmigrationDepartureZoneChooser.getSelectedItem() != null);
setAddButton();
}
- protected void setAddButton(){
+ protected void setAddButton() {
add.setEnabled(getGPopSelected() && getZoneDepartSelected() && getCoefNonVide());
}
]]>
@@ -186,7 +190,9 @@
</row>
<row columns='4'>
<cell fill='both' weightx='1.0' weighty='1.0'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id ='populationMigrationEmigrationTable' linearModel="true" enabled='{isActif()}'/>
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id ='populationMigrationEmigrationTable'
+ linearModel="true" enabled='{isActif()}'
+ onMatrixChanged="populationMigrationEmigrationMatrixChanged(event)" />
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -39,7 +39,6 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -61,15 +60,22 @@
remove.setEnabled(populationMigrationImmigrationTable.getTable().getSelectedRow() != -1);
}
});
-populationMigrationImmigrationTable.addMatrixListener(new MatrixPanelListener() {
+
+/*populationMigrationImmigrationTable.addMatrixListener(new MatrixPanelListener() {
@Override
public void matrixChanged(MatrixPanelEvent arg0) {
- if (getPopInfo() != null){
+ if (getPopInfo() != null) {
getPopInfo().setImmigrationMatrix(populationMigrationImmigrationTable.getMatrix().clone());
}
}
-});
+});*/
+protected void populationMigrationImmigrationMatrixChanged(MatrixPanelEvent event) {
+ if (getPopInfo() != null){
+ getPopInfo().setImmigrationMatrix(populationMigrationImmigrationTable.getMatrix().clone());
+ }
+}
+
public void init(PopulationSeasonInfo pi) {
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
@@ -177,7 +183,9 @@
</row>
<row columns='4'>
<cell fill='both' weightx='1.0' weighty='1.0'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id='populationMigrationImmigrationTable' linearModel="true" enabled='{isActif()}'/>
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id='populationMigrationImmigrationTable'
+ linearModel="true" enabled='{isActif()}'
+ onMatrixChanged="populationMigrationImmigrationMatrixChanged(event)" />
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -39,7 +39,6 @@
import fr.ifremer.isisfish.entities.Zone;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -61,15 +60,12 @@
remove.setEnabled(populationMigrationMigrationTable.getTable().getSelectedRow() != -1);
}
});
-MatrixPanelListener listener = new MatrixPanelListener() {
- @Override
- public void matrixChanged(MatrixPanelEvent arg0) {
- if (getPopInfo() != null){
- getPopInfo().setMigrationMatrix(populationMigrationMigrationTable.getMatrix().clone());
- }
- }
-};
+protected void populationMigrationMigrationMatrixChanged(MatrixPanelEvent event) {
+ if (getPopInfo() != null) {
+ getPopInfo().setMigrationMatrix(populationMigrationMigrationTable.getMatrix().clone());
+ }
+}
public void init(PopulationSeasonInfo pi) {
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
@@ -100,7 +96,7 @@
setFieldPopulationMigrationMigrationDepartureZoneChooserModel();
setFieldPopulationMigrationMigrationArrivalZoneChooserModel();
- populationMigrationMigrationTable.addMatrixListener(listener);
+ //populationMigrationMigrationTable.addMatrixListener(listener);
remove.setEnabled(false);
setAddButton();
@@ -196,7 +192,9 @@
</row>
<row columns='4'>
<cell fill='both' weightx='1.0' weighty='1.0'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id ='populationMigrationMigrationTable' linearModel='{true}' enabled='{isActif()}'/>
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id ='populationMigrationMigrationTable'
+ linearModel='{true}' enabled='{isActif()}'
+ onMatrixChanged="populationMigrationMigrationMatrixChanged(event)" />
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -23,13 +23,11 @@
<fr.ifremer.isisfish.entities.PopulationImpl id='bean' javaBean='null'/>
<script><![CDATA[
-
import fr.ifremer.isisfish.entities.Equation;
import fr.ifremer.isisfish.entities.Formule;
import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.PopulationImpl;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
import jaxx.runtime.swing.editor.NumberEditor;
addPropertyChangeListener("bean", new PropertyChangeListener() {
@@ -47,16 +45,13 @@
}
});
-MatrixPanelListener listener = new MatrixPanelListener() {
- @Override
- public void matrixChanged(MatrixPanelEvent event) {
- if (getBean() != null){
- if (fieldPopulationRecruitmentDistribution.getMatrix() != null){
- getBean().setRecruitmentDistribution(fieldPopulationRecruitmentDistribution.getMatrix().copy());
- }
+protected void populationRecruitmentDistributionMatrixChanged(MatrixPanelEvent event) {
+ if (getBean() != null){
+ if (fieldPopulationRecruitmentDistribution.getMatrix() != null){
+ getBean().setRecruitmentDistribution(fieldPopulationRecruitmentDistribution.getMatrix().copy());
}
}
-};
+}
@Override
public void refresh() {
@@ -77,7 +72,7 @@
}
// TODO add only once
- fieldPopulationRecruitmentDistribution.addMatrixListener(listener);
+ //fieldPopulationRecruitmentDistribution.addMatrixListener(listener);
}
@Override
@@ -119,9 +114,10 @@
<JLabel text="isisfish.populationRecruitment.recruitmentDistribution" enabled='{isActif()}'/>
</cell>
<cell fill='both' weightx='1.0' weighty='0.5'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id ='fieldPopulationRecruitmentDistribution'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationRecruitmentDistribution'
matrix='{getBean().getRecruitmentDistribution() == null ? null : getBean().getRecruitmentDistribution().copy()}'
- enabled='{isActif()}' decorator='boxed' _bean='{PopulationImpl.class}' _method='"RecruitmentDistribution"'/>
+ enabled='{isActif()}' decorator='boxed' _bean='{PopulationImpl.class}' _method='"RecruitmentDistribution"'
+ onMatrixChanged="populationRecruitmentDistributionMatrixChanged(event)" />
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -33,22 +33,16 @@
import fr.ifremer.isisfish.ui.util.ErrorHelper;
import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.math.matrix.gui.JAXXMatrixEditor;
+import org.nuiton.math.matrix.gui.MatrixPanelEditor;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
-protected MatrixPanelListener matrixPanelListener;
-
-matrixPanelListener = new MatrixPanelListener() {
- @Override
- public void matrixChanged(MatrixPanelEvent event) {
- if (getPopulationSeasonInfo() != null && matrixPanelPopulationSeasonLengthChange.getMatrix() != null) {
- // must be a copy for fire event
- MatrixND lengthChangeMatrix = matrixPanelPopulationSeasonLengthChange.getMatrix().copy();
- getPopulationSeasonInfo().setLengthChangeMatrix(lengthChangeMatrix);
- }
+protected void populationSeasonLengthMatrixChanged(MatrixPanelEvent event) {
+ if (getPopulationSeasonInfo() != null && matrixPanelPopulationSeasonLengthChange.getMatrix() != null) {
+ // must be a copy for fire event
+ MatrixND lengthChangeMatrix = matrixPanelPopulationSeasonLengthChange.getMatrix().copy();
+ getPopulationSeasonInfo().setLengthChangeMatrix(lengthChangeMatrix);
}
-};
+}
/*addPropertyChangeListener("populationSeasonInfo", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -64,7 +58,7 @@
@Override
public void refresh() {
// TODO add only once
- matrixPanelPopulationSeasonLengthChange.addMatrixListener(matrixPanelListener);
+ //matrixPanelPopulationSeasonLengthChange.addMatrixListener(matrixPanelListener);
}
@Override
@@ -110,10 +104,10 @@
protected void showSpacializedMatrixChangeOfGroup() {
PopulationSeasonInfo popInfo = getPopulationSeasonInfo();
MatrixND lengthChangeMatrix = popInfo.getLengthChangeMatrix();
- if (popInfo.getSimpleLengthChangeMatrix()){
+ if (popInfo.getSimpleLengthChangeMatrix()) {
lengthChangeMatrix = popInfo.spacializeLengthChangeMatrix(lengthChangeMatrix);
}
- JAXXMatrixEditor panel = new JAXXMatrixEditor(false, 800, 300);
+ MatrixPanelEditor panel = new MatrixPanelEditor(false, 800, 300);
panel.setMatrix(lengthChangeMatrix);
JOptionPane.showMessageDialog(null, panel, _("isisfish.populationSeasons.spacialized.visualisation"), JOptionPane.INFORMATION_MESSAGE);
}
@@ -161,11 +155,12 @@
<Panel/>
</cell>
<cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id='matrixPanelPopulationSeasonLengthChange'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id='matrixPanelPopulationSeasonLengthChange'
enabled='{isPopSeasonInfoNotNull()}'
_bean='{PopulationSeasonInfoImpl.class}' _method='"LengthChangeMatrix"'
visible='{isAgeGroupType()}' decorator='boxed'
- matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix().copy()}' />
+ matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix().copy()}'
+ onMatrixChanged="populationSeasonLengthMatrixChanged(event)" />
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -37,9 +37,8 @@
import fr.ifremer.isisfish.ui.widget.IntervalPanel;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
-protected MatrixPanelListener matrixPanelListener;
+//protected MatrixPanelListener matrixPanelListener;
protected Interval seasonInterval;
protected boolean init = false;
@@ -104,7 +103,7 @@
}
});
-matrixPanelListener = new MatrixPanelListener() {
+/*matrixPanelListener = new MatrixPanelListener() {
@Override
public void matrixChanged(MatrixPanelEvent event) {
if (getPopulationSeasonInfo() != null && fieldPopulationSeasonReproductionDistribution.getMatrix() != null) {
@@ -115,8 +114,18 @@
getPopulationSeasonInfo().setReproductionDistribution(reproductionDistribution);
}
}
-};
+};*/
+protected void populationSeasonReproductionDistributionMatrixChanged(MatrixPanelEvent event) {
+ if (getPopulationSeasonInfo() != null && fieldPopulationSeasonReproductionDistribution.getMatrix() != null) {
+ MatrixND reproductionDistribution = fieldPopulationSeasonReproductionDistribution.getMatrix().copy();
+ if (log.isDebugEnabled()) {
+ log.debug("Matrix ReproductionDistribution modified : " + reproductionDistribution);
+ }
+ getPopulationSeasonInfo().setReproductionDistribution(reproductionDistribution);
+ }
+}
+
@Override
public void refresh() {
if (!isActif()) {
@@ -143,7 +152,7 @@
seasonIntervalPanel.setLabelRenderer(Month.MONTH);
seasonIntervalPanel.setModel(seasonInterval);
- fieldPopulationSeasonReproductionDistribution.addMatrixListener(matrixPanelListener);
+ //fieldPopulationSeasonReproductionDistribution.addMatrixListener(matrixPanelListener);
if(getPopulationSeasonInfo() != null) {
PopulationSeasonInfoImpl popInfo = getPopulationSeasonInfo();
@@ -297,11 +306,12 @@
visible='{getPopulationSeasonInfo().getReproduction()}'/>
</cell>
<cell fill='both' weightx='1.0' weighty='0.2'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id='fieldPopulationSeasonReproductionDistribution'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id='fieldPopulationSeasonReproductionDistribution'
matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getReproductionDistribution().copy()}'
enabled='{isPopSeasonInfoNotNull()}'
visible='{getPopulationSeasonInfo().getReproduction()}'
- decorator='boxed' _bean='{PopulationSeasonInfoImpl.class}' _method='"ReproductionDistribution"'/>
+ decorator='boxed' _bean='{PopulationSeasonInfoImpl.class}' _method='"ReproductionDistribution"'
+ onMatrixChanged="populationSeasonReproductionDistributionMatrixChanged(event)" />
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -26,23 +26,27 @@
import fr.ifremer.isisfish.entities.Zone;
import fr.ifremer.isisfish.ui.input.population.ZoneListModel;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
-MatrixPanelListener listener = new MatrixPanelListener() {
+/*MatrixPanelListener listener = new MatrixPanelListener() {
@Override
public void matrixChanged(MatrixPanelEvent event) {
fieldPopulationMappingZoneReproZoneRecruChanged();
}
-};
+};*/
+protected void populationMappingZoneReproZoneRecruMatrixChanged(MatrixPanelEvent event) {
+ //fieldPopulationMappingZoneReproZoneRecruChanged();
+ getBean().setMappingZoneReproZoneRecru(fieldPopulationMappingZoneReproZoneRecru.getMatrix().clone());
+}
+
@Override
public void refresh(){
setPopulationZonesPresenceModel();
setFieldPopulationZonesReproductionModel(getSelectedValues(populationZonesPresence));
setFieldPopulationZonesRecruitmentModel(getSelectedValues(populationZonesPresence));
- fieldPopulationMappingZoneReproZoneRecru.removeMatrixPanelListener(listener);
+ //fieldPopulationMappingZoneReproZoneRecru.removeMatrixPanelListener(listener);
setFieldPopulationMappingZoneReproZoneRecru();
- fieldPopulationMappingZoneReproZoneRecru.addMatrixListener(listener);
+ //fieldPopulationMappingZoneReproZoneRecru.addMatrixListener(listener);
}
@Override
@@ -50,9 +54,9 @@
}
-protected void fieldPopulationMappingZoneReproZoneRecruChanged(){
+/*protected void fieldPopulationMappingZoneReproZoneRecruChanged(){
getBean().setMappingZoneReproZoneRecru(fieldPopulationMappingZoneReproZoneRecru.getMatrix());
-}
+}*/
protected void setFieldPopulationMappingZoneReproZoneRecru(){
if (getBean() != null){
if (getBean().getMappingZoneReproZoneRecru() != null){
@@ -153,7 +157,9 @@
</row>
<row>
<cell columns='3' fill='both' weightx='1.0' weighty='0.5'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id='fieldPopulationMappingZoneReproZoneRecru' constructorParams='false' enabled='{isActif()}'/>
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id='fieldPopulationMappingZoneReproZoneRecru'
+ constructorParams='false' enabled='{isActif()}'
+ onMatrixChanged="populationMappingZoneReproZoneRecruMatrixChanged(event)" />
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyOneMonthInfoUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -30,15 +30,14 @@
import fr.ifremer.isisfish.entities.Strategy;
import fr.ifremer.isisfish.entities.StrategyImpl;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
-import org.nuiton.math.matrix.gui.MatrixPanelListener;
import jaxx.runtime.swing.editor.NumberEditor;
import fr.ifremer.isisfish.entities.TripType;
-protected MatrixPanelListener matrixListener;
+//protected MatrixPanelListener matrixListener;
protected int month = 0;
-matrixListener = new MatrixPanelListener() {
+/*matrixListener = new MatrixPanelListener() {
@Override
public void matrixChanged(MatrixPanelEvent event) {
if (getStrategyMonthInfo() != null && fieldStrategyMonthInfoProportion.getMatrix() != null) {
@@ -47,8 +46,15 @@
}
}
};
-fieldStrategyMonthInfoProportion.addMatrixListener(matrixListener);
+fieldStrategyMonthInfoProportion.addMatrixListener(matrixListener);*/
+protected void strategyMonthInfoProportionMatrixChanged(MatrixPanelEvent event) {
+ if (getStrategyMonthInfo() != null && fieldStrategyMonthInfoProportion.getMatrix() != null) {
+ log.debug("Matrix modified : " + fieldStrategyMonthInfoProportion.getMatrix());
+ getStrategyMonthInfo().setProportionMetier(fieldStrategyMonthInfoProportion.getMatrix().copy());
+ }
+}
+
@Override
public void refresh() {
Strategy strategy = (Strategy)getVerifier().getEntity(Strategy.class);
@@ -147,8 +153,9 @@
</row>
<row>
<cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id="fieldStrategyMonthInfoProportion" linearModelShowDefault='{true}'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id="fieldStrategyMonthInfoProportion" linearModelShowDefault='{true}'
linearModel='{true}' matrix='{getStrategyMonthInfo().getProportionMetier() == null ? null : getStrategyMonthInfo().getProportionMetier().copy()}'
+ onMatrixChanged="strategyMonthInfoProportionMatrixChanged(event)"
enabled='{isActif()}' decorator='boxed' _bean='{fr.ifremer.isisfish.entities.StrategyMonthInfoImpl.class}' _method='"ProportionMetier"'/>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-11-04 18:14:13 UTC (rev 2738)
@@ -49,7 +49,7 @@
import jaxx.runtime.JAXXInitialContext;
import jaxx.runtime.swing.JAXXList;
import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.math.matrix.gui.JAXXMatrixEditor;
+import org.nuiton.math.matrix.gui.MatrixPanelEditor;
import org.nuiton.topia.persistence.TopiaEntity;
import fr.ifremer.isisfish.ui.input.RangeOfValuesUI;
import fr.ifremer.isisfish.ui.input.SelectivityEditorUI;
@@ -93,7 +93,7 @@
} else if (result instanceof MatrixEditor) {
MatrixEditor ui = (MatrixEditor) c;
MatrixND m = (MatrixND) callMethod(e, fieldName);
- JAXXMatrixEditor matrix = new JAXXMatrixEditor(false);
+ MatrixPanelEditor matrix = new MatrixPanelEditor(false);
if (m != null) {
matrix.setMatrix(m.clone());
}
@@ -342,7 +342,7 @@
} else if (result instanceof MatrixEditor) {
MatrixEditor ui = (MatrixEditor) c;
MatrixND m = (MatrixND) value;
- JAXXMatrixEditor matrix = new JAXXMatrixEditor(false);
+ MatrixPanelEditor matrix = new MatrixPanelEditor(false);
if (m != null) {
matrix.setMatrix(m.clone());
}
@@ -491,8 +491,8 @@
} else if (c instanceof JTable) {
// ((JTable) result).setText(BeanUtils.getProperty(e, fieldName));
- } else if (c instanceof JAXXMatrixEditor) {
- result = ((JAXXMatrixEditor) c).getMatrix();
+ } else if (c instanceof MatrixPanelEditor) {
+ result = ((MatrixPanelEditor) c).getMatrix();
} else if (c instanceof JComboBox) {
result = ((JComboBox) c).getSelectedItem();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx 2009-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -27,7 +27,7 @@
<JLabel text='isisfish.factor.value' visible='{isContinuePossible()}' enabled='{isContinueSelected()}'/>
</cell>
<cell fill='both' weightx='1' weighty='1'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id='componentPanel' dimensionEdit='{false}'
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id='componentPanel' dimensionEdit='{false}'
matrix='{getMatrix() == null ? null : getMatrix().clone()}' visible='{isContinuePossible()}'
enabled='{isContinueSelected()}'/>
</cell>
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-11-04 13:46:52 UTC (rev 2737)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2009-11-04 18:14:13 UTC (rev 2738)
@@ -198,15 +198,14 @@
if (!isSensitivity()) {
simulAction.launchSimulation(fieldSimulParamsName.getText(), (SimulatorLauncher)comboSelLauncher.getSelectedItem());
}
- else{
+ else {
simulAction.launchSimulationWhithSensibility(fieldSimulParamsName.getText(), (SimulatorLauncher)comboSelLauncher.getSelectedItem());
}
// dans le cas d'une fenetre independante, il n'y a pas de ParentContainer
WelcomeTabUI parent = getParentContainer(WelcomeTabUI.class);
if (parent != null) {
- // 5 = queue simulation tab
- parent.selTab(5);
+ parent.setQueueTabSelection();
}
}
protected void enablePreSimul() {
@@ -577,7 +576,7 @@
<cell columns="4" fill="both" weightx="1.0" weighty="0.6">
<JTabbedPane id="parametersTabbedPane" minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
<tab title='{_("isisfish.params.populationNumbers")}'>
- <org.nuiton.math.matrix.gui.JAXXMatrixEditor id="simulParamsNumbers" name="isisfish.params.populationNumbers"/>
+ <org.nuiton.math.matrix.gui.MatrixPanelEditor id="simulParamsNumbers" name="isisfish.params.populationNumbers"/>
</tab>
<tab title='{_("isisfish.params.ruleParameters")}'>
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
1
0
Author: chatellier
Date: 2009-11-04 13:46:52 +0000 (Wed, 04 Nov 2009)
New Revision: 2737
Modified:
isis-fish/trunk/pom.xml
Log:
Fix repo url
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-11-03 08:52:12 UTC (rev 2736)
+++ isis-fish/trunk/pom.xml 2009-11-04 13:46:52 UTC (rev 2737)
@@ -680,7 +680,7 @@
<scm>
<connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/trunk</connection>
<developerConnection>scm:svn:svn+ssh://chatellier at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/trunk</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/isis-fish/trunk…</url>
+ <url>https://labs.libre-entreprise.org/scm/viewvc.php/isis-fish/trunk/?root=isis…</url>
</scm>
<repositories>
1
0
Author: chatellier
Date: 2009-11-03 08:52:12 +0000 (Tue, 03 Nov 2009)
New Revision: 2736
Modified:
isis-fish/trunk/pom.xml
Log:
Swingx version bump.
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-11-02 16:55:21 UTC (rev 2735)
+++ isis-fish/trunk/pom.xml 2009-11-03 08:52:12 UTC (rev 2736)
@@ -208,7 +208,7 @@
<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swingx</artifactId>
- <version>1.0</version>
+ <version>1.6</version>
<scope>compile</scope>
</dependency>
1
0
Author: chatellier
Date: 2009-11-02 16:55:21 +0000 (Mon, 02 Nov 2009)
New Revision: 2735
Modified:
isis-fish/trunk/changelog.txt
Log:
Update changelog
Modified: isis-fish/trunk/changelog.txt
===================================================================
--- isis-fish/trunk/changelog.txt 2009-11-02 16:53:44 UTC (rev 2734)
+++ isis-fish/trunk/changelog.txt 2009-11-02 16:55:21 UTC (rev 2735)
@@ -1,5 +1,7 @@
isis-fish (3.3.0.0) stable; urgency=low
+ * Remove some deprecated unused UI classes
+ * Remove all GenericCell reference (now model based implementation)
* Add missing log category in simulation filter appender
* Add -m n option to qsub to not send email for each simulation
* Remove duplicated SSH key configuration, common configuration for VCS and caparmor
1
0
r2734 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: input sensitivity util
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 16:53:44 +0000 (Mon, 02 Nov 2009)
New Revision: 2734
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUtils.java
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/util/UtilsUI.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx
Log:
Move UtilsUI to SensitivityUtils since it's sensitivity specific code.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx 2009-11-02 16:39:25 UTC (rev 2733)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx 2009-11-02 16:53:44 UTC (rev 2734)
@@ -59,7 +59,7 @@
import fr.ifremer.isisfish.entities.FisheryRegion;
import org.nuiton.topia.persistence.TopiaEntity;
import javax.swing.JComponent;
-import fr.ifremer.isisfish.ui.util.UtilsUI;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityUtils;
import fr.ifremer.isisfish.ui.sensitivity.FactorWizardUI;
import fr.ifremer.isisfish.ui.sensitivity.EditorHelper;
import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabbedPaneListener;
@@ -133,7 +133,7 @@
String method = (String)boxed.getClientProperty("method");
boolean isSensitivityFactorEnabled = false;
if (classBean != null) {
- isSensitivityFactorEnabled = UtilsUI.isSensitivityFactorEnabled(classBean.getSimpleName().replace("Impl", "") + "." + method);
+ isSensitivityFactorEnabled = SensitivityUtils.isSensitivityFactorEnabled(classBean.getSimpleName().replace("Impl", "") + "." + method);
}
if (isSensitivityFactorEnabled) {
jaxx.runtime.swing.BlockingLayerUI2 ui = layerUI2.clone();
Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUtils.java (from rev 2668, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/util/UtilsUI.java)
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUtils.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUtils.java 2009-11-02 16:53:44 UTC (rev 2734)
@@ -0,0 +1,94 @@
+/* *##%
+ * 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
+ * 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.sensitivity;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Properties;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Utility class to parse Sensitivity properties file.
+ *
+ * @author letellier
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SensitivityUtils {
+
+ /** Log. */
+ private static final Log log = LogFactory.getLog(SensitivityUtils.class);
+
+ /** Properties file resource path. */
+ private final static String PROPERTIES_PATH = "/sensitivity.properties";
+
+ /** Cached properties. */
+ private static Properties sensitivityProperties;
+
+ /**
+ * Is field sensitivity enabled.
+ *
+ * Return true, if field name is present in properties file.
+ *
+ * @param sensitivityFactorName name
+ * @return <tt>true</tt> if factor name is sensitivity enabled
+ */
+ public static boolean isSensitivityFactorEnabled(String sensitivityFactorName) {
+ Properties data = loadProperties();
+ return data.getProperty(sensitivityFactorName) != null;
+
+ }
+
+ /**
+ * Return cached properties file.
+ * Load it at first call.
+ *
+ * @return properties
+ */
+ private static Properties loadProperties() {
+
+ if (sensitivityProperties == null) {
+ sensitivityProperties = new Properties();
+ InputStream stream = null;
+ try {
+ stream = SensitivityUtils.class.getResourceAsStream(PROPERTIES_PATH);
+ sensitivityProperties.load(stream);
+ } catch (IOException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't load sensitivity properties file", ex);
+ }
+ } finally {
+ try {
+ if (stream != null) {
+ stream.close();
+ }
+ } catch (IOException ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't load sensitivity properties file", ex);
+ }
+ }
+ }
+ }
+ return sensitivityProperties;
+ }
+}
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/util/UtilsUI.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/util/UtilsUI.java 2009-11-02 16:39:25 UTC (rev 2733)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/util/UtilsUI.java 2009-11-02 16:53:44 UTC (rev 2734)
@@ -1,94 +0,0 @@
-/* *##%
- * 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
- * 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.util;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.util.Properties;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Utility class to parse Sensitivity properties file.
- *
- * @author letellier
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class UtilsUI {
-
- /** Log. */
- private static final Log log = LogFactory.getLog(UtilsUI.class);
-
- /** Properties file resource path. */
- private final static String PROPERTIES_PATH = "/sensitivity.properties";
-
- /** Cached properties. */
- private static Properties sensitivityProperties;
-
- /**
- * Is field sensitivity enabled.
- *
- * Return true, if field name is present in properties file.
- *
- * @param sensitivityFactorName name
- * @return <tt>true</tt> if factor name is sensitivity enabled
- */
- public static boolean isSensitivityFactorEnabled(String sensitivityFactorName) {
- Properties data = loadProperties();
- return data.getProperty(sensitivityFactorName) != null;
-
- }
-
- /**
- * Return cached properties file.
- * Load it at first call.
- *
- * @return properties
- */
- private static Properties loadProperties() {
-
- if (sensitivityProperties == null) {
- sensitivityProperties = new Properties();
- InputStream stream = null;
- try {
- stream = UtilsUI.class.getResourceAsStream(PROPERTIES_PATH);
- sensitivityProperties.load(stream);
- } catch (IOException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't load sensitivity properties file", ex);
- }
- } finally {
- try {
- if (stream != null) {
- stream.close();
- }
- } catch (IOException ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't load sensitivity properties file", ex);
- }
- }
- }
- }
- return sensitivityProperties;
- }
-}
1
0
r2733 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 16:39:25 +0000 (Mon, 02 Nov 2009)
New Revision: 2733
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/HidablePanel.java
Log:
Not used anymore
Deleted: 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-11-02 16:39:13 UTC (rev 2732)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/HidablePanel.java 2009-11-02 16:39:25 UTC (rev 2733)
@@ -1,42 +0,0 @@
-/* *##%
- * 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.widget;
-
-import javax.swing.JPanel;
-
-/**
- * HidablePanel.
- *
- * Created: 7 mars 2006 22:48:25
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- *
- * @deprecated since 20090414 seams to be unused
- */
-public class HidablePanel extends JPanel {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 4153300672681154582L;
-
-}
1
0
r2732 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: simulator widget
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 16:39:13 +0000 (Mon, 02 Nov 2009)
New Revision: 2732
Removed:
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
Log:
Replaced by jaxx bindings
Deleted: 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-11-02 16:37:16 UTC (rev 2731)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2009-11-02 16:39:13 UTC (rev 2732)
@@ -1,171 +0,0 @@
-/* *##%
- * 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.simulator;
-
-import fr.ifremer.isisfish.simulator.launcher.SimulationService;
-import fr.ifremer.isisfish.ui.widget.EnabledIfListNotEmpty;
-import fr.ifremer.isisfish.ui.widget.EnabledIfItemSelectedInList;
-
-import static org.nuiton.i18n.I18n._;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.JButton;
-import javax.swing.JList;
-import javax.swing.JTable;
-import javax.swing.ListModel;
-
-/**
- * This class contains some listeners used in ui. Some are generics and could
- * be push in a library.
- * <p/>
- * TODO ne fonctionne pas avec l'uitlisation de l'attribut init dans le xml
- * TODO Il faudrait fixer cette anomalie afin de pouvoir directement appelé
- * TODO ce code depuis le xml...
- *
- * @author chemit
- *
- * @deprecated since 20090414, use jaxx bindings instead
- */
-public class SimulatorListeners {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulatorListeners.class);
-
- public static void initAnalysePlanButtonsListener(JButton remove, JList list) {
- initButtonRemoveIfItemSelected(remove, list);
- }
-
- public static void initRuleButtonsListener(JButton remove, JList list) {
- initButtonRemoveIfItemSelected(remove, list);
-
- }
-
-// public static void initSimulQueueButtonsListener(
-// final JButton start, final JButton remove, final JButton showLog,
-// final JTable table, final JTable tableDone) {
-//
-// SimulationService.getService().addPropertyChangeListener("autoLaunch",
-// new PropertyChangeListener() {
-// public void propertyChange(PropertyChangeEvent evt) {
-// start.setEnabled(isSimulStartButtonEnabled(table));
-// }
-// });
-//
-// table.getModel().addTableModelListener(new TableModelListener() {
-// public void tableChanged(TableModelEvent e) {
-// start.setEnabled(isSimulStartButtonEnabled(table));
-// }
-// });
-//
-// table.getSelectionModel().addListSelectionListener(
-// new ListSelectionListener() {
-// public void valueChanged(ListSelectionEvent e) {
-// remove.setEnabled(isSimulRemoveButtonEnabled(table));
-// }
-// });
-//
-// tableDone.getSelectionModel().addListSelectionListener(
-// new ListSelectionListener() {
-// public void valueChanged(ListSelectionEvent e) {
-// showLog.setEnabled(isSimulShowLogButtonEnabled(tableDone));
-// }
-// }
-// );
-//
-// // apply it now
-// start.setEnabled(isSimulStartButtonEnabled(table));
-// remove.setEnabled(isSimulRemoveButtonEnabled(table));
-// showLog.setEnabled(isSimulShowLogButtonEnabled(tableDone));
-// }
-
- public static void initButtonRemoveIfItemSelected(
- final JButton button, final JList list) {
- if (button == null || list == null) {
- log.warn(_("isisfish.error.init.remove.button", button, list));
- return;
- }
- button.setEnabled(list.getSelectedIndex() > -1);
- EnabledIfItemSelectedInList listener = new EnabledIfItemSelectedInList(button, list);
- list.getSelectionModel().addListSelectionListener(listener);
- // apply it now
- listener.setEnabled(button, list);
- }
-
- public static void initButtonClearIfListNotEmpty(
- final JButton button, final ListModel list) {
-
- EnabledIfListNotEmpty listener = new EnabledIfListNotEmpty(list, button);
- list.addListDataListener(listener);
- // apply it now
- listener.setEnabled(button, list);
- }
-
- /**
- * Wonders if user can actually launch simulations based on two criteri :
- * <ul><li> first : simulationManager must not be in autoLaunch mode</li>
- * <li> second : simulation table must not be empty</li></ul>
- *
- * @param table table containing queue of simulations not already done
- * @return <code>true</code> if user can launch simulations,
- * <code>false</code> otherwise
- */
- public static boolean isSimulStartButtonEnabled(JTable table) {
- return !SimulationService.getService().isAutoLaunch() &&
- (table.getRowCount() > 0);
- }
-
- /**
- * Wonders if user can actually stop a simulation on two criteri :
- * <ul><li> first : use must have select a simulation
- * (but not a done one)</li>
- * <li> second : the selected simulation must be running</li></ul>
- *
- * @param table table containing queue of simulations not already done
- * @return <code>true</code> if user can stop the selected simulation,
- * <code>false</code> otherwise
- */
- public static boolean isSimulRemoveButtonEnabled(JTable table) {
- return isItemSelected(table);
- }
-
- /**
- * Wonders if user can actually show log of a done simulation on one criteria :
- * <ul><li> first : use must have select a done simulation
- * (but not a undone one)</li>
- *
- * @param table table containing queue of simulations not already done
- * @return <code>true</code> if user can show log the selected done
- * simulation,<code>false</code> otherwise
- */
- public static boolean isSimulShowLogButtonEnabled(JTable table) {
- return isItemSelected(table);
- }
-
- public static boolean isItemSelected(JTable table) {
- return table.getRowCount() > 0 && table.getSelectedRow() > -1;
- }
-
- public static boolean isItemSelected(JList table) {
- return table.getModel().getSize() > 0 && table.getSelectedIndex() > -1;
- }
-
-}
Deleted: 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-11-02 16:37:16 UTC (rev 2731)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfItemSelectedInList.java 2009-11-02 16:39:13 UTC (rev 2732)
@@ -1,46 +0,0 @@
-/* *##%
- * 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;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.JComponent;
-import javax.swing.JList;
-import javax.swing.JButton;
-
-/**
- * Enable a button if the associated list is not empty.
- */
-public class EnabledIfItemSelectedInList implements ListSelectionListener {
- private final JComponent button;
- private final JList list;
-
- public EnabledIfItemSelectedInList(JButton button, JList list) {
- this.button = button;
- this.list = list;
- }
-
- public void setEnabled(JComponent button, JList list) {
- button.setEnabled(list.getSelectedIndex() > -1);
- }
-
- public void valueChanged(ListSelectionEvent e) {
- setEnabled(button, list);
- }
-}
Deleted: 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-11-02 16:37:16 UTC (rev 2731)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/EnabledIfListNotEmpty.java 2009-11-02 16:39:13 UTC (rev 2732)
@@ -1,59 +0,0 @@
-/* *##%
- * 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;
-import javax.swing.JComponent;
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-
-/**
- * Enable a button if the associated list is not empty.
- */
-public class EnabledIfListNotEmpty implements ListDataListener {
-
- private JComponent target;
- private ListModel list;
-
- public EnabledIfListNotEmpty(ListModel list, JButton target) {
- this.target = target;
- this.list = list;
- }
-
- public void contentsChanged(ListDataEvent e) {
- setEnabled(target, list);
- }
-
- public void intervalAdded(ListDataEvent e) {
- setEnabled(target, list);
- }
-
- public void intervalRemoved(ListDataEvent e) {
- setEnabled(target, list);
- }
-
- public void setEnabled(JComponent button, ListModel list) {
- button.setEnabled(list.getSize() > 0);
- }
-
- public void setTarget(JComponent target) {
- this.target = target;
- }
-}
1
0
r2731 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: input sensitivity
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 16:37:16 +0000 (Mon, 02 Nov 2009)
New Revision: 2731
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx
Log:
Unused imports
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-11-02 16:28:34 UTC (rev 2730)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2009-11-02 16:37:16 UTC (rev 2731)
@@ -31,7 +31,6 @@
import fr.ifremer.isisfish.entities.SetOfVessels;
import org.nuiton.topia.persistence.TopiaEntity;
import fr.ifremer.isisfish.ui.WelcomePanelUI;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
@Override
public void refresh() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx 2009-11-02 16:28:34 UTC (rev 2730)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityChooserUI.jaxx 2009-11-02 16:37:16 UTC (rev 2731)
@@ -21,18 +21,12 @@
<script><![CDATA[
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
- import jaxx.runtime.swing.Item;
- import fr.ifremer.isisfish.datastore.ExportStorage;
- import fr.ifremer.isisfish.datastore.SensitivityStorage;
import fr.ifremer.isisfish.ui.simulator.SimulAction;
- import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
- import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
import fr.ifremer.isisfish.simulator.sensitivity.Domain;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.export.SensitivityExport;
- import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.ui.models.sensitivityexport.SensitivityExportListModel;
import fr.ifremer.isisfish.ui.models.sensitivityexport.SensitivityExportListRenderer;
1
0
r2730 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 16:28:34 +0000 (Mon, 02 Nov 2009)
New Revision: 2730
Removed:
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:
Replaced by model style implementation
Deleted: 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-11-02 16:27:43 UTC (rev 2729)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/GenericCell.java 2009-11-02 16:28:34 UTC (rev 2730)
@@ -1,60 +0,0 @@
-/* *##%
- * 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 $
- *
- * @deprecated since 3.2.0.5, Use specific model instead
- */
-public class GenericCell {
- private String name;
- private Object value;
- private Class<?> type;
-
- public GenericCell(String n, Object c, Class<?> t) {
- name = n;
- value = c;
- type = t;
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- public Object getValue() {
- return value;
- }
-
- public String getName() {
- return name;
- }
-
- public Class<?> getType() {
- return type;
- }
-}
Deleted: 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-11-02 16:27:43 UTC (rev 2729)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterColumnEditor.java 2009-11-02 16:28:34 UTC (rev 2730)
@@ -1,500 +0,0 @@
-/* *##%
- * 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.widget.editor;
-
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusEvent;
-import java.util.ArrayList;
-import java.util.EventObject;
-import java.util.HashSet;
-import java.util.List;
-
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.table.TableCellEditor;
-
-import org.apache.commons.beanutils.ConvertUtilsBean;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.util.MonthEnum;
-import org.nuiton.util.EnumEditor;
-
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.types.Date;
-import fr.ifremer.isisfish.types.Month;
-import fr.ifremer.isisfish.util.ConverterUtil;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusListener;
-
-/**
- * ParameterColumnEditor.
- *
- * Created: 25 sept. 06 12:35:21
- *
- * @author poussin
- * @author chemit
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- *
- * @deprecated since 3.2.0.5, Use specific model instead
- */
-public class ParameterColumnEditor extends JComponent implements
- TableCellEditor {
-
- /** Class logger. */
- private static Log log = LogFactory.getLog(ParameterColumnEditor.class);
-
- private enum TypeClassMapping {
- /**
- * for simple int
- */
- Int(int.class),
- /**
- * for a topia entity
- */
- Topia(TopiaEntity.class),
- /**
- * for a mounth
- */
- Mounth(Month.class),
- /**
- * for a simple date
- */
- Date(Date.class),
- /**
- * for a simple boolean
- */
- Double(double.class),
- /**
- * for a simple boolean
- */
- Boolean(boolean.class),
- /**
- * for a file location
- */
- File(java.io.File.class),
- /**
- * for a simple String
- *
- */
- String(java.lang.String.class);
-
- final Class<?> klazz;
-
- TypeClassMapping(Class<?> klazz) {
- this.klazz = klazz;
- }
-
- protected static TypeClassMapping getMapping(Class<?> klazz) {
- for (TypeClassMapping t : TypeClassMapping.values())
- if (t.klazz.isAssignableFrom(klazz))
- return t;
- throw new RuntimeException(
- "could not found a TypeClassMapping for this class "
- + klazz);
- }
- }
-
- private static final long serialVersionUID = 6860330126841984303L;
-
- protected HashSet<CellEditorListener> listeners = new HashSet<CellEditorListener>();
-
- protected RegionStorage region = null;
-
- protected Component editor = null;
-
- protected Class type = null;
-
- /**
- * @return Returns the topiaContext.
- */
- public RegionStorage getRegion() {
- return this.region;
- }
-
- /**
- * @param region
- * The topiaContext to set.
- */
- public void setRegion(RegionStorage region) {
- this.region = region;
- }
-
- @SuppressWarnings( { "unchecked" })
- public Component getTableCellEditorComponent(JTable table, Object value,
- boolean isSelected, int row, int column) {
- // Map.Entry<String, Class> p = (Map.Entry<String, Class>) table.getValueAt(row, 0);
- // type = p.getValue();
- // log.debug(p.getKey() + " P.type:" + type);
- GenericCell p = (GenericCell) table.getValueAt(row, 0);
- type = (Class) p.getValue();
- JComboBox c;
- //if (!table.hasFocus()) return null;
-
- TypeClassMapping mapping = TypeClassMapping.getMapping(type);
- switch (mapping) {
- case Topia:
- // on a un bean comme parametre
- try {
- if (region == null) {
- return null;
- }
- TopiaContext context = region.getStorage().beginTransaction();
- if (context != null) {
- List list = context.find("from " + type.getName());
- c = new JComboBox(list.toArray());
- c.setSelectedItem(value);
- editor = c;
- context.closeContext();
- }
-
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't get entity object for combobox", eee);
- }
- }
- break;
- case Boolean:
- List<Boolean> listB = new ArrayList<Boolean>();
- listB.add(Boolean.TRUE);
- listB.add(Boolean.FALSE);
- c = new JComboBox(listB.toArray());
- listB.clear();
- // TODO See how to convert
- c.setSelectedItem(value);
- editor = c;
- break;
- case Date:
- Date date = (Date) value;
- if (date == null)
- date = new Date(0);
- int mou = date.getMonth().getMonthNumber();
- int yea = date.getYear();
- editor = new DateComponent(mou, yea, region == null ? null : region
- .getStorage());
- //editor = new JTextField(String.valueOf(date.getDate()));
- break;
- case Mounth:
- editor = DateComponent.createMounthCombo(((Month) value)
- .getMonthNumber(), region == null ? null : region
- .getStorage());
- break;
- case File:
- // break;
- default:
- editor = new JTextField(value.toString());
- }
- if (editor != null) {
- if (JComboBox.class.isInstance(editor)) {
- ((JComboBox) editor).addActionListener(getComboListener());
- } else if (JTextField.class.isInstance(editor)) {
- ((JTextField) editor).addFocusListener(new FocusListener() {
-
- @Override
- public void focusGained(FocusEvent e) {
-
- }
-
- @Override
- public void focusLost(FocusEvent e) {
- stopCellEditing();
- }
- });
- } else if (DateComponent.class.isInstance(editor)) {
- DateComponent date = ((DateComponent) editor);
- if (date.getMounthCombo() != null) {
- date.getMounthCombo().addActionListener(getComboListener());
- }
- if (date.getYearCombo() != null) {
- date.getYearCombo().addActionListener(getComboListener());
- }
- }
- }
- if (log.isInfoEnabled()) {
- log.info("getCellEditorValue [" + type + "] [mapping:" + mapping + "="
- + editor);
- }
- //+ editor==null?null:editor.getClass().getSimpleName());
- return editor;
- }
-
- protected ActionListener getComboListener() {
- return new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- stopCellEditing();
- }
- };
- }
-
- public Object getCellEditorValue() {
-
- Object result = null;
- TopiaContext context = null;
- if (editor == null)
- return "";
- TypeClassMapping mapping = TypeClassMapping.getMapping(type);
- switch (mapping) {
- case Topia:
- result = getComboBoxValue(editor);
- break;
- case Boolean:
- result = getComboBoxValue(editor);
- // TODO test
- break;
- case Mounth:
- result = getComboBoxIndex(editor) + "";
- break;
- case Date:
- result = ((DateComponent) editor).getSelectedValue() + "";
- break;
- case File:
- //TODO
- // result = getTextFieldValue(editor);break;
- default:
- if (editor instanceof JTextField) {
- result = ((JTextField) editor).getText();
- } else if (editor instanceof JComboBox) {
- result = ((JComboBox) editor).getSelectedItem();
- }
- }
-
- if (result instanceof String && !String.class.equals(type)) {
- if (region != null)
- context = region.getStorage();
- ConvertUtilsBean cub = ConverterUtil.getConverter(context);
- result = cub.convert((String) result, type);
- }
-
- if (log.isInfoEnabled()) {
- log.info("getCellEditorValue [" + type + "] [mapping:" + mapping
- + "]= " + result);
- }
-
- return result;
- }
-
- protected Object getTextFieldValue(Component editor) {
- return ((JTextField) editor).getText();
- }
-
- protected Object getComboBoxValue(Component editor) {
- return ((JComboBox) editor).getSelectedItem();
- }
-
- protected int getComboBoxIndex(Component editor) {
- return (((JComboBox) editor)).getSelectedIndex();
- }
-
- public Object getCellEditorValueOld() {
-
- Object result = null;
- if (editor instanceof JTextField) {
- result = ((JTextField) editor).getText();
- } else if (editor instanceof JComboBox) {
- result = ((JComboBox) editor).getSelectedItem();
- }
-
- if (result instanceof String && !String.class.equals(type)) {
- TopiaContext context = null;
- if (region != null) {
- context = region.getStorage();
- }
- ConvertUtilsBean cub = ConverterUtil.getConverter(context);
- result = cub.convert((String) result, type);
- }
-
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.swing.CellEditor#addCellEditorListener(javax.swing.event.CellEditorListener)
- */
- public void addCellEditorListener(CellEditorListener l) {
- listeners.add(l);
- }
-
- /*
- * @see javax.swing.CellEditor#cancelCellEditing()
- */
- public void cancelCellEditing() {
- if (log.isDebugEnabled()) {
- log.debug("cancelCellEditing");
- }
- ChangeEvent e = new ChangeEvent(this);
- for (CellEditorListener listener : listeners) {
- listener.editingCanceled(e);
- }
- }
-
- /*
- * @see javax.swing.CellEditor#isCellEditable(java.util.EventObject)
- */
- public boolean isCellEditable(EventObject anEvent) {
- return true;
- }
-
- /*
- * @see javax.swing.CellEditor#removeCellEditorListener(javax.swing.event.CellEditorListener)
- */
- public void removeCellEditorListener(CellEditorListener l) {
- listeners.remove(l);
- }
-
- /*
- * @see javax.swing.CellEditor#shouldSelectCell(java.util.EventObject)
- */
- public boolean shouldSelectCell(EventObject anEvent) {
- return true;
- }
-
- /*
- * @see javax.swing.CellEditor#stopCellEditing()
- */
- public boolean stopCellEditing() {
- // to prevent concurent modification exception
- if (log.isDebugEnabled()) {
- log.debug("stopCellEditing");
- }
- CellEditorListener[] list = listeners
- .toArray(new CellEditorListener[listeners.size()]);
-
- ChangeEvent e = new ChangeEvent(this);
- for (CellEditorListener l : list) {
- l.editingStopped(e);
- }
- return true;
- }
-
- public static class DateComponent extends JPanel {
-
- private static final long serialVersionUID = -6694461572642939712L;
-
- protected JComboBox mounth;
-
- protected JComboBox year;
-
- public DateComponent(int mounth, int year, TopiaContext context) {
- super(new GridLayout(0, 2));
-
- this.mounth = createMounthCombo(mounth, context);
- this.year = createYearCombo(200, year);
-
- this.add(this.mounth);
- this.add(this.year);
- }
-
- public JComboBox getYearCombo() {
- return year;
- }
-
- public JComboBox getMounthCombo() {
- return mounth;
- }
-
- public int getSelectedMounth() {
- return mounth.getSelectedIndex();
- }
-
- public int getSelectedYear() {
- return year.getSelectedIndex();
- }
-
- public void setSelectedValue(int year, int mounth) {
- this.mounth.setSelectedIndex(mounth);
- this.year.setSelectedIndex(year);
- }
-
- public int getSelectedValue() {
- int selectedYear = getSelectedYear();
- int selectedMounth = getSelectedMounth();
- if (log.isInfoEnabled()) {
- log.info("selected mounth " + selectedMounth);
- log.info("selected year " + selectedYear);
- }
- return selectedMounth + selectedYear * 12;
- }
-
- public static JComboBox createMounthCombo(int mounth,
- TopiaContext context) {
- JComboBox combo = EnumEditor.newEditor(MonthEnum.class);
- combo.setSelectedIndex(mounth);
- return combo;
- }
-
- /*public static JComboBox createMounthCombo(int mounth, TopiaContext context) {
- JComboBox combo = createMounthCombo0(context);
- combo.setSelectedIndex(mounth);
- return combo;
- }*/
- /*public static JComboBox createMounthCombo(Object mounth, TopiaContext context) {
- JComboBox combo = createMounthCombo0(context);
- combo.setSelectedItem(mounth);
- return combo;
- }*/
-
- /*private static JComboBox createMounthCombo0(TopiaContext context) {
-
- List<String> listM = new ArrayList<String>();
- // TODO Should use database ? data instead of thoses awfull hardcore
- // code...
- listM.add("janvier");
- listM.add("fevrier");
- listM.add("mars");
- listM.add("avril");
- listM.add("mai");
- listM.add("juin");
- listM.add("juillet");
- listM.add("aout");
- listM.add("septembre");
- listM.add("octobre");
- listM.add("novembre");
- listM.add("decembre");
- JComboBox combo = new JComboBox(listM.toArray());
- listM.clear();
- return combo;
- }*/
-
- public static JComboBox createYearCombo(int nb, int yearS) {
-
- List<Integer> listI = new ArrayList<Integer>();
- for (int i = 0; i < nb; i++)
- listI.add(i);
- JComboBox year = new JComboBox(listI.toArray());
- listI.clear();
- year.setSelectedIndex(yearS);
- return year;
- }
- }
-}
1
0