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
r3289 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 15:51:04 +0000 (Tue, 26 Apr 2011)
New Revision: 3289
Log:
Fix delete and create region
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-04-26 12:34:57 UTC (rev 3288)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-04-26 15:51:04 UTC (rev 3289)
@@ -130,52 +130,55 @@
if (log.isDebugEnabled()) {
log.debug("Load region " + name);
}
-
- FisheryRegion fisheryRegion = null;
- RegionStorage regionStorage = null;
- TopiaContext topiaContext = null;
- // load region
- try {
- regionStorage = RegionStorage.getRegion(name);
- topiaContext = regionStorage.getStorage().beginTransaction();
- fisheryRegion = RegionStorage.getFisheryRegion(topiaContext);
- } catch (TopiaException ex) {
- throw new IsisFishRuntimeException("Can't load region", ex);
- } catch (StorageException ex) {
- throw new IsisFishRuntimeException("Can't load region", ex);
- }
-
- // TODO echatellier 20110323 voir pour remplacer le binding
- inputUI.setRegionLoaded(fisheryRegion != null);
-
- if (fisheryRegion == null) {
+ if (name == null) {
// show empty region ui
- inputUI.getCardlayoutPrincipal().show(inputUI.getInputPanePrincipal(),"none");
+ inputUI.getCardlayoutPrincipal().show(inputUI.getInputPanePrincipal(), "none");
TreeModel model = new DefaultTreeModel(null);
inputUI.getFisheryRegionTree().setModel(model);
}
else {
+ FisheryRegion fisheryRegion = null;
+ RegionStorage regionStorage = null;
+ TopiaContext topiaContext = null;
+
+ // load region
+ try {
+ regionStorage = RegionStorage.getRegion(name);
+ topiaContext = regionStorage.getStorage().beginTransaction();
+ fisheryRegion = RegionStorage.getFisheryRegion(topiaContext);
+ } catch (TopiaException ex) {
+ throw new IsisFishRuntimeException("Can't load region", ex);
+ } catch (StorageException ex) {
+ throw new IsisFishRuntimeException("Can't load region", ex);
+ }
+
+ // TODO echatellier 20110323 voir pour remplacer le binding
+ inputUI.setRegionLoaded(fisheryRegion != null);
+
// init tree model loader with fishery region
- FisheryTreeHelper treeHelper = new FisheryTreeHelper();
+ FisheryTreeHelper fisheryTreeHelper = new FisheryTreeHelper();
FisheryDataProvider dataProvider = new FisheryDataProvider(fisheryRegion);
- treeHelper.setDataProvider(dataProvider);
- TreeModel model = treeHelper.createTreeModel(fisheryRegion);
+ fisheryTreeHelper.setDataProvider(dataProvider);
+ TreeModel fisheryTreeModel = fisheryTreeHelper.createTreeModel(fisheryRegion);
// fix strange region switch error
inputUI.getFisheryRegionTree().setCellRenderer(null);
- inputUI.getFisheryRegionTree().setModel(model);
+ inputUI.getFisheryRegionTree().setModel(fisheryTreeModel);
inputUI.getFisheryRegionTree().setCellRenderer(new FisheryTreeRenderer(dataProvider));
inputUI.getFisheryRegionTree().setSelectionModel(new FisheryTreeSelectionModel(inputUI));
- treeHelper.setUI(inputUI.getFisheryRegionTree(), true, false, null);
+ fisheryTreeHelper.setUI(inputUI.getFisheryRegionTree(), true, false, null);
// global context value : fisheryRegion, regionStorage, treeHelper
inputUI.setContextValue(fisheryRegion);
inputUI.setContextValue(regionStorage);
- inputUI.setContextValue(treeHelper);
- inputUI.setContextValue(model);
+ inputUI.setContextValue(fisheryTreeHelper);
+ inputUI.setContextValue(fisheryTreeModel);
inputUI.setContextValue(topiaContext);
inputUI.getCardlayoutPrincipal().show(inputUI.getInputPanePrincipal(),"normale");
+
+ // autoselect roto node (fire some event)
+ fisheryTreeHelper.selectNode((FisheryTreeNode)fisheryTreeModel.getRoot());
}
}
@@ -209,9 +212,7 @@
SwingUtilities.invokeLater(new Runnable() {
public void run() {
loadRegion(inputUI, name);
- // FIXME getVerifier().setIsisContext(getContextValue(TopiaContext.class));
setStatusMessage(inputUI, _("isisfish.message.load.finished"));
- // FIXME setTreeModel();
}
});
}
@@ -236,18 +237,32 @@
throw new IsisFishRuntimeException("Can't create region", ex);
}
inputUI.getFieldNewRegion().setText("");
-
- // refresh region list
- StringListModel regionsModel = new StringListModel(RegionStorage.getRegionNames());
- inputUI.getFieldCurrentRegion().setModel(regionsModel);
- // event is fired by setSelectedItem to call #regionChange
- inputUI.getFieldCurrentRegion().setSelectedItem(name);
+ refreshRegionList(inputUI, name);
}
setStatusMessage(inputUI, _("isisfish.message.creation.finished"));
}
-
+
/**
+ * Rafraichit la liste des regions.
+ *
+ * @param inputUI inputUI
+ * @param selectedItem region to select
+ */
+ protected void refreshRegionList(InputUI inputUI, String selectedItem) {
+ // refresh region list
+ StringListModel regionsModel = new StringListModel(RegionStorage.getRegionNames());
+ inputUI.getFieldCurrentRegion().setModel(regionsModel);
+ // event is fired by setSelectedItem to call #regionChange
+ if (selectedItem != null) {
+ inputUI.getFieldCurrentRegion().setSelectedItem(selectedItem);
+ }
+ else {
+ loadRegion(inputUI, null);
+ }
+ }
+
+ /**
* Exporter la region dans un zip.
*
* @param inputUI inputUI
@@ -402,6 +417,7 @@
_("isisfish.message.confirm.remove.region", regionStorage.getName()));
if (resp == JOptionPane.YES_OPTION) {
regionStorage.delete(vcsDelete);
+ refreshRegionList(inputUI, null);
}
} catch (StorageException eee) {
throw new IsisFishRuntimeException("Can't delete region", eee);
1
0
r3288 - in isis-fish/branches/3.3.1/src: main/java/fr/ifremer/isisfish/mexico/xml test/java/fr/ifremer/isisfish/mexico test/resources/mexico
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 12:34:57 +0000 (Tue, 26 Apr 2011)
New Revision: 3288
Log:
Rechargement des facteurs (pourcentage/min-max) + test unitaire
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ContinuousDomainXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/mexico/MexicoHelperTest.java
isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_designplan.xml
isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_factorgroupdp.xml
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ContinuousDomainXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ContinuousDomainXMLVisitor.java 2011-04-26 12:34:21 UTC (rev 3287)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ContinuousDomainXMLVisitor.java 2011-04-26 12:34:57 UTC (rev 3288)
@@ -50,7 +50,16 @@
ContinuousDomain cDomain = (ContinuousDomain)domain;
xmlBuffer.append(" cardinality=\"" + cDomain.getCardinality() + "\">");
- xmlBuffer.append("<range min=\"" + cDomain.getMinBound() + "\" max=\"" + cDomain.getMaxBound() + "\" />");
+ // facteur continue pourcentage
+ if (cDomain.getOperator() != null) {
+ xmlBuffer.append("<percentage coefficient=\"" + cDomain.getCoefficient() + "\"");
+ xmlBuffer.append(" operator=\"" + cDomain.getOperator() + "\"");
+ xmlBuffer.append(" reference=\"" + cDomain.getReferenceValue() + "\" />");
+ }
+ else {
+ // facteur continue min/max
+ xmlBuffer.append("<range min=\"" + cDomain.getMinBound() + "\" max=\"" + cDomain.getMaxBound() + "\" />");
+ }
}
/**
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-04-26 12:34:21 UTC (rev 3287)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-04-26 12:34:57 UTC (rev 3288)
@@ -147,14 +147,22 @@
else {
// continous domain
domain = new ContinuousDomain();
+
+ Element percentageElement = fixedElement.element("percentage");
+ if (percentageElement != null) {
+ domain.setCoefficient(Double.valueOf(percentageElement.attributeValue("coefficient")));
+ domain.setOperator(percentageElement.attributeValue("operator"));
+ domain.setReferenceValue(Double.valueOf(percentageElement.attributeValue("reference")));
+ }
+ else {
+ // <range max="1.0" min="0.0"/>
+ Element rangeElement = fixedElement.element("range");
+ domain.setMinBound(Double.valueOf(rangeElement.attributeValue("min")));
+ domain.setMaxBound(Double.valueOf(rangeElement.attributeValue("max")));
+ }
}
-
+
domain.setCardinality(Integer.valueOf(fixedElement.attributeValue("cardinality")));
-
- // <range max="1.0" min="0.0"/>
- Element rangeElement = fixedElement.element("range");
- domain.setMinBound(Double.valueOf(rangeElement.attributeValue("min")));
- domain.setMaxBound(Double.valueOf(rangeElement.attributeValue("max")));
factor.setDomain(domain);
} else if ("discrete".equals(property)) {
@@ -210,15 +218,24 @@
else {
// continous domain
domain = new ContinuousDomain();
+
+ Element percentageElement = fixedElement.element("percentage");
+ if (percentageElement != null) {
+ domain.setCoefficient(Double.valueOf(percentageElement.attributeValue("coefficient")));
+ domain.setOperator(percentageElement.attributeValue("operator"));
+ domain.setReferenceValue(Double.valueOf(percentageElement.attributeValue("reference")));
+ }
+ else {
+ // <range max="1" min="3"/>
+ Element rangeElement = fixedElement.element("range");
+ domain.setMinBound(Integer.valueOf(rangeElement.attributeValue("min")));
+ domain.setMaxBound(Integer.valueOf(rangeElement.attributeValue("max")));
+ }
+
}
domain.setCardinality(Integer.valueOf(fixedElement.attributeValue("cardinality")));
- // <range max="1" min="3"/>
- Element rangeElement = fixedElement.element("range");
- domain.setMinBound(Integer.valueOf(rangeElement.attributeValue("min")));
- domain.setMaxBound(Integer.valueOf(rangeElement.attributeValue("max")));
-
factor.setDomain(domain);
} else if ("discrete".equals(property)) {
DiscreteDomain domain = new DiscreteDomain();
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/mexico/MexicoHelperTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/mexico/MexicoHelperTest.java 2011-04-26 12:34:21 UTC (rev 3287)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/mexico/MexicoHelperTest.java 2011-04-26 12:34:57 UTC (rev 3288)
@@ -28,6 +28,7 @@
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
+import java.util.List;
import java.util.Properties;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -158,18 +159,30 @@
domain5.setOperator("-");
factorEquationContinuous.setDomain(domain5);
factorEquationContinuous.setPath("fr.ifremer.isisfish.entities.PopulationGroup#1156461521076#0.6526656643346673#maxLength");
-
- // factor 6 : rule factor
- Factor factorRuleDiscrete = new Factor("factor 6 (RuleDiscrete)");
- RuleDomain domain6 = new RuleDomain();
- SortedMap<Object, Object> rules = new TreeMap<Object, Object>();
- rules.put("ruleset1", Arrays.asList(ruleTacPoids, ruleTailleMin));
- rules.put("ruleset2", Arrays.asList(ruleTailleMin));
- domain6.setValues(rules);
- factorRuleDiscrete.setDomain(domain6);
-
+
+ // factor 1
+ Factor factorContinuousPercentage = new Factor("factor 6 (double continuous percentage)");
+ ContinuousDomain domain6 = new ContinuousDomain();
+ domain6.setCoefficient(5.0);
+ domain6.setReferenceValue(14.0);
+ domain6.setOperator("*");
+ domain6.setCardinality(5);
+ factorContinuousPercentage.setDomain(domain6);
+ factorContinuousPercentage.setPath("fr.ifremer.isisfish.entities.PopulationGroup#1142003453434#0.223499349929004#size");
+
// 3.4.0.0
if (useGroupAndRule) {
+
+ // factor 7 : rule factor
+ Factor factorRuleDiscrete = new Factor("factor 7 (RuleDiscrete)");
+ RuleDomain domain7 = new RuleDomain();
+ SortedMap<Object, Object> rules = new TreeMap<Object, Object>();
+ rules.put("ruleset1", Arrays.asList(ruleTacPoids, ruleTailleMin));
+ rules.put("ruleset2", Arrays.asList(ruleTailleMin));
+ domain7.setValues(rules);
+ factorRuleDiscrete.setDomain(domain7);
+ factorRuleDiscrete.setPath("parameters.rules");
+
FactorGroup group1 = new FactorGroup("discretegrp");
group1.addFactor(factorDiscrete);
group1.addFactor(factorRuleDiscrete);
@@ -189,6 +202,7 @@
designPlan.addFactor(factorContinuous2);
designPlan.addFactor(factorMatrixContinuous);
designPlan.addFactor(factorEquationContinuous);
+ designPlan.addFactor(factorContinuousPercentage);
}
return designPlan;
@@ -242,13 +256,20 @@
File testFile = new File("src/test/resources/mexico/mexicohelper_designplan.xml");
// topia context can be null in tests
DesignPlan plan = MexicoHelper.getDesignPlanFromXML(testFile, null);
+ List<Factor> factors = plan.getFactors();
- Assert.assertEquals(5, plan.getFactors().size());
+ Assert.assertEquals(6, factors.size());
String xml = MexicoHelper.getDesignPlanAsXML(plan);
if (log.isDebugEnabled()) {
log.debug("testGetDesignPlanFromXML xml = " + xml);
}
+
+ // assert on continuous factor (percentage, non percentage) (3.4.0.0)
+ ContinuousDomain domain1 = (ContinuousDomain)factors.get(0).getDomain();
+ Assert.assertNull(domain1.getOperator());
+ ContinuousDomain domain6 = (ContinuousDomain)factors.get(5).getDomain();
+ Assert.assertNotNull(domain6.getOperator());
}
/**
Modified: isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_designplan.xml
===================================================================
--- isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_designplan.xml 2011-04-26 12:34:21 UTC (rev 3287)
+++ isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_designplan.xml 2011-04-26 12:34:57 UTC (rev 3288)
@@ -97,5 +97,13 @@
</fixed>
</domain>
</factor>
+ <factor name="factor 6 (double continuous percentage)" property="continuous" type="real">
+ <target>fr.ifremer.isisfish.entities.PopulationGroup#1142003453434#0.223499349929004#size</target>
+ <domain>
+ <fixed cardinality="5">
+ <percentage operator="*" coefficient="5" reference="14"/>
+ </fixed>
+ </domain>
+ </factor>
</factors>
</experimentalDesign>
\ No newline at end of file
Modified: isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_factorgroupdp.xml
===================================================================
--- isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_factorgroupdp.xml 2011-04-26 12:34:21 UTC (rev 3287)
+++ isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_factorgroupdp.xml 2011-04-26 12:34:57 UTC (rev 3288)
@@ -87,8 +87,8 @@
</fixed>
</domain>
</factor>
- <factor name="factor 6 (RuleDiscrete)" property="discrete" type="rule">
- <target>null</target>
+ <factor name="factor 7 (RuleDiscrete)" property="discrete" type="rule">
+ <target>parameters.rules</target>
<domain>
<fixed cardinality="2">
<enumeration>
1
0
r3287 - isis-fish/branches/3.3.1/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 12:34:21 +0000 (Tue, 26 Apr 2011)
New Revision: 3287
Log:
Fix i18n
Modified:
isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties
isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties
Modified: isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties
===================================================================
--- isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties 2011-04-26 09:42:02 UTC (rev 3286)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties 2011-04-26 12:34:21 UTC (rev 3287)
@@ -916,7 +916,7 @@
isisfish.sensitivity.equation.variable.value=Value
isisfish.sensitivity.export=Export
isisfish.sensitivity.factor=Factor
-isisfish.sensitivity.factor.notvalid=Factor not valid !
+isisfish.sensitivity.factor.notvalid=Factor not valid \!
isisfish.sensitivity.factors=Factors
isisfish.sensitivity.firstValue=First value
isisfish.sensitivity.increment=Cardinality
Modified: isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties
===================================================================
--- isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties 2011-04-26 09:42:02 UTC (rev 3286)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties 2011-04-26 12:34:21 UTC (rev 3287)
@@ -916,7 +916,7 @@
isisfish.sensitivity.equation.variable.value=Valeur
isisfish.sensitivity.export=Export
isisfish.sensitivity.factor=Facteur
-isisfish.sensitivity.factor.notvalid=Facteur non valide !
+isisfish.sensitivity.factor.notvalid=Facteur non valide \!
isisfish.sensitivity.factors=Facteurs
isisfish.sensitivity.firstValue=Premi\u00E8re valeur
isisfish.sensitivity.increment=Cardinalit\u00E9
1
0
r3286 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 09:42:02 +0000 (Tue, 26 Apr 2011)
New Revision: 3286
Log:
Restauration du support "integer" pour les facteurs discrets
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-04-26 09:22:00 UTC (rev 3285)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-04-26 09:42:02 UTC (rev 3286)
@@ -170,6 +170,69 @@
factor.setDomain(domain);
}
factorGroup.addFactor(factor);
+ } else if ("integer".equals(type)) {
+ Factor factor = new Factor(name);
+ factor.setPath(path);
+ Element fixedElement = factorElement.element("domain").element("fixed");
+ if ("continuous".equals(property)) {
+ ContinuousDomain domain = null;
+
+ if(property.equals("matrixcontinuous")) {
+ // matrix specific
+ MatrixContinuousDomain mdomain = new MatrixContinuousDomain();
+
+ Element coefficientElement = fixedElement.element("coefficient");
+ mdomain.setCoefficient(Double.valueOf(coefficientElement.attributeValue("value")));
+ mdomain.setOperator(coefficientElement.attributeValue("operator"));
+
+ // matrix specific
+ Element matrixElement = fixedElement.element("mx");
+ MatrixND matrix = MexicoHelper.getMatrixFromXml(matrixElement, topiaContext);
+ mdomain.setMatrix(matrix);
+
+ domain = mdomain;
+ }
+ else if (property.equals("equationcontinuous")) {
+ // equation specific
+
+ EquationContinuousDomain edomain = new EquationContinuousDomain();
+
+ Element coefficientElement = fixedElement.element("coefficient");
+ edomain.setCoefficient(Double.valueOf(coefficientElement.attributeValue("value")));
+ edomain.setOperator(coefficientElement.attributeValue("operator"));
+
+ Element equationElement = fixedElement.element("equation");
+ edomain.setReferenceValue(Double.valueOf(equationElement.attributeValue("reference")));
+ edomain.setVariableName(equationElement.attributeValue("variable"));
+
+ domain = edomain;
+ }
+ else {
+ // continous domain
+ domain = new ContinuousDomain();
+ }
+
+ domain.setCardinality(Integer.valueOf(fixedElement.attributeValue("cardinality")));
+
+ // <range max="1" min="3"/>
+ Element rangeElement = fixedElement.element("range");
+ domain.setMinBound(Integer.valueOf(rangeElement.attributeValue("min")));
+ domain.setMaxBound(Integer.valueOf(rangeElement.attributeValue("max")));
+
+ factor.setDomain(domain);
+ } else if ("discrete".equals(property)) {
+ DiscreteDomain domain = new DiscreteDomain();
+ List<Element> valueElements = fixedElement.element(
+ "enumeration").elements("value");
+ int label = 0;
+ for (Element valueElement : valueElements) {
+ domain.getValues().put(Integer.valueOf(label),
+ Integer.valueOf(valueElement.getTextTrim()));
+ ++label;
+ }
+ factor.setDomain(domain);
+ }
+ factorGroup.addFactor(factor);
} else if ("rule".equals(type)) {
Factor factor = new Factor(name);
factor.setPath(path);
1
0
r3285 - in isis-fish/branches/3.3.1/src/main: java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/sensitivity java/fr/ifremer/isisfish/ui/simulator resources/i18n
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 09:22:00 +0000 (Tue, 26 Apr 2011)
New Revision: 3285
Log:
Gestino des facteurs numeriques en pourcentage.
Added:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/OperatorComboModel.java
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/ContinuousPanelContainerUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/DefaultContinuousPanelUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx
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/simulator/SimulAction.java
isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties
isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-04-26 09:22:00 UTC (rev 3285)
@@ -524,7 +524,7 @@
inputContentUI.getSaveVerifier().setInputContentUI(inputContentUI);
// mandatory set
- //inputContentUI.getSaveVerifier().reset(); // before set bean !!!
+ inputContentUI.getSaveVerifier().reset(); // before set bean !!!
if (topiaEntity != null) {
inputContentUI.getSaveVerifier().addCurrentEntity(topiaEntity);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2011-04-26 09:22:00 UTC (rev 3285)
@@ -377,9 +377,12 @@
}
}
- /*public void reset() {
- removeAllEntity();
- }*/
+ /**
+ * Reset state.
+ */
+ public void reset() {
+ currentEntities.clear();
+ }
/*public void removeAllEntity() {
currentEntities.clear();
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/ContinuousPanelContainerUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/ContinuousPanelContainerUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/ContinuousPanelContainerUI.jaxx 2011-04-26 09:22:00 UTC (rev 3285)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ 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
@@ -22,12 +22,20 @@
<http://www.gnu.org/licenses/gpl-2.0.html>.
#L%
-->
-<JPanel id='continuousPanelContainer' layout='{new BorderLayout()}'>
+<JPanel layout='{new BorderLayout()}' abstract="true">
<Boolean id='continuePossible' javaBean='true'/>
<Boolean id='continueSelected' javaBean='false'/>
+ <script><![CDATA[
+/**
+ * Return true only if UI component are all filled and value are correct
+ * to define new factor.
+ */
+public abstract boolean isFactorValid();
+ ]]></script>
+
<JPanel id='content' layout='{new BorderLayout()}' constraints='BorderLayout.CENTER'/>
-
+
</JPanel>
\ No newline at end of file
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/DefaultContinuousPanelUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/DefaultContinuousPanelUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/DefaultContinuousPanelUI.jaxx 2011-04-26 09:22:00 UTC (rev 3285)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ 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
@@ -23,68 +23,113 @@
#L%
-->
<ContinuousPanelContainerUI>
+
+ <Boolean id="percentageTypeFactor" javaBean="true" />
+
<import>
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
javax.swing.JTextField
+ org.apache.commons.lang.StringUtils
</import>
+
<script><![CDATA[
-protected JTextField continueMax = null;
-protected JTextField continueMin = null;
-
-protected void $afterCompleteSetup() {
- addPropertyChangeListener("continuePossible", new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- continueMax.setVisible((Boolean)evt.getNewValue());
- continueMin.setVisible((Boolean)evt.getNewValue());
- }
- });
-
- addPropertyChangeListener("continueSelected", new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- continueMax.setEnabled((Boolean)evt.getNewValue());
- continueMin.setEnabled((Boolean)evt.getNewValue());
- }
- });
+public void init(String min, String max, String referenceValue, String coefficient, String operator) {
+ continueMin.setText(min);
+ continueMax.setText(max);
+ referenceValueField.setText(referenceValue);
+ coefficientField.setText(coefficient);
+ operatorField.setSelectedItem(operator);
}
-public void init(JTextField cMin, JTextField cMax) {
- continueMax = cMax;
- continueMin = cMin;
- continueMax.setEnabled(isContinueSelected());
- continueMin.setEnabled(isContinueSelected());
- continueMax.setVisible(isContinuePossible());
- continueMin.setVisible(isContinuePossible());
-
- continueMaxPanel.add(continueMax, BorderLayout.CENTER);
- continueMinPanel.add(continueMin, BorderLayout.CENTER);
+public void initExisting(String min, String max, String referenceValue, String coefficient, String operator) {
+ init(min, max, referenceValue, coefficient, operator);
+ setPercentageTypeFactor(StringUtils.isNotBlank(operator));
}
-public String getMin() {
- return continueMin.getText();
+ at Override
+public boolean isFactorValid() {
+ return true;
}
-
-public String getMax() {
- return continueMax.getText();
-}
]]></script>
<JPanel id="content">
<Table constraints='BorderLayout.CENTER'>
<row>
- <cell fill='horizontal'>
- <JLabel text='isisfish.sensitivity.firstValue' visible='{isContinuePossible()}' enabled='{isContinueSelected()}'/>
+ <cell fill='both' weightx='1' weighty='1'>
+ <JPanel layout="{new BorderLayout()}">
+ <JRadioButton text="isisfish.sensitivity.continuouspercentagetype"
+ onActionPerformed="setPercentageTypeFactor(true)"
+ selected="{isPercentageTypeFactor()}"
+ constraints='BorderLayout.NORTH'
+ enabled='{isContinueSelected()}'/>
+ <Table constraints='BorderLayout.CENTER' border='{BorderFactory.createTitledBorder("")}'>
+ <row>
+ <cell fill='horizontal'>
+ <JLabel text='isisfish.sensitivity.referencevalue' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && isPercentageTypeFactor()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JTextField id='referenceValueField' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && isPercentageTypeFactor()}'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal'>
+ <JLabel text='isisfish.sensitivity.coefficient' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && isPercentageTypeFactor()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JTextField id='coefficientField' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && isPercentageTypeFactor()}'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal'>
+ <JLabel text='isisfish.sensitivity.operator' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && isPercentageTypeFactor()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JComboBox id='operatorField' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && isPercentageTypeFactor()}'
+ model="{new OperatorComboModel()}"/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
</cell>
- <cell fill='horizontal' weightx='0.5'>
- <JPanel id='continueMinPanel' layout='{new BorderLayout()}'/>
+ </row>
+ <row>
+ <cell fill='both' weightx='1' weighty='1'>
+ <JPanel layout="{new BorderLayout()}">
+ <JRadioButton text="isisfish.sensitivity.continuousminmaxtype"
+ onActionPerformed="setPercentageTypeFactor(false)"
+ selected="{!isPercentageTypeFactor()}"
+ constraints='BorderLayout.NORTH'
+ enabled='{isContinueSelected()}'/>
+ <Table constraints='BorderLayout.CENTER' border='{BorderFactory.createTitledBorder("")}'>
+ <row>
+ <cell fill='horizontal'>
+ <JLabel text='isisfish.sensitivity.firstValue' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && !isPercentageTypeFactor()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JTextField id='continueMin' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && !isPercentageTypeFactor()}'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal'>
+ <JLabel text='isisfish.sensitivity.lastValue' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && !isPercentageTypeFactor()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JTextField id='continueMax' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected() && !isPercentageTypeFactor()}'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
</cell>
- <cell fill='horizontal'>
- <JLabel text='isisfish.sensitivity.lastValue' visible='{isContinuePossible()}' enabled='{isContinueSelected()}'/>
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JPanel id='continueMaxPanel' layout='{new BorderLayout()}'/>
- </cell>
</row>
</Table>
</JPanel>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx 2011-04-26 09:22:00 UTC (rev 3285)
@@ -25,21 +25,22 @@
<ContinuousPanelContainerUI>
<import>
- javax.swing.table.AbstractTableModel;
- javax.swing.table.DefaultTableModel;
- fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
- javax.swing.table.TableCellEditor;
- javax.swing.table.TableModel;
- java.util.regex.Matcher;
- java.util.regex.Pattern;
- org.apache.commons.lang.StringUtils;
+ java.awt.Component
+ java.awt.Dimension
+ java.util.ArrayList
+ java.util.EventObject
+ java.util.List
+ java.util.regex.Matcher
+ java.util.regex.Pattern
+ javax.swing.table.AbstractTableModel
+ javax.swing.table.DefaultTableModel
+ javax.swing.table.TableCellEditor
+ javax.swing.table.TableModel
javax.swing.JComboBox
javax.swing.DefaultCellEditor
- java.util.EventObject
- java.awt.Component
- java.util.ArrayList
javax.swing.event.CellEditorListener
- java.awt.Dimension
+ fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain
+ org.apache.commons.lang.StringUtils
</import>
<String id='text' javaBean='null'/>
@@ -53,39 +54,37 @@
<fr.ifremer.isisfish.entities.Formule id='formule' javaBean='null'/>
<script><![CDATA[
-
-
protected String[] columnNames = {
_("isisfish.sensitivity.equation.variable.name"),
_("isisfish.sensitivity.equation.variable.value"),
_("isisfish.sensitivity.equation.variable.coefficient"),
_("isisfish.sensitivity.equation.variable.operator"),
_("isisfish.sensitivity.equation.variable.action")};
-protected java.util.List<EquationContinuousDomain> datas = new ArrayList<EquationContinuousDomain>();
-protected java.util.List<JComboBox> operateurs = new ArrayList<JComboBox>();
-protected java.util.List<JButton> actions = new ArrayList<JButton>();
+protected List<EquationContinuousDomain> domains = new ArrayList<EquationContinuousDomain>();
+protected List<JComboBox> operateurs = new ArrayList<JComboBox>();
+protected List<JButton> actions = new ArrayList<JButton>();
-public java.util.List<EquationContinuousDomain> getDomains(){
- return datas;
+public List<EquationContinuousDomain> getDomains() {
+ return domains;
}
-public void setDomains(java.util.List<EquationContinuousDomain> domains){
- datas.clear();
- for (EquationContinuousDomain d : domains){
+public void setDomains(List<EquationContinuousDomain> newDomains) {
+ domains.clear();
+ for (EquationContinuousDomain d : newDomains) {
addDomain(d);
}
}
-public void addDomain(EquationContinuousDomain domain){
+public void addDomain(EquationContinuousDomain domain) {
newButton();
- datas.add(domain);
+ domains.add(domain);
}
protected AbstractTableModel getTableModel() {
AbstractTableModel model = new AbstractTableModel() {
@Override
public int getRowCount() {
- return datas.size();
+ return domains.size();
}
@Override
@@ -101,14 +100,14 @@
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (columnIndex == 0) {
- return datas.get(rowIndex).getVariableName();
+ return domains.get(rowIndex).getVariableName();
} else if (columnIndex == 1) {
- return datas.get(rowIndex).getReferenceValue();
+ return domains.get(rowIndex).getReferenceValue();
} else if (columnIndex == 2) {
- Double result = datas.get(rowIndex).getCoefficient() * 100;
+ Double result = domains.get(rowIndex).getCoefficient() * 100;
return result;
} else if (columnIndex == 3) {
- return datas.get(rowIndex).getOperator();
+ return domains.get(rowIndex).getOperator();
} else if (columnIndex == 4) {
return _("isisfish.sensitivity.validDiscretNumber");
}
@@ -120,13 +119,13 @@
if (String.class.isInstance(aValue)) {
if (!((String)aValue).equals("")) {
if (columnIndex == 0){
- datas.get(rowIndex).setVariableName((String)aValue);
+ domains.get(rowIndex).setVariableName((String)aValue);
} else if (columnIndex == 1) {
- datas.get(rowIndex).setReferenceValue(Double.parseDouble((String)aValue));
+ domains.get(rowIndex).setReferenceValue(Double.parseDouble((String)aValue));
} else if (columnIndex == 2) {
- datas.get(rowIndex).setCoefficient(Double.parseDouble((String)aValue) / 100);
+ domains.get(rowIndex).setCoefficient(Double.parseDouble((String)aValue) / 100);
} else if (columnIndex == 3) {
- datas.get(rowIndex).setOperator((String)aValue);
+ domains.get(rowIndex).setOperator((String)aValue);
}
}
}
@@ -140,31 +139,28 @@
};
return model;
}
-protected JComboBox getOperateur(){
- JComboBox result = new JComboBox();
- result.addItem("+");
- result.addItem("-");
- result.addItem("*");
- result.addItem("/");
+
+protected JComboBox getOperateur() {
+ JComboBox result = new JComboBox(new OperatorComboModel());
operateurs.add(result);
result.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JComboBox source = (JComboBox)e.getSource();
int i = operateurs.indexOf(source);
- if (datas.size() <= i){
- datas.get(i).setOperator((String)source.getSelectedItem());
+ if (domains.size() < i) {
+ domains.get(i).setOperator((String)source.getSelectedItem());
}
}
});
return result;
}
-protected void newButton(){
+
+protected void newButton() {
JButton result = new JButton();
result.setText(_("isisfish.sensitivity.validDiscretNumber"));
actions.add(result);
result.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
JButton source = (JButton)e.getSource();
@@ -173,11 +169,13 @@
}
});
}
-protected JButton getActionButton(int i){
+
+protected JButton getActionButton(int i) {
return actions.get(i);
}
+
protected void valid(int i) {
- String variableName = datas.get(i).getVariableName();
+ String variableName = domains.get(i).getVariableName();
String[] lines = editor.getEditor().getText().split("\n");
String result = "";
for (String line : lines) {
@@ -191,10 +189,9 @@
}
editor.getEditor().setText(result);
}
-protected void setTable(){
+
+protected void setTable() {
params.setModel(getTableModel());
- // poussin 20090512, marche pas, impossible d'affiche la combo dans l'interface:
- // chatellier , si mais seulement en edition
params.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(getOperateur()));
params.getColumnModel().getColumn(4).setCellEditor(new TableCellEditor() {
@@ -236,22 +233,40 @@
}
});
}
-protected void add() {
+protected void addNewVariable() {
EquationContinuousDomain domain = new EquationContinuousDomain();
// fixe NPE in table model renderer
domain.setCoefficient(1.0);
- datas.add(domain);
+ domains.add(domain);
newButton();
setTable();
}
-protected void remove() {
- int i = params.getSelectedRow();
- if (i != -1){
- datas.remove(i);
- operateurs.remove(i);
- actions.remove(i);
- setTable();
+
+protected void removeVariable() {
+ int selectedRow = params.getSelectedRow();
+ domains.remove(selectedRow);
+ operateurs.remove(selectedRow);
+ actions.remove(selectedRow);
+ setTable();
+}
+
+ at Override
+public boolean isFactorValid() {
+ boolean valid = true;
+
+ for (EquationContinuousDomain domain : domains) {
+ if (domain.getReferenceValue() == null
+ || domain.getCoefficient() == null
+ || domain.getCoefficient() > 100
+ || domain.getCoefficient() <= 0
+ || domain.getOperator() == null
+ || domain.getVariableName() == null) {
+ } else {
+ valid = false;
+ }
}
+
+ return valid;
}
]]></script>
<JPanel id='content'>
@@ -261,15 +276,19 @@
<JScrollPane preferredSize="{new Dimension(200, 150)}">
<JTable id='params' visible='{isContinuePossible()}' model='{getTableModel()}'
enabled='{isContinueSelected()}' />
+ <ListSelectionModel initializer="params.getSelectionModel()"
+ onValueChanged="remove.setEnabled(params.getSelectedRow() != -1)" />
</JScrollPane>
</cell>
</row>
<row>
<cell fill='horizontal' weightx='1'>
- <JButton id='add' text='isisfish.common.add' visible='{isContinuePossible()}' enabled='{isContinueSelected()}' onActionPerformed='add()'/>
+ <JButton id='add' text='isisfish.common.add' visible='{isContinuePossible()}'
+ enabled='{isContinueSelected()}' onActionPerformed='addNewVariable()'/>
</cell>
<cell fill='horizontal' weightx='1'>
- <JButton id='remove' text='isisfish.common.remove' visible='{isContinuePossible()}' enabled='{isContinueSelected()}' onActionPerformed='remove()'/>
+ <JButton id='remove' text='isisfish.common.remove' visible='{isContinuePossible()}'
+ enabled='false' onActionPerformed='removeVariable()'/>
</cell>
</row>
<row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx 2011-04-26 09:22:00 UTC (rev 3285)
@@ -56,11 +56,6 @@
protected java.util.List<JComponent> discretComponents = new ArrayList<JComponent>();
protected ContinuousPanelContainerUI continuousPanel = null;
-/*protected JComponent cOrigine = null;
-protected TopiaEntityContextable bean = null;
-protected String path = null;
-protected Factor factor = null;*/
-
protected void $afterCompleteSetup() {
addPropertyChangeListener(PROPERTY_CONTINUE_POSSIBLE, new PropertyChangeListener() {
@Override
@@ -101,7 +96,7 @@
onActionPerformed='setContinueSelected(continueRadio.isSelected())'
constraints="BorderLayout.NORTH"/>
<JPanel id='continuousPanelContainer' layout='{new BorderLayout()}'
- constraints="BorderLayout.CENTER"/>
+ constraints="BorderLayout.CENTER" border='{BorderFactory.createTitledBorder("")}' />
</JPanel>
</cell>
</row>
@@ -112,7 +107,7 @@
selected='{true}' buttonGroup='factorType'
onActionPerformed='setContinueSelected(continueRadio.isSelected())'
constraints="BorderLayout.NORTH"/>
- <Table id='discretePanelContainer' constraints="BorderLayout.CENTER">
+ <Table id='discretePanelContainer' constraints="BorderLayout.CENTER" border='{BorderFactory.createTitledBorder("")}'>
<row>
<cell fill='horizontal'>
<JLabel text='isisfish.sensitivity.selectDiscretNumber' enabled='{!isContinueSelected()}'/>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/MatrixContinuousPanelUI.jaxx 2011-04-26 09:22:00 UTC (rev 3285)
@@ -26,6 +26,12 @@
<org.nuiton.math.matrix.MatrixND id='matrix' javaBean='null'/>
+ <script><![CDATA[
+ at Override
+public boolean isFactorValid() {
+ return true;
+}
+ ]]></script>
<JPanel id='content'>
<Table constraints='BorderLayout.CENTER'>
<row>
@@ -51,12 +57,8 @@
<JLabel text='isisfish.sensitivity.operator' visible='{isContinuePossible()}' enabled='{isContinueSelected()}'/>
</cell>
<cell fill='horizontal' weightx='1' columns='3'>
- <JAXXComboBox id='operator' visible='{isContinuePossible()}' enabled='{isContinueSelected()}'>
- <item id='plus' value="+"/>
- <item id='moins' value="-"/>
- <item id='mult' value="*"/>
- <item id='div' value="/"/>
- </JAXXComboBox>
+ <JComboBox id='operator' visible='{isContinuePossible()}' enabled='{isContinueSelected()}'
+ model="{new OperatorComboModel()}"/>
</cell>
</row>
</Table>
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/OperatorComboModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/OperatorComboModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/OperatorComboModel.java 2011-04-26 09:22:00 UTC (rev 3285)
@@ -0,0 +1,65 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.sensitivity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+/**
+ * Modèle de combo box pour les operateurs des facteurs.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class OperatorComboModel extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -1880800720890228942L;
+
+ protected static final List<String> OPERATORS = new ArrayList<String>();
+
+ static {
+ OPERATORS.add("+");
+ OPERATORS.add("-");
+ OPERATORS.add("*");
+ OPERATORS.add("/");
+ }
+
+ @Override
+ public int getSize() {
+ return OPERATORS.size();
+ }
+
+ @Override
+ public Object getElementAt(int index) {
+ return OPERATORS.get(index);
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/OperatorComboModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: 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/SensitivityInputHandler.java 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityInputHandler.java 2011-04-26 09:22:00 UTC (rev 3285)
@@ -159,7 +159,7 @@
InputContentUI inputContentUI = getUIInstanceForBeanClass(internalClass, sensitivityTabUI);
// mandatory set
- //inputContentUI.getSaveVerifier().reset(); // before set bean !!!
+ inputContentUI.getSaveVerifier().reset(); // before set bean !!!
if (topiaEntity != null) {
inputContentUI.getSaveVerifier().addCurrentEntity(topiaEntity);
inputContentUI.getSaveVerifier().setInputContentUI(inputContentUI);
@@ -284,7 +284,7 @@
SensitivityInputHandler handler = factorWizardUI.getHandler();
handler.initExistingFactor(factorWizardUI, selectedFactor);
factorWizardUI.pack();
- factorWizardUI.setLocationRelativeTo(sensitivityTabUI.getFactorsTree());
+ factorWizardUI.setLocationRelativeTo(sensitivityTabUI);
factorWizardUI.setVisible(true);
}
}
@@ -325,8 +325,6 @@
* @param property bean property to edit
*/
public void initNewFactor(FactorWizardUI factorWizardUI, TopiaEntityContextable bean, String property) {
- //factorWizardUI.setBean(bean);
- //this.cOrigine = source;
// path is topiaId#property
// ex : fwn#fsd#0.3425345#name
@@ -345,28 +343,17 @@
Object valueForPath = getPropertyValue(bean, beanProperty);
boolean continuePossible = canBeContinue(valueForPath);
boolean continueSelected = isContinue(valueForPath);
- factorWizardUI.setContinuePossible(continuePossible);
- factorWizardUI.setContinueSelected(continueSelected);
- factorWizardUI.getContinueRadio().setSelected(continueSelected);
// init panel
if (continuePossible) {
factorWizardUI.continuousPanel = getContinuousPanel(valueForPath, bean, property);
factorWizardUI.getContinuousPanelContainer().add(factorWizardUI.continuousPanel, BorderLayout.CENTER);
}
- /*if (!continueSelected && valueForPath instanceof RangeOfValues) {
- int i = 0;
- for (String s : EditorHelper.getDiscretRangeOfValueValues(cOrigine, bean)) {
- JTextField text = new JTextField(s);
- discretComponents.add(text);
- tabPane.add(text, "Factor " + (i+1));
- i++;
- }
- }*/
- /*if (continuousPanel != null) {
- continuousPanel.setContinueSelected(selected);
- }*/
- //setContinueSelected(EditorHelper.isContinue(cOrigine));
+
+ // after, for binding on continuePossible, continueSelected to work
+ factorWizardUI.setContinuePossible(continuePossible);
+ factorWizardUI.setContinueSelected(continueSelected);
+ factorWizardUI.getContinueRadio().setSelected(continueSelected);
}
/**
@@ -416,10 +403,8 @@
SortedMap<Object, Object> values = dDomain.getValues();
int i = 0;
- Object cache = null;
for (Object o : values.values()) {
i++;
- cache = o;
JComponent c = null;
if (o != null) {
c = getEditorWithValue(factorWizardUI, dDomain, o);
@@ -628,7 +613,7 @@
max = values.substring(first + 1);
}
}
- ui.init(new JTextField(min), new JTextField(max));
+ ui.init(min, max, min, null, null);
result = ui;
}
else if (value instanceof Equation) {
@@ -650,7 +635,7 @@
result = matrixPanel;
} else {
DefaultContinuousPanelUI ui = new DefaultContinuousPanelUI();
- ui.init(new JTextField(String.valueOf(value)), new JTextField(String.valueOf(value)));
+ ui.init(String.valueOf(value), String.valueOf(value), String.valueOf(value), null, null);
result = ui;
}
@@ -672,7 +657,6 @@
public ContinuousPanelContainerUI getContinuousPanelWithValue(Factor factor, ContinuousDomain domain, TopiaContext topiaContext) {
ContinuousPanelContainerUI result = null;
- DefaultContinuousPanelUI continuousPanel = null;
if (domain instanceof EquationContinuousDomain) {
String factorPath = factor.getPath();
if (factor.getPath().indexOf('#') != -1) {
@@ -718,9 +702,28 @@
panel.getCoef().setText(String.valueOf(matrixDomain.getCoefficient() * 100));
result = panel;
} else {
- continuousPanel = new DefaultContinuousPanelUI();
- continuousPanel.init(new JTextField(String.valueOf(domain.getMinBound())),
- new JTextField(String.valueOf(domain.getMaxBound())));
+ DefaultContinuousPanelUI continuousPanel = new DefaultContinuousPanelUI();
+
+ // factor numerique continue (percentage)
+ if (domain.getOperator() != null) {
+ // il y a bien 3 fois domain.getReferenceValue() pas d'erreur
+ continuousPanel.initExisting(
+ String.valueOf(domain.getReferenceValue()),
+ String.valueOf(domain.getReferenceValue()),
+ String.valueOf(domain.getReferenceValue()),
+ String.valueOf(domain.getCoefficient()),
+ String.valueOf(domain.getOperator()));
+ }
+ else {
+ // factor numerique continue (min/max)
+ // pas d'erreur sur 2 fois domain.getMinBound()
+ continuousPanel.initExisting(
+ String.valueOf(domain.getMinBound()),
+ String.valueOf(domain.getMaxBound()),
+ String.valueOf(domain.getMinBound()),
+ "",
+ null);
+ }
result = continuousPanel;
}
@@ -834,6 +837,20 @@
* @param factorWizardUI factorWizardUI
*/
public void save(FactorWizardUI factorWizardUI) {
+
+ // first check is faactor is valid
+ boolean factorValid = false;
+ ContinuousPanelContainerUI continuousPanel = factorWizardUI.continuousPanel;
+ if (continuousPanel != null) {
+ factorValid = continuousPanel.isFactorValid();
+ }
+ if (!factorValid) {
+ JOptionPane.showMessageDialog(factorWizardUI, _("isisfish.sensitivity.factor.notvalid"),
+ _("isisfish.sensitivity.title"), JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+
+ // call specific method depending on continuous/discrete
if (factorWizardUI.getContinueRadio().isSelected()) {
saveContinue(factorWizardUI.getFactorNameField().getText(),
factorWizardUI.getComment().getText(), factorWizardUI.getFactorPath(), factorWizardUI.continuousPanel,
@@ -843,29 +860,31 @@
factorWizardUI.getComment().getText(), factorWizardUI.getFactorPath(), factorWizardUI.discretComponents,
factorWizardUI.getSimulAction(), factorWizardUI.isExistingValue());
}
+
+ // refresh factor list
factorWizardUI.getContextValue(SimulationUI.class, "SimulationUI").refreshFactorTree();
+
+ // close window
factorWizardUI.dispose();
}
-
+
/**
- * Remove current factor.
+ * Save a continous factor.
*
- * @param factorWizardUI factorWizardUI
+ * @param name
+ * @param comment
+ * @param path
+ * @param panel
+ * @param action
+ * @param exist
*/
- public void remove(FactorWizardUI factorWizardUI) {
- factorWizardUI.getSimulAction().removeFactor(factorWizardUI.getFactorPath());
- factorWizardUI.getContextValue(SimulationUI.class, "SimulationUI").refreshFactorTree();
- factorWizardUI.dispose();
- }
-
protected void saveContinue(String name,
String comment, String path, ContinuousPanelContainerUI panel,
SimulAction action, boolean exist) {
- DefaultContinuousPanelUI defaultPanel = null;
if (panel instanceof MatrixContinuousPanelUI) {
MatrixContinuousPanelUI matrixPanel = (MatrixContinuousPanelUI) panel;
Double coef = Double.valueOf(matrixPanel.getCoef().getText()) / 100;
- //MatrixND matrix = matrixPanel.getMatrix();
+ //MatrixND matrix = matrixPanel.getMatrix(); // always null
MatrixND matrix = matrixPanel.getComponentPanel().getMatrix();
String operateur = (String)matrixPanel.getOperator().getSelectedItem();
action.addContinuousMatrixFactor(name, comment, path, coef, matrix,
@@ -876,6 +895,8 @@
EquationContinuousPanelUI equationPanel = (EquationContinuousPanelUI) panel;
TopiaEntityContextable bean = (TopiaEntityContextable)equationPanel.getBean();
+ TopiaContext topiaContext = bean.getTopiaContext();
+
String property = equationPanel.getBeanProperty();
property = StringUtils.capitalize(property) + "Content";
Method m = bean.getClass().getMethod("set" + property, String.class);
@@ -883,60 +904,41 @@
// Save equation
bean.update();
- bean.getTopiaContext().commitTransaction();
-
- List<EquationContinuousDomain> domains = equationPanel
- .getDomains();
- for (EquationContinuousDomain domain : domains) {
- if (domain.getReferenceValue() != null
- && domain.getCoefficient() != null
- && domain.getCoefficient() <= 100
- && domain.getCoefficient() > 0
- && domain.getOperator() != null
- && domain.getVariableName() != null) {
- action.addContinuousEquationFactor(name, comment, path,
- domain, exist);
- } else {
- log.warn("domain: " + domain);
- log.warn("domain invalid: "
- + "domain.getReferenceValue() != null("
- + (domain.getReferenceValue())
- + ") domain.getCoefficient() != null("
- + (domain.getCoefficient())
- + ") domain.getCoefficient() <= 100 ("
- + (domain.getCoefficient())
- + ") domain.getCoefficient() > 0 ("
- + (domain.getCoefficient())
- + ") domain.getOperator() != null ("
- + (domain.getOperator())
- + ") domain.getVariableName() != null("
- + (domain.getVariableName()) + ")");
- JOptionPane.showMessageDialog(equationPanel,
- _("isisfish.error.factor.invalid")
- + domain.getVariableName());
- }
- }
+ topiaContext.commitTransaction();
} catch (Exception ex) {
if (log.isErrorEnabled()) {
log.error("Can't call method : ", ex);
}
}
} else if (panel instanceof DefaultContinuousPanelUI) {
- defaultPanel = (DefaultContinuousPanelUI) panel;
- action.addContinuousFactor(name, comment, path,
- getMin(defaultPanel), getMax(defaultPanel),
- exist);
+ DefaultContinuousPanelUI defaultPanel = (DefaultContinuousPanelUI) panel;
+
+ if (defaultPanel.isPercentageTypeFactor()) {
+ Double referenceValue = Double.valueOf(defaultPanel.getReferenceValueField().getText());
+ Double coefficient = Double.valueOf(defaultPanel.getCoefficientField().getText());
+ String operator = (String)defaultPanel.getOperatorField().getSelectedItem();
+ action.addContinuousFactor(name, comment, path,
+ referenceValue, coefficient, operator, exist);
+ }
+ else {
+ double minBound = Double.parseDouble(defaultPanel.getContinueMin().getText());
+ double maxBound = Double.parseDouble(defaultPanel.getContinueMax().getText());
+ action.addContinuousFactor(name, comment, path,
+ minBound, maxBound, exist);
+ }
}
}
- protected Double getMin(DefaultContinuousPanelUI defaultPanel) {
- return Double.parseDouble(defaultPanel.getMin());
- }
-
- protected Double getMax(DefaultContinuousPanelUI defaultPanel) {
- return Double.parseDouble(defaultPanel.getMax());
- }
-
+ /**
+ * Save a discret factor.
+ *
+ * @param name
+ * @param comment
+ * @param path
+ * @param components
+ * @param action
+ * @param exist
+ */
protected void saveDiscret(String name,
String comment, String path, List<JComponent> components,
SimulAction action, boolean exist) {
@@ -970,4 +972,15 @@
return result;
}
+
+ /**
+ * Remove current factor.
+ *
+ * @param factorWizardUI factorWizardUI
+ */
+ public void remove(FactorWizardUI factorWizardUI) {
+ factorWizardUI.getSimulAction().removeFactor(factorWizardUI.getFactorPath());
+ factorWizardUI.getContextValue(SimulationUI.class, "SimulationUI").refreshFactorTree();
+ factorWizardUI.dispose();
+ }
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2011-04-26 09:22:00 UTC (rev 3285)
@@ -34,7 +34,6 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.Serializable;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -891,6 +890,16 @@
factorGroup.addFactor(f);
}
+ /**
+ * Ajout d'un facteur continue de type (min/max).
+ *
+ * @param name
+ * @param comment
+ * @param path
+ * @param min
+ * @param max
+ * @param exist
+ */
public void addContinuousFactor(String name, String comment, String path, Double min,
Double max, boolean exist) {
Factor f = new Factor(name);
@@ -906,6 +915,33 @@
addFactor(f);
}
+ /**
+ * Ajout d'un facteur continue de type pourcentage.
+ *
+ * @param name
+ * @param comment
+ * @param path
+ * @param referenceValue
+ * @param coefficient
+ * @param operator
+ * @param exist
+ */
+ public void addContinuousFactor(String name, String comment, String path, Double referenceValue,
+ Double coefficient, String operator, boolean exist) {
+ Factor f = new Factor(name);
+ ContinuousDomain domain = new ContinuousDomain();
+ domain.setReferenceValue(referenceValue);
+ domain.setCoefficient(coefficient);
+ domain.setOperator(operator);
+ f.setDomain(domain);
+ f.setComment(comment);
+ f.setPath(path);
+ if (exist) {
+ removeFactor(path);
+ }
+ addFactor(f);
+ }
+
public void addDiscreteFactor(String name, String comment, String path,
List<Object> values, boolean exist) {
Factor f = new Factor(name);
Modified: isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties
===================================================================
--- isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties 2011-04-26 09:22:00 UTC (rev 3285)
@@ -905,6 +905,8 @@
isisfish.sensitivity.coefficient=Coefficient (in %)
isisfish.sensitivity.comment=Comment
isisfish.sensitivity.continue=Continuous factor
+isisfish.sensitivity.continuousminmaxtype=Mix/Max type
+isisfish.sensitivity.continuouspercentagetype=Percentage type
isisfish.sensitivity.discret=Discret factor
isisfish.sensitivity.displaysecondpass=Display results
isisfish.sensitivity.equation.variable.action=Action
@@ -914,6 +916,7 @@
isisfish.sensitivity.equation.variable.value=Value
isisfish.sensitivity.export=Export
isisfish.sensitivity.factor=Factor
+isisfish.sensitivity.factor.notvalid=Factor not valid !
isisfish.sensitivity.factors=Factors
isisfish.sensitivity.firstValue=First value
isisfish.sensitivity.increment=Cardinality
@@ -924,6 +927,7 @@
isisfish.sensitivity.newfactorgroup.tip=Add new factor group
isisfish.sensitivity.newfactorname=Factor group name
isisfish.sensitivity.operator=Operator
+isisfish.sensitivity.referencevalue=Reference value
isisfish.sensitivity.secondpass=Analyze results
isisfish.sensitivity.secondpass.title=Analyze results
isisfish.sensitivity.select=Method
Modified: isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties
===================================================================
--- isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties 2011-04-26 09:19:13 UTC (rev 3284)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties 2011-04-26 09:22:00 UTC (rev 3285)
@@ -905,6 +905,8 @@
isisfish.sensitivity.coefficient=Coefficient (en %)
isisfish.sensitivity.comment=Commentaires
isisfish.sensitivity.continue=Facteur continu
+isisfish.sensitivity.continuousminmaxtype=Type min/max
+isisfish.sensitivity.continuouspercentagetype=Type pourcentage
isisfish.sensitivity.discret=Facteur discret
isisfish.sensitivity.displaysecondpass=Afficher les r\u00E9sultats
isisfish.sensitivity.equation.variable.action=Action
@@ -914,6 +916,7 @@
isisfish.sensitivity.equation.variable.value=Valeur
isisfish.sensitivity.export=Export
isisfish.sensitivity.factor=Facteur
+isisfish.sensitivity.factor.notvalid=Facteur non valide !
isisfish.sensitivity.factors=Facteurs
isisfish.sensitivity.firstValue=Premi\u00E8re valeur
isisfish.sensitivity.increment=Cardinalit\u00E9
@@ -924,6 +927,7 @@
isisfish.sensitivity.newfactorgroup.tip=Ajouter un groupe de facteur
isisfish.sensitivity.newfactorname=Nom du groupe de facteurs
isisfish.sensitivity.operator=Op\u00E9rateur
+isisfish.sensitivity.referencevalue=Valeur de r\u00E9f\u00E9rence
isisfish.sensitivity.secondpass=Analyse des r\u00E9sultats
isisfish.sensitivity.secondpass.title=Analyse des r\u00E9sultats
isisfish.sensitivity.select=M\u00E9thode
1
0
r3284 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 09:19:13 +0000 (Tue, 26 Apr 2011)
New Revision: 3284
Log:
Fix l'application des layers
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2011-04-26 09:09:50 UTC (rev 3283)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
@@ -59,6 +59,7 @@
@Override
public void setLayer(boolean active) {
+ super.setLayer(active);
gearTabUI.setLayer(active);
selectivityUI.setLayer(active);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2011-04-26 09:09:50 UTC (rev 3283)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
@@ -53,6 +53,7 @@
@Override
public void setLayer(boolean active) {
+ super.setLayer(active);
metierTabUI.setLayer(active);
metierSeasonInfoUI.setLayer(active);
metierSeasonSpeciesUI.setLayer(active);
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2011-04-26 09:09:50 UTC (rev 3283)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
@@ -50,6 +50,7 @@
@Override
public void setLayer(boolean active) {
+ super.setLayer(active);
populationBasicsUI.setLayer(active);
populationZoneUI.setLayer(active);
populationSeasonsUI.setLayer(active);
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2011-04-26 09:09:50 UTC (rev 3283)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
@@ -46,6 +46,7 @@
@Override
public void setLayer(boolean active) {
+ super.setLayer(active);
setOfVesselsBasicsUI.setLayer(active);
effortDescriptionUI.setLayer(active);
effortParametersUI.setLayer(active);
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2011-04-26 09:09:50 UTC (rev 3283)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyUI.jaxx 2011-04-26 09:19:13 UTC (rev 3284)
@@ -39,6 +39,7 @@
@Override
public void setLayer(boolean active) {
+ super.setLayer(active);
strategyTabUI.setLayer(active);
strategyMonthInfoUI.setLayer(active);
}
1
0
r3283 - in isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish: . ui
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
by chatellier@users.labs.libre-entreprise.org 26 Apr '11
26 Apr '11
Author: chatellier
Date: 2011-04-26 09:09:50 +0000 (Tue, 26 Apr 2011)
New Revision: 3283
Log:
Restaure main fame position and dimensions
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/IsisFish.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/IsisFish.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/IsisFish.java 2011-04-22 08:37:26 UTC (rev 3282)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/IsisFish.java 2011-04-26 09:09:50 UTC (rev 3283)
@@ -66,6 +66,7 @@
import org.nuiton.util.FileUtil;
import org.nuiton.util.Version;
import org.nuiton.util.converter.LocaleConverter;
+import org.nuiton.widget.SwingSession;
import fr.ifremer.isisfish.cron.CronService;
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
@@ -620,18 +621,27 @@
}
}
});
-
+
// migration must be done in UI envirronement and
// must nerver be done in caparmor
// TODO set it here for now, ui is not displayed on caparmor
//doNuitonMigration();
-
+
// init simulater manager
SimulationService.getService();
// init IsisTray
IsisTray.getInstance();
+
//initRSyntaxJavaSupport(config);
+
+ // configure swing session
+ // can't be in config ? getUserConfigDirectory() not static
+ File isisConfigDirectory = new File(config.getUserConfigDirectory(), "isis-fish");
+ isisConfigDirectory.mkdirs();
+ File sessionFile = new File(isisConfigDirectory, "session.xml");
+ final SwingSession session = new SwingSession(sessionFile, true);
+
// lauch first UI (welcomeUI)
WelcomeUI welcome = new WelcomeUI();
// Set to exit on close
@@ -642,6 +652,12 @@
WelcomeUI ui = (WelcomeUI)e.getSource();
ui.getHandler().close(ui);
}
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ session.save();
+ quit();
+ }
});
try {
@@ -654,7 +670,10 @@
log.error("Can't set frame icon", ex);
}
}
+
+ // show main isis window
welcome.setLocationRelativeTo(null);
+ session.add(welcome);
welcome.setVisible(true);
}
else {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java 2011-04-22 08:37:26 UTC (rev 3282)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java 2011-04-26 09:09:50 UTC (rev 3283)
@@ -187,7 +187,7 @@
*/
public void close(WelcomeUI welcomeUI) {
if (verifier.allIsSaved()) {
- exit(welcomeUI);
+ welcomeUI.dispose();
}
}
@@ -195,15 +195,6 @@
*
* @param welcomeUI parent ui
*/
- public void exit(WelcomeUI welcomeUI) {
- welcomeUI.dispose();
- IsisFish.quit();
- }
-
- /**
- *
- * @param welcomeUI parent ui
- */
public void updateVCS(WelcomeUI welcomeUI) {
// FIXME a reimplanter
// thread:Welcome.updateVCS()
1
0
r3282 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain
by chatellier@users.labs.libre-entreprise.org 22 Apr '11
by chatellier@users.labs.libre-entreprise.org 22 Apr '11
22 Apr '11
Author: chatellier
Date: 2011-04-22 08:37:26 +0000 (Fri, 22 Apr 2011)
New Revision: 3282
Log:
Finalement non, gestion de la nullit?\195?\169 sur l'op?\195?\169rateur/coefficient/valeur de r?\195?\169f?\195?\169rence.
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java 2011-04-22 08:24:55 UTC (rev 3281)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java 2011-04-22 08:37:26 UTC (rev 3282)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * 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
@@ -44,11 +44,11 @@
/** serialVersionUID. */
private static final long serialVersionUID = -2037768174807839046L;
- /** Borne inférieure. {@link Double} pour gerer la nullité. */
- protected Double minBound;
+ /** Borne inférieure. */
+ protected double minBound;
- /** Borne supérieure. {@link Double} pour gerer la nullité. */
- protected Double maxBound;
+ /** Borne supérieure. */
+ protected double maxBound;
/** Operation. (=,+,-,/) */
protected String operator;
@@ -75,7 +75,7 @@
* @param minBound min bound
* @param maxBound max bound
*/
- public ContinuousDomain(Double minBound, Double maxBound) {
+ public ContinuousDomain(double minBound, double maxBound) {
this();
this.minBound = minBound;
this.maxBound = maxBound;
@@ -84,28 +84,28 @@
/**
* @return the minBound
*/
- public Double getMinBound() {
+ public double getMinBound() {
return minBound;
}
/**
* @param minBound the minBound to set
*/
- public void setMinBound(Double minBound) {
+ public void setMinBound(double minBound) {
this.minBound = minBound;
}
/**
* @return the maxBound
*/
- public Double getMaxBound() {
+ public double getMaxBound() {
return maxBound;
}
/**
* @param maxBound the maxBound to set
*/
- public void setMaxBound(Double maxBound) {
+ public void setMaxBound(double maxBound) {
this.maxBound = maxBound;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java 2011-04-22 08:24:55 UTC (rev 3281)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java 2011-04-22 08:37:26 UTC (rev 3282)
@@ -75,7 +75,7 @@
* In equation continuous domain, always return 0
*/
@Override
- public Double getMinBound() {
+ public double getMinBound() {
return 0.0;
}
@@ -85,7 +85,7 @@
* In equation continuous domain, always return 1
*/
@Override
- public Double getMaxBound() {
+ public double getMaxBound() {
return 1.0;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-04-22 08:24:55 UTC (rev 3281)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-04-22 08:37:26 UTC (rev 3282)
@@ -73,20 +73,20 @@
/**
* {@inheritDoc}.
*
- * In matrix continuous domain, always return 0
+ * In matrix continuous domain, always return 0.0
*/
@Override
- public Double getMinBound() {
+ public double getMinBound() {
return 0.0;
}
/**
* {@inheritDoc}.
*
- * In matrix continuous domain, always return 1
+ * In matrix continuous domain, always return 1.0
*/
@Override
- public Double getMaxBound() {
+ public double getMaxBound() {
return 1.0;
}
1
0
r3281 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain
by chatellier@users.labs.libre-entreprise.org 22 Apr '11
by chatellier@users.labs.libre-entreprise.org 22 Apr '11
22 Apr '11
Author: chatellier
Date: 2011-04-22 08:24:55 +0000 (Fri, 22 Apr 2011)
New Revision: 3281
Log:
Fix factor api again (big Double)
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java 2011-04-21 13:50:33 UTC (rev 3280)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java 2011-04-22 08:24:55 UTC (rev 3281)
@@ -84,7 +84,7 @@
/**
* @return the minBound
*/
- public double getMinBound() {
+ public Double getMinBound() {
return minBound;
}
@@ -98,7 +98,7 @@
/**
* @return the maxBound
*/
- public double getMaxBound() {
+ public Double getMaxBound() {
return maxBound;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java 2011-04-21 13:50:33 UTC (rev 3280)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java 2011-04-22 08:24:55 UTC (rev 3281)
@@ -75,8 +75,8 @@
* In equation continuous domain, always return 0
*/
@Override
- public double getMinBound() {
- return 0;
+ public Double getMinBound() {
+ return 0.0;
}
/**
@@ -85,8 +85,8 @@
* In equation continuous domain, always return 1
*/
@Override
- public double getMaxBound() {
- return 1;
+ public Double getMaxBound() {
+ return 1.0;
}
@Override
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-04-21 13:50:33 UTC (rev 3280)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-04-22 08:24:55 UTC (rev 3281)
@@ -76,8 +76,8 @@
* In matrix continuous domain, always return 0
*/
@Override
- public double getMinBound() {
- return 0;
+ public Double getMinBound() {
+ return 0.0;
}
/**
@@ -86,8 +86,8 @@
* In matrix continuous domain, always return 1
*/
@Override
- public double getMaxBound() {
- return 1;
+ public Double getMaxBound() {
+ return 1.0;
}
@Override
1
0
r3280 - in isis-fish/branches/3.3.1/src: main/java/fr/ifremer/isisfish/mexico/xml main/java/fr/ifremer/isisfish/simulator/sensitivity/domain test/java/fr/ifremer/isisfish/simulator/launcher test/java/fr/ifremer/isisfish/simulator/sensitivity test/java/fr/ifremer/isisfish/ui/sensitivity
by chatellier@users.labs.libre-entreprise.org 21 Apr '11
by chatellier@users.labs.libre-entreprise.org 21 Apr '11
21 Apr '11
Author: chatellier
Date: 2011-04-21 13:50:33 +0000 (Thu, 21 Apr 2011)
New Revision: 3280
Log:
Factorisation des domaines continue (operator, coefficient, valueDeReference)
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/package-info.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTest.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/FactorTest.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -170,69 +170,6 @@
factor.setDomain(domain);
}
factorGroup.addFactor(factor);
- } else if ("integer".equals(type)) {
- Factor factor = new Factor(name);
- factor.setPath(path);
- Element fixedElement = factorElement.element("domain").element("fixed");
- if ("continuous".equals(property)) {
- ContinuousDomain domain = null;
-
- if(property.equals("matrixcontinuous")) {
- // matrix specific
- MatrixContinuousDomain mdomain = new MatrixContinuousDomain();
-
- Element coefficientElement = fixedElement.element("coefficient");
- mdomain.setCoefficient(Double.valueOf(coefficientElement.attributeValue("value")));
- mdomain.setOperator(coefficientElement.attributeValue("operator"));
-
- // matrix specific
- Element matrixElement = fixedElement.element("mx");
- MatrixND matrix = MexicoHelper.getMatrixFromXml(matrixElement, topiaContext);
- mdomain.setMatrix(matrix);
-
- domain = mdomain;
- }
- else if (property.equals("equationcontinuous")) {
- // equation specific
-
- EquationContinuousDomain edomain = new EquationContinuousDomain();
-
- Element coefficientElement = fixedElement.element("coefficient");
- edomain.setCoefficient(Double.valueOf(coefficientElement.attributeValue("value")));
- edomain.setOperator(coefficientElement.attributeValue("operator"));
-
- Element equationElement = fixedElement.element("equation");
- edomain.setReferenceValue(Double.valueOf(equationElement.attributeValue("reference")));
- edomain.setVariableName(equationElement.attributeValue("variable"));
-
- domain = edomain;
- }
- else {
- // continous domain
- domain = new ContinuousDomain();
- }
-
- domain.setCardinality(Integer.valueOf(fixedElement.attributeValue("cardinality")));
-
- // <range max="1" min="3"/>
- Element rangeElement = fixedElement.element("range");
- domain.setMinBound(Integer.valueOf(rangeElement.attributeValue("min")));
- domain.setMaxBound(Integer.valueOf(rangeElement.attributeValue("max")));
-
- factor.setDomain(domain);
- } else if ("discrete".equals(property)) {
- DiscreteDomain domain = new DiscreteDomain();
- List<Element> valueElements = fixedElement.element(
- "enumeration").elements("value");
- int label = 0;
- for (Element valueElement : valueElements) {
- domain.getValues().put(Integer.valueOf(label),
- Integer.valueOf(valueElement.getTextTrim()));
- ++label;
- }
- factor.setDomain(domain);
- }
- factorGroup.addFactor(factor);
} else if ("rule".equals(type)) {
Factor factor = new Factor(name);
factor.setPath(path);
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/ContinuousDomain.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -44,12 +44,21 @@
/** serialVersionUID. */
private static final long serialVersionUID = -2037768174807839046L;
- /** Borne inférieure */
- protected double minBound;
+ /** Borne inférieure. {@link Double} pour gerer la nullité. */
+ protected Double minBound;
- /** Borne supérieure */
- protected double maxBound;
+ /** Borne supérieure. {@link Double} pour gerer la nullité. */
+ protected Double maxBound;
+ /** Operation. (=,+,-,/) */
+ protected String operator;
+
+ /** Coefficient in percent */
+ protected Double coefficient;
+
+ /** Value used to create the factor. */
+ protected Double referenceValue;
+
/** Cardinality */
protected int cardinality;
@@ -66,7 +75,7 @@
* @param minBound min bound
* @param maxBound max bound
*/
- public ContinuousDomain(double minBound, double maxBound) {
+ public ContinuousDomain(Double minBound, Double maxBound) {
this();
this.minBound = minBound;
this.maxBound = maxBound;
@@ -82,7 +91,7 @@
/**
* @param minBound the minBound to set
*/
- public void setMinBound(double minBound) {
+ public void setMinBound(Double minBound) {
this.minBound = minBound;
}
@@ -96,11 +105,65 @@
/**
* @param maxBound the maxBound to set
*/
- public void setMaxBound(double maxBound) {
+ public void setMaxBound(Double maxBound) {
this.maxBound = maxBound;
}
/**
+ * Get operator.
+ *
+ * @return the operator
+ */
+ public String getOperator() {
+ return operator;
+ }
+
+ /**
+ * Set operator.
+ *
+ * @param operator the operator to set
+ */
+ public void setOperator(String operator) {
+ this.operator = operator;
+ }
+
+ /**
+ * Get coefficient.
+ *
+ * @return the coefficient
+ */
+ public Double getCoefficient() {
+ return coefficient;
+ }
+
+ /**
+ * Set coefficient.
+ *
+ * @param coefficient the coefficient to set
+ */
+ public void setCoefficient(Double coefficient) {
+ this.coefficient = coefficient;
+ }
+
+ /**
+ * Get reference value.
+ *
+ * @return the reference value
+ */
+ public Double getReferenceValue() {
+ return referenceValue;
+ }
+
+ /**
+ * Set reference value.
+ *
+ * @param referenceValue the reference value.to set
+ */
+ public void setReferenceValue(Double referenceValue) {
+ this.referenceValue = referenceValue;
+ }
+
+ /**
* {@inheritDoc}.
*
* In continuous domain, just return identifier
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomain.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -43,17 +43,11 @@
/** Variable name (must be java valid identifier) */
protected String variableName;
-
- /** Operation. (=,+,-,/) */
- protected String operator;
-
- /** Coefficient in percent */
- protected Double coefficient;
-
- /** Reference value*/
- protected Double referenceValue;
- /** Value used to create the equation */
+ /**
+ * Value used to create the factor.
+ * @deprecated since 20110421 : on ne fait rien de la value ?
+ */
protected Double value;
/**
@@ -74,61 +68,6 @@
public void setVariableName(String variableName) {
this.variableName = variableName;
}
-
- /**
- * Get operator.
- *
- * @return the operator
- */
- public String getOperator() {
- return operator;
- }
-
- /**
- * Set operator.
- *
- * @param operator
- * the operator to set
- */
- public void setOperator(String operator) {
- this.operator = operator;
- }
-
- /**
- * Get coefficient.
- *
- * @return the coefficient
- */
- public Double getCoefficient() {
- return coefficient;
- }
-
- /**
- * Set coefficient.
- *
- * @param coefficient the coefficient to set
- */
- public void setCoefficient(Double coefficient) {
- this.coefficient = coefficient;
- }
-
- /**
- * Get reference value.
- *
- * @return the reference value
- */
- public Double getReferenceValue() {
- return referenceValue;
- }
-
- /**
- * Set reference value.
- *
- * @param referenceValue the reference value.to set
- */
- public void setReferenceValue(Double referenceValue) {
- this.referenceValue = referenceValue;
- }
/**
* {@inheritDoc}.
@@ -190,6 +129,7 @@
* Get value used to create the equation.
*
* @return the value
+ * @deprecated since 20110421, on n'en fait rien de la value.
*/
public Double getValue() {
return this.value;
@@ -198,8 +138,8 @@
/**
* Set value used to create the equation.
*
- * @param value
- * the value to set
+ * @param value the value to set
+ * @deprecated since 20110421, on n'en fait rien de la value.
*/
public void setValue(Double value) {
this.value = value;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -46,13 +46,10 @@
/** Matrix */
protected MatrixND matrix;
- /** Coefficient. */
- protected double coefficient;
-
- /** Operation. (=,+,-,/) */
- protected String operator;
-
- /** Value used to create the matrix */
+ /**
+ * Value used to create the matrix
+ * @deprecated since 20110421, on n'en fait rien de la value.
+ */
protected double value;
/**
@@ -74,38 +71,6 @@
}
/**
- * @return the coefficient
- */
- public double getCoefficient() {
- return coefficient;
- }
-
- /**
- * @param coefficient the coefficient to set
- */
- public void setCoefficient(double coefficient) {
- this.coefficient = coefficient;
- }
-
- /**
- * Get operator.
- *
- * @return the operator
- */
- public String getOperator() {
- return operator;
- }
-
- /**
- * Set operator.
- *
- * @param operator the operator to set
- */
- public void setOperator(String operator) {
- this.operator = operator;
- }
-
- /**
* {@inheritDoc}.
*
* In matrix continuous domain, always return 0
@@ -180,6 +145,7 @@
* Get value used to create the matrix.
*
* @return the value
+ * @deprecated since 20110421, on n'en fait rien de la value.
*/
public Double getValue() {
return this.value;
@@ -189,6 +155,7 @@
* Set value used to create the matrix.
*
* @param value the value to set
+ * @deprecated since 20110421, on n'en fait rien de la value.
*/
public void setValue(Double value) {
this.value = value;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/package-info.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/package-info.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * 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
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTest.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTest.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -235,8 +235,8 @@
// factor
Factor factor = new Factor("testint");
ContinuousDomain domain = new ContinuousDomain();
- domain.setMinBound(0);
- domain.setMaxBound(50);
+ domain.setMinBound(0.0);
+ domain.setMaxBound(50.0);
factor.setDomain(domain);
factor.setPath("fr.ifremer.entities.Cell#1234567890#length");
factor.setValueForIdentifier(49);
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/FactorTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/FactorTest.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/FactorTest.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -64,8 +64,8 @@
Factor factor = new Factor("testint");
ContinuousDomain domain = new ContinuousDomain();
- domain.setMinBound(0);
- domain.setMaxBound(50);
+ domain.setMinBound(0.0);
+ domain.setMaxBound(50.0);
factor.setDomain(domain);
factor.setPath("org.nuiton.factor#1234567890#0.12242345354#name");
factor.setValueForIdentifier(49);
@@ -363,8 +363,8 @@
factor.setValue(42.0);
ContinuousDomain domain = new ContinuousDomain();
- domain.setMinBound(0);
- domain.setMaxBound(50);
+ domain.setMinBound(0.0);
+ domain.setMaxBound(50.0);
factor.setDomain(domain);
// clone
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java 2011-04-21 12:53:31 UTC (rev 3279)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java 2011-04-21 13:50:33 UTC (rev 3280)
@@ -73,8 +73,8 @@
Factor factor1 = new Factor(
"testint");
ContinuousDomain domain1 = new ContinuousDomain();
- domain1.setMinBound(0);
- domain1.setMaxBound(50);
+ domain1.setMinBound(0.0);
+ domain1.setMaxBound(50.0);
factor1.setDomain(domain1);
factor1.setPath("org.nuiton.factor#1234567890#0.12242345354#name");
factor1.setValueForIdentifier(49);
1
0