From chatellier@users.labs.libre-entreprise.org Mon Jun 15 00:26:48 2026
From: chatellier@users.labs.libre-entreprise.org
To: isis-fish-commits@list.isis-fish.org
Subject: [Isis-fish-commits] r3332 - in
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui: input
models/rule sensitivity simulator util
Date: Wed, 18 May 2011 17:54:41 +0200
Message-ID: <20110518155441.BE8992F166@labs.libre-entreprise.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1082485561164501537=="
--===============1082485561164501537==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Author: chatellier
Date: 2011-05-18 15:54:41 +0000 (Wed, 18 May 2011)
New Revision: 3332
Log:
On peut maintenant ajouter des facteurs sur les parametres de regles.
Pas encore utilisable et non utilis?\195?\169.
Added:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/=
RuleParametersFactorTableCellEditor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/=
RuleParametersFactorTableCellRenderer.java
Removed:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/=
SensitivityTabbedPaneListener.java
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputC=
ontentUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/=
RuleParametersTableCellRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/=
RuleParametersTableModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/=
SensitivityInputHandler.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/=
SensitivityTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/=
SensitivityUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/Pa=
ramsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/Ru=
leChooser.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/Si=
mulAction.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/util/ErrorHe=
lper.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input=
/InputContentUI.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/Input=
ContentUI.jaxx 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/Input=
ContentUI.jaxx 2011-05-18 15:54:41 UTC (rev 3332)
@@ -65,7 +65,6 @@
javax.swing.event.ChangeListener
fr.ifremer.isisfish.entities.FisheryRegion
fr.ifremer.isisfish.ui.sensitivity.SensitivityUtils
- fr.ifremer.isisfish.ui.sensitivity.SensitivityTabbedPaneListener
fr.ifremer.isisfish.ui.WelcomePanelUI
org.nuiton.topia.persistence.TopiaEntityContextable
org.nuiton.topia.TopiaContext
@@ -77,8 +76,6 @@
=20
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/r=
ule/RuleParametersFactorTableCellEditor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersFactorTableCellEditor.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersFactorTableCellEditor.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -0,0 +1,125 @@
+/*
+ * #%L
+ * IsisFish
+ *=20
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Code Lutin, Chatellier Eric
+ * %%
+ * 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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program. If not, see
+ * .
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.models.rule;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JTable;
+import javax.swing.table.TableCellEditor;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.Resource;
+
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.ui.simulator.RuleChooser;
+import fr.ifremer.isisfish.ui.simulator.SimulAction;
+
+/**
+ * Specific editor for rule parameters.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *=20
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class RuleParametersFactorTableCellEditor extends AbstractCellEditor
+ implements TableCellEditor {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID =3D -1655744662816030649L;
+
+ private static Log log =3D LogFactory.getLog(RuleParametersFactorTableCe=
llEditor.class);
+
+ protected RuleChooser ruleChooser;
+
+ protected Rule rule;
+
+ /**
+ * Constructor.
+ *=20
+ * Super dependant de l'ui {@link RuleChooser} et de {@link SimulAction}.
+ *=20
+ * @param ruleChooser rule chooser ui
+ * @param rule rule
+ */
+ public RuleParametersFactorTableCellEditor(RuleChooser ruleChooser, Rule=
rule) {
+ this.ruleChooser =3D ruleChooser;
+ this.rule =3D rule;
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table, Object value,
+ boolean isSelected, int row, int column) {
+
+ Icon icon =3D Resource.getIcon("/icons/building_add.png");
+ JButton button =3D new JButton(icon);
+
+ boolean enabled =3D false;
+ final String paramName =3D (String)value;
+ try {
+ Object paramValue =3D RuleStorage.getParameterValue(rule, paramN=
ame);
+ //SensitivityInputHandler handler =3D ruleChooser.getContextValu=
e(SensitivityInputHandler.class);
+ // FIXME chatellier : number n'est pas correct ici mais j'ai pas=
d'id=C3=A9e :(
+ if (/*handler.canBeContinue(paramValue) || */paramValue instance=
of Number) {
+ enabled =3D true;
+ button.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ cancelCellEditing();
+ SimulAction simulAction =3D ruleChooser.getContextVa=
lue(SimulAction.class);
+ simulAction.addRuleParameterFactor(ruleChooser, rule=
, paramName);
+ }
+ });
+ }
+ } catch (IsisFishException ex) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get value type", ex);
+ }
+ }
+
+ button.setEnabled(enabled);
+
+ return button;
+ }
+
+ =20
+ /*
+ * @see javax.swing.CellEditor#getCellEditorValue()
+ */
+ @Override
+ public Object getCellEditorValue() {
+ return null;
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfi=
sh/ui/models/rule/RuleParametersFactorTableCellEditor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/r=
ule/RuleParametersFactorTableCellRenderer.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersFactorTableCellRenderer.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersFactorTableCellRenderer.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -0,0 +1,99 @@
+/*
+ * #%L
+ * IsisFish
+ *=20
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Code Lutin, Chatellier Eric
+ * %%
+ * 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=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program. If not, see
+ * .
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.models.rule;
+
+import java.awt.Component;
+
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.Resource;
+
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.ui.simulator.RuleChooser;
+
+/**
+ * Specific editor for rule parameters.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *=20
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class RuleParametersFactorTableCellRenderer extends DefaultTableCellR=
enderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID =3D -1655744662816030649L;
+
+ /** Class logger. */
+ private static Log log =3D LogFactory.getLog(RuleParametersFactorTableCe=
llRenderer.class);
+
+ protected RuleChooser ruleChooser;
+
+ protected Rule rule;
+
+ public RuleParametersFactorTableCellRenderer(RuleChooser ruleChooser, Ru=
le rule) {
+ this.ruleChooser =3D ruleChooser;
+ this.rule =3D rule;
+ }
+
+ /*
+ * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponen=
t(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
+ */
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object valu=
e,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ Icon icon =3D Resource.getIcon("/icons/building_add.png");
+ JButton button =3D new JButton(icon);
+
+ boolean enabled =3D false;
+ String paramName =3D (String)value;
+ try {
+ Object paramValue =3D RuleStorage.getParameterValue(rule, paramN=
ame);
+ //SensitivityInputHandler handler =3D ruleChooser.getContextValu=
e(SensitivityInputHandler.class);
+ // FIXME chatellier : number n'est pas correct ici mais j'ai pas=
d'id=C3=A9e :(
+ if (/*handler.canBeContinue(paramValue) || */paramValue instance=
of Number) {
+ enabled =3D true;
+ }
+ } catch (IsisFishException ex) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get value type", ex);
+ }
+ }
+
+ button.setEnabled(enabled);
+ return button;
+ }
+
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfi=
sh/ui/models/rule/RuleParametersFactorTableCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/model=
s/rule/RuleParametersTableCellRenderer.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersTableCellRenderer.java 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersTableCellRenderer.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin
+ * Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -30,7 +30,6 @@
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.TableCellRenderer;
=20
import fr.ifremer.isisfish.datastore.RuleStorage;
import fr.ifremer.isisfish.rule.Rule;
@@ -46,8 +45,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class RuleParametersTableCellRenderer extends DefaultTableCellRenderer
- implements TableCellRenderer {
+public class RuleParametersTableCellRenderer extends DefaultTableCellRendere=
r {
=20
/** serialVersionUID. */
private static final long serialVersionUID =3D -1655744662816030649L;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/model=
s/rule/RuleParametersTableModel.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersTableModel.java 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule=
/RuleParametersTableModel.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin
+ * Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -46,6 +46,7 @@
* Columns :
* Parameter name
* Parameter value
+ * Parameter factor (if enabled)
*
* @author chatellier
* @version $Revision$
@@ -56,35 +57,36 @@
public class RuleParametersTableModel extends AbstractTableModel {
=20
/** Log. */
- private static Log log =3D LogFactory
- .getLog(RuleParametersTableModel.class);
+ private static Log log =3D LogFactory.getLog(RuleParametersTableModel.cl=
ass);
=20
/** serialVersionUID. */
private static final long serialVersionUID =3D 3169786638868209920L;
=20
/** Columns names. */
- public final static String[] COLUMN_NAMES =3D { _("isisfish.common.name"=
),
- _("isisfish.common.value") };
+ public final static String[] COLUMN_NAMES =3D {
+ _("isisfish.common.name"),
+ _("isisfish.common.value"),
+ _("isisfish.common.ellipsis")};
=20
protected Rule rule;
+
protected List ruleParametersNames;
=20
- /**
- * Constructor.
- */
- public RuleParametersTableModel() {
- this(null);
+ /** If {@code true} display optional. */
+ protected boolean showFactorColumn;
+
+ public void setShowFactorColumn(boolean showFactorColumn) {
+ this.showFactorColumn =3D showFactorColumn;
+ fireTableStructureChanged();
}
=20
/**
- * Constructor with data.
- * =20
- * @param rule rule to edit parameters
+ * Set new rule, and fire changed event.
+ *=20
+ * @param rule
*/
- public RuleParametersTableModel(Rule rule) {
- super();
+ public void setRule(Rule rule) {
this.rule =3D rule;
-
//TODO map may be sorted
ruleParametersNames =3D new ArrayList();
if (rule !=3D null) {
@@ -94,6 +96,7 @@
ruleParametersNames.add(names);
}
}
+ fireTableDataChanged();
}
=20
/*
@@ -101,7 +104,11 @@
*/
@Override
public int getColumnCount() {
- return COLUMN_NAMES.length;
+ int result =3D 2;
+ if (showFactorColumn) {
+ result =3D 3;
+ }
+ return result;
}
=20
/*
@@ -109,7 +116,11 @@
*/
@Override
public int getRowCount() {
- return ruleParametersNames.size();
+ int result =3D 0;
+ if (ruleParametersNames !=3D null) {
+ result =3D ruleParametersNames.size();
+ }
+ return result;
}
=20
/*
@@ -134,6 +145,9 @@
}
}
break;
+ case 2:
+ result =3D name;
+ break;
default:
throw new IndexOutOfBoundsException("No such column " + columnIn=
dex);
}
@@ -156,6 +170,9 @@
case 1:
result =3D Object.class;
break;
+ case 2:
+ result =3D String.class;
+ break;
default:
throw new IndexOutOfBoundsException("No such column " + columnIn=
dex);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensi=
tivity/SensitivityInputHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityInputHandler.java 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityInputHandler.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -355,6 +355,31 @@
factorWizardUI.setContinueSelected(continueSelected);
factorWizardUI.getContinueRadio().setSelected(continueSelected);
}
+
+ /**
+ * Permet d'intialiser le wizard avec une valeur independante de la
+ * provenance (utile pour les facteurs sur les parametres de regles).
+ *=20
+ * TODO chatellier : ne doit pas fonctionner pour des equations.
+ *=20
+ * @param factorWizardUI factorWizardUI
+ * @param value value
+ */
+ public void initNewFactorWithValue(FactorWizardUI factorWizardUI, Object=
value) {
+ boolean continuePossible =3D canBeContinue(value);
+ boolean continueSelected =3D isContinue(value);
+
+ // init panel
+ if (continuePossible) {
+ factorWizardUI.continuousPanel =3D getContinuousPanel(value, nul=
l, null);
+ factorWizardUI.getContinuousPanelContainer().add(factorWizardUI.=
continuousPanel, BorderLayout.CENTER);
+ }
+ =20
+ // after, for binding on continuePossible, continueSelected to work
+ factorWizardUI.setContinuePossible(continuePossible);
+ factorWizardUI.setContinueSelected(continueSelected);
+ factorWizardUI.getContinueRadio().setSelected(continueSelected);
+ }
=20
/**
* Reaffiche un facteur existant.
@@ -558,13 +583,9 @@
result =3D true;
}
=20
- /*if (log.isDebugEnabled()) {
- log.debug("Component " + component.getClass().getSimpleName() +
- " with value " + value + "(" + value.getClass().getSimpl=
eName() + ") can be continuous : " + result);
- }*/
return result;
}
- =20
+
/**
* Return if value is is continue factor enable.
*=20
@@ -651,6 +672,7 @@
*=20
* @param domain domain
* @param factor factor
+ * @param topiaContext context used to get database value in case of equ=
ation factors
* @return component copy
*/
public ContinuousPanelContainerUI getContinuousPanelWithValue(Factor fac=
tor, ContinuousDomain domain, TopiaContext topiaContext) {
@@ -823,14 +845,21 @@
}
}
else {
- =20
- // dans ce cas c'est des regles ou pop de d=C3=A9part
+ // dans ce cas c'est des regles, pop de d=C3=A9part ou parametre=
s de regles
+ // c'est un peu galere car le code n'a rien a voir avec le reste
+ // donc, c'est du cas par cas
if (factorPath.equals("parameters.rules")) {
result =3D new RuleChooser(factorWizardUI);
}
else if (factorPath.startsWith("parameters.population.")) {
- // todo
+ MatrixContinuousPanelUI currentPanel =3D (MatrixContinuousPa=
nelUI)factorWizardUI.continuousPanel;
+ // on copie une des matrices du composant
+ MatrixND matrix =3D currentPanel.getReferenceValuePanel().ge=
tMatrix().copy();
+ result =3D new MatrixPanelEditor(matrix, false);
}
+ else if (factorPath.startsWith("parameters.rule.")) {
+ result =3D new JTextField("");
+ }
else {
if (log.isWarnEnabled()) {
log.warn("Can't find component for path " + factorPath);
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensi=
tivity/SensitivityTabUI.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityTabUI.jaxx 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityTabUI.jaxx 2011-05-18 15:54:41 UTC (rev 3332)
@@ -45,6 +45,7 @@
javax.swing.JMenuItem
java.awt.event.ActionEvent
+
=20
Deleted: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensit=
ivity/SensitivityTabbedPaneListener.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityTabbedPaneListener.java 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityTabbedPaneListener.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -1,79 +0,0 @@
-/*
- * #%L
- * IsisFish
- *=20
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2011 Ifremer, CodeLutin, Chatellier Eric
- * %%
- * 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=20
- * License, or (at your option) any later version.
- *=20
- * 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.
- *=20
- * You should have received a copy of the GNU General Public=20
- * License along with this program. If not, see
- * .
- * #L%
- */
-
-package fr.ifremer.isisfish.ui.sensitivity;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Sensitivity change listener to control tab swapping.
- *=20
- * @author letellier
- * @version $Revision$
- *=20
- * Last update : $Date$
- * By : $Author$
- */
-public class SensitivityTabbedPaneListener implements ChangeListener {
-
- /** Class logger. */
- private static Log log =3D LogFactory.getLog(SensitivityTabbedPaneListen=
er.class);
-
- protected int cacheSelectedIndex =3D -1;
-
- @Override
- public void stateChanged(ChangeEvent e) {
- /*try {
- JTabbedPane pane =3D (JTabbedPane)e.getSource();
- pane.removeChangeListener(this);
- int selectedIndex =3D pane.getSelectedIndex();
- if (cacheSelectedIndex !=3D -1){
- pane.setSelectedIndex(cacheSelectedIndex);
- }
- InputContentUI ui =3D (InputContentUI) pane.getSelectedComponent=
();
- pane.setSelectedIndex(selectedIndex);
- ui =3D (InputContentUI) pane.getSelectedComponent();
- //ui.setSensitivity(true);
- //ui.setLayer(true);
- // otherwise save.cancel buttons are active in last
- // refreshed ui
- TopiaEntityContextable entity =3D ui.getBean();
- // refresh ui
- ui.setBean(null);
- ui.setBean(entity);
- cacheSelectedIndex =3D pane.getSelectedIndex();
- pane.addChangeListener(this);
- =20
- // bug suis les UI autre que nimbus
- // la selection des onglet ne se rafraichit pas tres bien
- pane.repaint();
- } catch (Exception ex) {
- log.error(ex);
- }*/
- }
-}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensi=
tivity/SensitivityUI.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityUI.jaxx 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity=
/SensitivityUI.jaxx 2011-05-18 15:54:41 UTC (rev 3332)
@@ -28,15 +28,13 @@
fr.ifremer.isisfish.ui.input.InputAction
fr.ifremer.isisfish.ui.sensitivity.SensitivitySaveVerifier
jaxx.runtime.context.JAXXInitialContext
+ jaxx.runtime.JAXXContext
-
@@ -172,9 +192,10 @@
|
+
+ model=3D"{selectedRuleParameterTableModel}" enabled=3D"{=
isActive()}" />
|
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simul=
ator/SimulAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/S=
imulAction.java 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/S=
imulAction.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -1214,7 +1214,7 @@
/**
* Population selection changed.
*
- * Fill matrix panel with population effectif of selected population.
+ * Fill matrix panel with population effective of selected population.
*=20
* @param paramsUI paramsUI
*/
@@ -1222,7 +1222,7 @@
CardLayout layout =3D (CardLayout)paramsUI.getPopulationEffectivesPa=
nel().getLayout();
=20
Object[] selectedPopulationsValues =3D paramsUI.getListSimulParamsPo=
pulations().getSelectedValues();
- if (!ArrayUtils.isEmpty(selectedPopulationsValues)) {
+ if (ArrayUtils.isNotEmpty(selectedPopulationsValues)) {
paramsUI.getPopulationEffectivesTabbedPane().removeAll();
setPopulations(selectedPopulationsValues);
=20
@@ -1239,18 +1239,17 @@
if (paramsUI.isSensitivity()) {
matrixPanel.putClientProperty("sensitivityPopulation", s=
electedPopulation);
// TODO add another thing that action
- JButton addFactorButton =3D new JButton();
+ JButton addFactorButton =3D new JButton(SwingUtil.create=
ImageIcon("building_add.png"));
addFactorButton.setAction(new AbstractAction() {
-
public void actionPerformed(ActionEvent e) {
addFactorWithComponent(paramsUI, matrixPanel);
}
});
- addFactorButton.setIcon(SwingUtil.createImageIcon("build=
ing_add.png"));
matrixPanelComponent.add(addFactorButton, BorderLayout.E=
AST);
}
=20
- paramsUI.getPopulationEffectivesTabbedPane().add(matrixPanel=
Component, _("isisfish.params.populationEffectives", selectedPopulation.getNa=
me()));
+ paramsUI.getPopulationEffectivesTabbedPane().add(matrixPanel=
Component,
+ _("isisfish.params.populationEffectives", selectedPo=
pulation.getName()));
}
=20
layout.show(paramsUI.getPopulationEffectivesPanel(), "specific");
@@ -1313,4 +1312,42 @@
wizard.setVisible(true);
}
}
+
+ /**
+ * Ajout d'un nouveau facteur sur un parametres de r=C3=A8gles.
+ *=20
+ * Le facteur est directement cr=C3=A9e avec un nom et un path correct.
+ *=20
+ * @param ruleChooser rule chooser
+ * @param rule rule
+ * @param paramName rule parameter name
+ */
+ public void addRuleParameterFactor(RuleChooser ruleChooser, Rule rule, S=
tring paramName) {
+
+ // get sensitivity handler (this break package rules)
+ // but no other choice :(
+ SensitivityInputHandler handler =3D new SensitivityInputHandler();
+
+ // get index of rule in rule list
+ // warning, factor path must always be coh=C3=A9rent
+ // with rule list, if a rule is deleted, factor on it must
+ // be deleted too, et next factor must be renamed
+ int index =3D ruleChooser.getRulesList().indexOf(rule);
+ String factorName =3D "parameters.rule." + index + "." + paramName;
+ try {
+ // arriv=C3=A9 ici, on doit pouvoir la mettre en facteur
+ Object object =3D RuleStorage.getParameterValue(rule, paramName);
+
+ // init new factor wizard ui
+ FactorWizardUI factorWizardUI =3D new FactorWizardUI(ruleChooser=
);
+ factorWizardUI.getFactorNameField().setText(factorName);
+ factorWizardUI.setFactorPath(factorName);
+ handler.initNewFactorWithValue(factorWizardUI, object);
+ factorWizardUI.pack();
+ factorWizardUI.setLocationRelativeTo(ruleChooser);
+ factorWizardUI.setVisible(true);
+ } catch (IsisFishException ex) {
+ throw new IsisFishRuntimeException("Can't add factor on rule", e=
x);
+ }
+ }
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/util/=
ErrorHelper.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/util/ErrorH=
elper.java 2011-05-16 14:53:00 UTC (rev 3331)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/util/ErrorH=
elper.java 2011-05-18 15:54:41 UTC (rev 3332)
@@ -109,11 +109,14 @@
email.setHostName("smtp");
// to
email.addTo(emailTo, "Support");
+ =20
// from
email.setFrom("no-reply at isis-fish.org", "Isis-Fish");
// subject
email.setSubject("Project error notification : Isis-Fish");
-
+ // add reply-to for spam
+ email.addReplyTo("no-reply at isis-fish.org");
+ =20
// message description
String message =3D formatMessage("Project", "Isis-Fish " + IsisC=
onfig.getVersion());
message +=3D formatMessage("Date", new Date().toString());
--===============1082485561164501537==--