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
March 2011
- 2 participants
- 76 discussions
r3203 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 25 Mar '11
by chatellier@users.labs.libre-entreprise.org 25 Mar '11
25 Mar '11
Author: chatellier
Date: 2011-03-25 16:54:07 +0000 (Fri, 25 Mar 2011)
New Revision: 3203
Log:
Add layered sub ui
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2011-03-23 14:48:15 UTC (rev 3202)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2011-03-25 16:54:07 UTC (rev 3203)
@@ -131,6 +131,12 @@
}
}
}
+ at Override
+public void setLayer(boolean active) {
+ super.setLayer(active);
+ populationMigrationEquationUI.setLayer(active);
+ populationMigrationEquationUI.setLayer(active);
+}
]]>
</script>
<JPanel id='body'>
1
0
r3202 - in isis-fish/branches/3.3.1/src: main/java/fr/ifremer/isisfish/mexico main/java/fr/ifremer/isisfish/mexico/xml main/java/fr/ifremer/isisfish/simulator/sensitivity main/java/fr/ifremer/isisfish/simulator/sensitivity/domain main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor test/java/fr/ifremer/isisfish/mexico test/java/fr/ifremer/isisfish/simulator/launcher test/resources/mexico
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
23 Mar '11
Author: chatellier
Date: 2011-03-23 14:48:15 +0000 (Wed, 23 Mar 2011)
New Revision: 3202
Log:
Fix l'import/export xml des DesignPlan avec groupe de facteurs et r?\195?\168gles.
Added:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/AbstractXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorGroupXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/FactorGroupVisitor.java
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/MexicoHelper.java
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/DesignPlanXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DiscreteDomainXMLVisitor.java
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/DomainXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ScenarioXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/SensitivityScenariosXMLVisitor.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/DesignPlan.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/FactorGroup.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/visitor/DesignPlanVisitor.java
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/simulator/launcher/SimulationServiceTest.java
isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_designplan.xml
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/MexicoHelper.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/MexicoHelper.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/MexicoHelper.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin, Chatellier Eric
+ * Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -25,25 +25,27 @@
package fr.ifremer.isisfish.mexico;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.stream.StreamResult;
import org.apache.commons.beanutils.ConvertUtilsBean;
+import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
@@ -54,11 +56,14 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.persistence.TopiaEntity;
import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
+import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RuleStorage;
import fr.ifremer.isisfish.mexico.xml.DesignPlanXMLVisitor;
import fr.ifremer.isisfish.mexico.xml.DomXMLParser;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.rule.RuleHelper;
import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
import fr.ifremer.isisfish.util.ConverterUtil;
@@ -97,24 +102,6 @@
}
- /*
- * Get xml representation of a scenario.
- *
- * @param scenarios sensitivity scenarios
- * @return xml sensitivity scenarios representation
- *
- * TODO : non finished and untested
- *
- public static String getSensitivityScenarionsAsXML(
- SensitivityScenarios scenarios) {
-
- SensitivityScenariosXMLVisitor visitor = new SensitivityScenariosXMLVisitor();
- scenarios.accept(visitor);
- String sensitivityScenariosXml = visitor.getXML();
- return sensitivityScenariosXml;
-
- }*/
-
/**
* Parse xmlFile with sax, and return a {@link DesignPlan}.
*
@@ -140,29 +127,6 @@
}
return designPlan;
}
-
- /*
- * Parse xmlFile with sax, and return a {@link SensitivityScenarios}.
- *
- * @param xmlFile file path to parse
- * @return SensitivityScenarios
- * @throws IOException
- *
- * TODO : non finished and untested
- *
- public static SensitivityScenarios getSensitivityScenariosFromXML(
- String xmlFile) throws IOException {
- SensitivityScenarios scenarios = null;
- try {
- SAXReader reader = new SAXReader();
- Document doc = reader.read(xmlFile);
- Element root = doc.getRootElement();
- scenarios = DomXMLParser.parseSensitivityScenarios(root);
- } catch (DocumentException e) {
- throw new IOException(e);
- }
- return scenarios;
- }*/
/**
* Format xml string.
@@ -170,37 +134,22 @@
* @param unformattedXml non formatted xml string (must be valid xml)
* @return xml, formatted and indented
*
+ * Code from http://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java
+ *
* @throws IsisFishRuntimeException
* @throws IllegalArgumentException if input xml is not valid
- *
- * @deprecated use standard java xml api instead of xerces
*/
- @Deprecated
public static String formatXML(String unformattedXml) {
-
try {
- // parseXmlFile
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
- InputSource is = new InputSource(new StringReader(unformattedXml));
- org.w3c.dom.Document document = db.parse(is);
-
- // format
- OutputFormat format = new OutputFormat(document);
- format.setLineWidth(65);
- format.setIndenting(true);
- format.setIndent(2);
- Writer out = new StringWriter();
- XMLSerializer serializer = new XMLSerializer(out, format);
- serializer.serialize(document);
-
- return out.toString();
- } catch (IOException e) {
+ Transformer serializer= SAXTransformerFactory.newInstance().newTransformer();
+ serializer.setOutputProperty(OutputKeys.INDENT, "yes");
+ serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+ Source xmlSource=new SAXSource(new InputSource(new ByteArrayInputStream(unformattedXml.getBytes())));
+ StreamResult res = new StreamResult(new ByteArrayOutputStream());
+ serializer.transform(xmlSource, res);
+ return new String(((ByteArrayOutputStream)res.getOutputStream()).toByteArray());
+ } catch (Exception e) {
throw new IsisFishRuntimeException("Can't format xml", e);
- } catch (ParserConfigurationException e) {
- throw new IllegalArgumentException("Can't format xml", e);
- } catch (SAXException e) {
- throw new IllegalArgumentException("Can't format xml", e);
}
}
@@ -248,17 +197,6 @@
List<?> semantics = matrix.getSemantic(dimIndex);
buffer.append("<dimension name=\"" + matrix.getDimensionName(dimIndex) + "\" size=\"" + semantics.size() + "\">");
for (Object semantic : semantics) {
- /*if (semantic == null) {
- buffer.append("<label/>");
- }
- else if (semantic instanceof TopiaEntity) {
- TopiaEntity semanticTE = (TopiaEntity)semantic;
- buffer.append("<label>" + semanticTE.getTopiaId() + "</label>");
- }
- else {
- buffer.append("<label>" + semantic.toString() + "</label>");
- }*/
-
buffer.append("<label>");
appendString(buffer, semantic);
buffer.append("</label>");
@@ -420,4 +358,98 @@
}
return qualifiedName;
}
+
+ /**
+ * Transform rules list as xml.
+ *
+ * Format is :
+ * <pre>
+ * <rules>
+ * <rule name="RuleName1">
+ * <param key="rule.0.parameter.param1">param1</param>
+ * <param key="rule.0.parameter.pop">topiaId1</param>
+ * </rule>
+ * <rule name="RuleName2">
+ * <param key="rule.0.parameter.param1">param2</param>
+ * <param key="rule.0.parameter.pop">topiaId2</param>
+ * </rule>
+ * </rules>
+ * </pre>
+ *
+ * @param rules rules list
+ * @return rules as xml
+ */
+ public static String getRulesAsXml(List<Rule> rules) {
+ StringBuffer ruleAsString = new StringBuffer();
+ ruleAsString.append("<rules>");
+ for (Rule rule : rules) {
+ Properties props = RuleHelper.getRuleAsProperties(0, null, rule);
+
+ // rule name and rule parameters
+ ruleAsString.append("<rule name=\"");
+ ruleAsString.append(rule.getClass().getSimpleName());
+ ruleAsString.append("\">");
+ for (String propName : props.stringPropertyNames()) {
+ ruleAsString.append("<param key=\"");
+ ruleAsString.append(propName);
+ ruleAsString.append("\">");
+ ruleAsString.append(StringEscapeUtils.escapeXml(props.getProperty(propName)));
+ ruleAsString.append("</param>");
+ }
+ ruleAsString.append("</rule>");
+ }
+ ruleAsString.append("</rules>");
+ return ruleAsString.toString();
+ }
+
+ /**
+ * Parse xml as rules list.
+ *
+ * Format is :
+ * <pre>
+ * <rules>
+ * <rule name="RuleName1">
+ * <param key="rule.0.parameter.param1">param1</param>
+ * <param key="rule.0.parameter.pop">topiaId1</param>
+ * </rule>
+ * <rule name="RuleName2">
+ * <param key="rule.0.parameter.param1">param2</param>
+ * <param key="rule.0.parameter.pop">topiaId2</param>
+ * </rule>
+ * </rules>
+ * </pre>
+ *
+ * @param rulesElement rules dom element
+ * @param topiaContext topia context (for rules parameters)
+ * @return rules as xml
+ */
+ public static List<Rule> getRulesFromXml(Element rulesElement, TopiaContext topiaContext) {
+ List<Rule> rules = new ArrayList<Rule>();
+ List<Element> ruleElements = rulesElement.elements("rule");
+ for (Element ruleElement : ruleElements) {
+ String name = ruleElement.attributeValue("name");
+ try {
+ Rule rule = RuleStorage.getRule(name).getNewRuleInstance();
+
+ // get properties
+ Properties props = new Properties();
+ List<Element> paramElements = ruleElement.elements("param");
+ for (Element paramElement : paramElements) {
+ String key = paramElement.attributeValue("key");
+ String value = paramElement.getTextTrim();
+ props.setProperty(key, value);
+ }
+ RuleHelper.populateRule(0, topiaContext, rule, props);
+
+ rules.add(rule);
+ }
+ catch (IsisFishException ex) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't make instance of rule " + name, ex);
+ }
+ }
+ }
+
+ return rules;
+ }
}
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/AbstractXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/AbstractXMLVisitor.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/AbstractXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -0,0 +1,60 @@
+/*
+ * #%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.mexico.xml;
+
+/**
+ * Abstract xml visitor containing xml string buffer.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class AbstractXMLVisitor {
+
+ /** XML text buffer. */
+ protected StringBuffer xmlBuffer;
+
+ /**
+ * Constructor.
+ *
+ * Init xml buffer.
+ */
+ public AbstractXMLVisitor() {
+ xmlBuffer = new StringBuffer();
+ }
+
+ /**
+ * Get xml buffer content.
+ *
+ * @return content as string
+ */
+ public String getXML() {
+ String xml = xmlBuffer.toString();
+ return xml;
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/AbstractXMLVisitor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ContinuousDomainXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -29,7 +29,7 @@
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
/**
- * XML domain visitor.
+ * XML continuous domain visitor.
*
* @author chatellier
* @version $Revision: 1.0 $
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DesignPlanXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DesignPlanXMLVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DesignPlanXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -26,7 +26,7 @@
package fr.ifremer.isisfish.mexico.xml;
import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
-import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.simulator.sensitivity.visitor.DesignPlanVisitor;
/**
@@ -38,37 +38,14 @@
* Last update : $Date: 5 mars 2009 $
* By : $Author: chatellier $
*/
-public class DesignPlanXMLVisitor implements DesignPlanVisitor {
+public class DesignPlanXMLVisitor extends AbstractXMLVisitor implements DesignPlanVisitor {
- /** XML text buffer. */
- protected StringBuffer xmlBuffer;
-
/**
- * Constructor.
- *
- * Init xml buffer.
- */
- public DesignPlanXMLVisitor() {
- xmlBuffer = new StringBuffer();
- }
-
- /**
- * Get xml buffer content.
- *
- * @return content as string
- */
- public String getXML() {
- String xml = xmlBuffer.toString();
- return xml;
- }
-
- /**
* {@inheritDoc}
*/
@Override
public void start(DesignPlan designPlan) {
xmlBuffer.append("<experimentalDesign>");
- xmlBuffer.append("<factors>");
}
/**
@@ -76,9 +53,9 @@
*/
@Override
public void visit(DesignPlan designPlan,
- Factor factor) {
- FactorXMLVisitor visitor = new FactorXMLVisitor();
- factor.accept(visitor);
+ FactorGroup factorGroup) {
+ FactorGroupXMLVisitor visitor = new FactorGroupXMLVisitor();
+ factorGroup.accept(visitor);
xmlBuffer.append(visitor.getXML());
}
@@ -87,7 +64,6 @@
*/
@Override
public void end(DesignPlan designPlan) {
- xmlBuffer.append("</factors>");
xmlBuffer.append("</experimentalDesign>");
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DiscreteDomainXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DiscreteDomainXMLVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DiscreteDomainXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, CodeLutin, Chatellier Eric
+ * 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
@@ -29,7 +29,7 @@
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
/**
- * XML domain visitor.
+ * XML discrete domain visitor.
*
* @author chatellier
* @version $Revision: 1.0 $
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-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomXMLParser.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, CodeLutin, CHatellier Eric
+ * 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
@@ -32,12 +32,15 @@
import org.nuiton.topia.TopiaContext;
import fr.ifremer.isisfish.mexico.MexicoHelper;
+import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.RuleDomain;
/**
* Parse xml using dom.
@@ -63,9 +66,41 @@
DesignPlan plan = new DesignPlan();
- List<Element> factorElements = rootElement
- .selectNodes("child::factors/factor");
+ List<Element> factorGroupElements = rootElement.selectNodes("child::factors");
+ FactorGroup factorGroup = null;
+ if (!factorGroupElements.isEmpty()) {
+ factorGroup = parseFactorGroup(factorGroupElements.get(0), topiaContext, true);
+ }
+ plan.setFactorGroup(factorGroup);
+
+ return plan;
+ }
+ /**
+ * Recursive parse of factor group elements (>factors<).
+ *
+ * @param fgElement factor group element (>factors<)
+ * @param topiaContext context
+ * @param mixed {@code true} if create factor group need to be mixed
+ * @return factor group
+ *
+ * @see FactorGroup#isMixed()
+ */
+ protected static FactorGroup parseFactorGroup(Element fgElement, TopiaContext topiaContext, boolean mixed) {
+
+ String factorGroupName = fgElement.attributeValue("name");
+ FactorGroup factorGroup = new FactorGroup(factorGroupName, mixed);
+
+ // sub factor group
+ List<Element> factorGroupElements = fgElement.selectNodes("child::factors");
+ for (Element factorGroupElement : factorGroupElements) {
+ FactorGroup subFactorGroup = parseFactorGroup(factorGroupElement, topiaContext, false);
+ factorGroup.addFactor(subFactorGroup);
+ }
+
+ // normal factors
+ List<Element> factorElements = fgElement.selectNodes("child::factor");
+
for (Element factorElement : factorElements) {
String type = factorElement.attributeValue("type");
String name = factorElement.attributeValue("name");
@@ -76,8 +111,7 @@
if ("real".equals(type)) {
Factor factor = new Factor(name);
factor.setPath(path);
- Element fixedElement = factorElement.element("domain").element(
- "fixed");
+ Element fixedElement = factorElement.element("domain").element("fixed");
// tous les domaines continues
if (property.endsWith("continuous")) {
@@ -135,7 +169,7 @@
}
factor.setDomain(domain);
}
- plan.add(factor);
+ factorGroup.addFactor(factor);
} else if ("integer".equals(type)) {
Factor factor = new Factor(name);
factor.setPath(path);
@@ -198,11 +232,28 @@
}
factor.setDomain(domain);
}
- plan.add(factor);
+ factorGroup.addFactor(factor);
+ } else if ("rule".equals(type)) {
+ Factor factor = new Factor(name);
+ factor.setPath(path);
+ Element fixedElement = factorElement.element("domain").element("fixed");
+ if ("discrete".equals(property)) {
+ RuleDomain domain = new RuleDomain();
+ List<Element> valueElements = fixedElement.element("enumeration").elements("value");
+ int label = 0;
+ for (Element valueElement : valueElements) {
+ Element rulesElement = valueElement.element("rules");
+ List<Rule> rulesValue = MexicoHelper.getRulesFromXml(rulesElement, topiaContext);
+ domain.getValues().put(Integer.valueOf(label), rulesValue);
+ ++label;
+ }
+ factor.setDomain(domain);
+ }
+ factorGroup.addFactor(factor);
}
}
- return plan;
+ return factorGroup;
}
/*
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomainXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomainXMLVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/DomainXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -36,27 +36,6 @@
* Last update : $Date: 5 mars 2009 $
* By : $Author: chatellier $
*/
-public abstract class DomainXMLVisitor implements DomainVisitor {
+public abstract class DomainXMLVisitor extends AbstractXMLVisitor implements DomainVisitor {
- /** XML text buffer. */
- protected StringBuffer xmlBuffer;
-
- /**
- * Constructor.
- *
- * Init xml buffer.
- */
- public DomainXMLVisitor() {
- xmlBuffer = new StringBuffer();
- }
-
- /**
- * Get xml buffer content.
- *
- * @return content as string
- */
- public String getXML() {
- String xml = xmlBuffer.toString();
- return xml;
- }
}
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorGroupXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorGroupXMLVisitor.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorGroupXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -0,0 +1,80 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $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 General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.mexico.xml;
+
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
+import fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorGroupVisitor;
+
+/**
+ * XML factor group visitor.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FactorGroupXMLVisitor extends AbstractXMLVisitor implements FactorGroupVisitor {
+
+ /*
+ * @see fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorGroupVisitor#start(fr.ifremer.isisfish.simulator.sensitivity.FactorGroup)
+ */
+ @Override
+ public void start(FactorGroup factorGroup) {
+ xmlBuffer.append("<factors");
+ if (factorGroup.getName() != null) {
+ xmlBuffer.append(" name=\"" + factorGroup.getName() + "\"");
+ }
+ xmlBuffer.append(">");
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorGroupVisitor#visit(fr.ifremer.isisfish.simulator.sensitivity.FactorGroup, fr.ifremer.isisfish.simulator.sensitivity.Factor)
+ */
+ @Override
+ public void visit(FactorGroup factorGroup, Factor factor) {
+ if (factor instanceof FactorGroup) {
+ FactorGroup factorGroup2 = (FactorGroup)factor;
+ FactorGroupXMLVisitor visitor = new FactorGroupXMLVisitor();
+ factorGroup2.accept(visitor);
+ xmlBuffer.append(visitor.getXML());
+ }
+ else {
+ FactorXMLVisitor visitor = new FactorXMLVisitor();
+ factor.accept(visitor);
+ xmlBuffer.append(visitor.getXML());
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorGroupVisitor#end(fr.ifremer.isisfish.simulator.sensitivity.FactorGroup)
+ */
+ @Override
+ public void end(FactorGroup factorGroup) {
+ xmlBuffer.append("</factors>");
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorGroupXMLVisitor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -27,12 +27,14 @@
import java.io.Serializable;
+import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.simulator.sensitivity.Domain;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.RuleDomain;
import fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorVisitor;
/**
@@ -44,30 +46,8 @@
* Last update : $Date: 5 mars 2009 $
* By : $Author: chatellier $
*/
-public class FactorXMLVisitor implements FactorVisitor {
+public class FactorXMLVisitor extends AbstractXMLVisitor implements FactorVisitor {
- /** XML text buffer. */
- protected StringBuffer xmlBuffer;
-
- /**
- * Constructor.
- *
- * Init xml buffer.
- */
- public FactorXMLVisitor() {
- xmlBuffer = new StringBuffer();
- }
-
- /**
- * Get xml buffer content.
- *
- * @return content as string
- */
- public String getXML() {
- String xml = xmlBuffer.toString();
- return xml;
- }
-
/*
* @see fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorVisitor#start(fr.ifremer.isisfish.simulator.sensitivity.Factor)
*/
@@ -101,6 +81,9 @@
else if (referenceValueForType instanceof Integer) {
xmlBuffer.append(" type=\"integer\"");
}
+ else if (factor.getDomain() instanceof RuleDomain) {
+ xmlBuffer.append(" type=\"rule\"");
+ }
xmlBuffer.append(">");
// target element
xmlBuffer.append("<target>" + factor.getPath() + "</target>");
@@ -127,6 +110,9 @@
else if (factor.getDomain() instanceof ContinuousDomain) {
visitor = new ContinuousDomainXMLVisitor();
}
+ else if (factor.getDomain() instanceof RuleDomain) {
+ visitor = new RuleDomainXMLVisitor();
+ }
else if (factor.getDomain() instanceof DiscreteDomain) {
visitor = new DiscreteDomainXMLVisitor();
}
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -0,0 +1,57 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $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 General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.mexico.xml;
+
+import java.util.List;
+
+import fr.ifremer.isisfish.mexico.MexicoHelper;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.simulator.sensitivity.Domain;
+
+/**
+ * XML rule domain visitor.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class RuleDomainXMLVisitor extends DiscreteDomainXMLVisitor {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void visit(Domain domain, Object label, Object value) {
+ List<Rule> rulesList = (List<Rule>)value;
+ String rulesAsXml = MexicoHelper.getRulesAsXml(rulesList);
+
+ xmlBuffer.append("<value>");
+ xmlBuffer.append(rulesAsXml);
+ xmlBuffer.append("</value>");
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ScenarioXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ScenarioXMLVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/ScenarioXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -38,31 +38,9 @@
* Last update : $Date: 5 mars 2009 $
* By : $Author: chatellier $
*/
-public class ScenarioXMLVisitor implements ScenarioVisitor {
+public class ScenarioXMLVisitor extends AbstractXMLVisitor implements ScenarioVisitor {
- /** XML text buffer. */
- protected StringBuffer xmlBuffer;
-
/**
- * Constructor.
- *
- * Init xml buffer.
- */
- public ScenarioXMLVisitor() {
- xmlBuffer = new StringBuffer();
- }
-
- /**
- * Get xml buffer content.
- *
- * @return content as string
- */
- public String getXML() {
- String xml = xmlBuffer.toString();
- return xml;
- }
-
- /**
* {@inheritDoc}
*/
@Override
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/SensitivityScenariosXMLVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/SensitivityScenariosXMLVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/SensitivityScenariosXMLVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -38,31 +38,9 @@
* Last update : $Date: 5 mars 2009 $
* By : $Author: chatellier $
*/
-public class SensitivityScenariosXMLVisitor implements SensitivityScenariosVisitor {
+public class SensitivityScenariosXMLVisitor extends AbstractXMLVisitor implements SensitivityScenariosVisitor {
- /** XML text buffer. */
- protected StringBuffer xmlBuffer;
-
/**
- * Constructor.
- *
- * Init xml buffer.
- */
- public SensitivityScenariosXMLVisitor() {
- xmlBuffer = new StringBuffer();
- }
-
- /**
- * Get xml buffer content.
- *
- * @return content as string
- */
- public String getXML() {
- String xml = xmlBuffer.toString();
- return xml;
- }
-
- /**
* {@inheritDoc}
*/
@Override
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 1999 - 2011 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/main/java/fr/ifremer/isisfish/simulator/sensitivity/DesignPlan.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/DesignPlan.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/DesignPlan.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -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
@@ -26,7 +26,6 @@
package fr.ifremer.isisfish.simulator.sensitivity;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -46,43 +45,41 @@
/** serialVersionUID. */
private static final long serialVersionUID = 977975461743758075L;
- /** Liste des facteurs a utiliser */
- protected List<Factor> factors;
-
+ /** Groupe de facteur principal du design plan. */
+ protected FactorGroup factorGroup;
+
/**
* Constructor.
*/
public DesignPlan() {
- factors = new ArrayList<Factor>();
+ factorGroup = new FactorGroup(null, true);
}
/**
- * Get factors list (not modifiable).
+ * Get factors list, first level of factor groups (not modifiable).
*
* @return factors list
*/
public List<Factor> getFactors() {
- return Collections.unmodifiableList(factors);
+ return Collections.unmodifiableList(factorGroup.getFactors());
}
/**
* Add factor.
*
* @param f factor to add
- * @return {@code true} if factor has been added
- * @see java.util.List#add(java.lang.Object)
*/
- public boolean add(Factor f) {
- return factors.add(f);
+ public void addFactor(Factor f) {
+ factorGroup.addFactor(f);
}
/**
- * Set factors list.
+ * Set factors group.
*
- * @param factors the factors list to set
+ * @param factorGroup main factor group
*/
- public void setFactors(List<Factor> factors) {
- this.factors = factors;
+ public void setFactorGroup(FactorGroup factorGroup) {
+ this.factorGroup = factorGroup;
}
/**
@@ -92,9 +89,7 @@
*/
public void accept(DesignPlanVisitor visitor) {
visitor.start(this);
- for (Factor factor : factors) {
- visitor.visit(this, factor);
- }
+ visitor.visit(this, factorGroup);
visitor.end(this);
}
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/FactorGroup.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/FactorGroup.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/FactorGroup.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -33,6 +33,7 @@
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.visitor.FactorGroupVisitor;
/**
* Factor group. Used for group screening.
@@ -176,6 +177,15 @@
}
/**
+ * Remove single factor.
+ *
+ * @param factor factor to remove
+ */
+ public void remove(Factor factor) {
+ factors.remove(factor);
+ }
+
+ /**
* Remove factors collection.
*
* @param allFactors factors to remove
@@ -262,6 +272,19 @@
return result;
}
+ /**
+ * Accept a new visitor.
+ *
+ * @param visitor
+ */
+ public void accept(FactorGroupVisitor visitor) {
+ visitor.start(this);
+ for (Factor factor : factors) {
+ visitor.visit(this, factor);
+ }
+ visitor.end(this);
+ }
+
@Override
public String toString() {
return "FactorGroup(" + name + ")";
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-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomain.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -189,13 +189,6 @@
@Override
public MatrixContinuousDomain clone() {
MatrixContinuousDomain cloned = (MatrixContinuousDomain)super.clone();
- /*cloned.setCardinality(this.cardinality);
- cloned.setMaxBound(this.maxBound);
- cloned.setMinBound(this.minBound);
- cloned.setCoefficient(this.coefficient);
- cloned.setMatrix(this.matrix);
- cloned.setOperator(this.operator);
- cloned.setValue(this.value);*/
return cloned;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/DesignPlanVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/DesignPlanVisitor.java 2011-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/DesignPlanVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -26,7 +26,7 @@
package fr.ifremer.isisfish.simulator.sensitivity.visitor;
import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
-import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
/**
* DesignPlan visitor.
@@ -50,9 +50,9 @@
* Visit factor.
*
* @param designPlan design plan
- * @param factor factor
+ * @param factorGroup factor group
*/
- void visit(DesignPlan designPlan, Factor factor);
+ void visit(DesignPlan designPlan, FactorGroup factorGroup);
/**
* End.
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/FactorGroupVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/FactorGroupVisitor.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/FactorGroupVisitor.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -0,0 +1,63 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $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 General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.simulator.sensitivity.visitor;
+
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
+
+/**
+ * Factor group visitor.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public interface FactorGroupVisitor {
+
+ /**
+ * Start.
+ *
+ * @param factorGroup factorGroup
+ */
+ void start(FactorGroup factorGroup);
+
+ /**
+ * Visit domain.
+ *
+ * @param factorGroup factorGroup
+ * @param factor factor
+ */
+ void visit(FactorGroup factorGroup, Factor factor);
+
+ /**
+ * End.
+ *
+ * @param factorGroup factorGroup
+ */
+ void end(FactorGroup factorGroup);
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/sensitivity/visitor/FactorGroupVisitor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
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-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/mexico/MexicoHelperTest.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2006 - 2010 Ifremer, Code Lutin, Chatellier Eric
+ * Copyright (C) 2006 - 2011 Ifremer, Code Lutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -27,22 +27,34 @@
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.Properties;
+import java.util.SortedMap;
+import java.util.TreeMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
import org.nuiton.math.matrix.MatrixFactory;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.topia.TopiaContext;
import fr.ifremer.isisfish.AbstractIsisFishTest;
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.rule.RuleHelper;
import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.RuleDomain;
/**
* Test for MexicoHelper class.
@@ -58,12 +70,22 @@
/** Commons logging log. */
private static Log log = LogFactory.getLog(MexicoHelperTest.class);
+ protected TopiaContext regionContext;
+
+ @Before
+ public void setUpRegion() {
+ RegionStorage regionStorage = RegionStorage.getRegion("BaseMotosICA");
+ regionContext = regionStorage.getStorage();
+ }
+
/**
* Get a test design plan composed with all possibles value types.
*
+ * @param useGroupAndRule build design plan with sub factor groups
* @return a test design plan
+ * @throws IsisFishException
*/
- protected DesignPlan getTestDesignPlan() {
+ protected DesignPlan getTestDesignPlan(boolean useGroupAndRule) throws IsisFishException {
DesignPlan designPlan = new DesignPlan();
// matrix 1
@@ -76,6 +98,19 @@
matrix1.setValue(new int[] { 2, 0 }, 12);
matrix1.setValue(new int[] { 2, 1 }, -1);
+ // rule 1, species = c'est une des especes de la base BaseMotosICA
+ Rule ruleTacPoids = RuleStorage.getRule("TACpoids").getNewRuleInstance();
+ Properties props = new Properties();
+ props.setProperty("rule.0.parameter.species", "fr.ifremer.isisfish.entities.Species#1169028645830#0.022262364425031378");
+ RuleHelper.populateRule(0, regionContext, ruleTacPoids, props);
+
+ // rule 2, species = c'est une des especes de la base BaseMotosICA
+ Rule ruleTailleMin = RuleStorage.getRule("TailleMin").getNewRuleInstance();
+ props = new Properties();
+ props.setProperty("rule.0.parameter.species", "fr.ifremer.isisfish.entities.Species#1169028645830#0.022262364425031378");
+ props.setProperty("rule.0.parameter.propSurvie", "42");
+ RuleHelper.populateRule(0, regionContext, ruleTailleMin, props);
+
// factor 1
Factor factorContinuous = new Factor("factor 1 (double continuous)");
ContinuousDomain domain1 = new ContinuousDomain();
@@ -123,31 +158,60 @@
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);
+
+ // 3.3.1.0
+ if (useGroupAndRule) {
+ FactorGroup group1 = new FactorGroup("discretegrp");
+ group1.addFactor(factorDiscrete);
+ group1.addFactor(factorRuleDiscrete);
+ FactorGroup group2 = new FactorGroup("continuousgrp");
+ group2.addFactor(factorContinuous);
+ group2.addFactor(factorMatrixContinuous);
+ group2.addFactor(factorEquationContinuous);
+
+ designPlan.addFactor(group1);
+ designPlan.addFactor(group2);
+ designPlan.addFactor(factorContinuous2);
+ }
+ else {
+ // 3.3.0.0
+ designPlan.addFactor(factorContinuous);
+ designPlan.addFactor(factorDiscrete);
+ designPlan.addFactor(factorContinuous2);
+ designPlan.addFactor(factorMatrixContinuous);
+ designPlan.addFactor(factorEquationContinuous);
+ }
- designPlan.add(factorContinuous);
- designPlan.add(factorDiscrete);
- designPlan.add(factorContinuous2);
- designPlan.add(factorMatrixContinuous);
- designPlan.add(factorEquationContinuous);
-
return designPlan;
}
/**
* Test method {@link MexicoHelper#getDesignPlanAsXML(DesignPlan)}.
*
+ * Sans groupe de facteur, tel qu'il était en 3.3.0.0.
+ *
* @throws IOException
+ * @throws IsisFishException
*/
@Test
- public void testGetDesignPlanAsXML() throws IOException {
+ public void testGetDesignPlanAsXML() throws IOException, IsisFishException {
- DesignPlan testDesignPlan = getTestDesignPlan();
+ DesignPlan testDesignPlan = getTestDesignPlan(false);
// test xml export
String xml = MexicoHelper.getDesignPlanAsXML(testDesignPlan);
// factor 1
- Assert.assertTrue(xml.indexOf("<range max=\"50.0\" min=\"0.0\"/>") != -1);
+ Assert.assertTrue(xml.indexOf("<range min=\"0.0\" max=\"50.0\"/>") != -1);
// factor 2
Assert.assertTrue(xml.indexOf("<factor name=\"factor 2 (double discrete)\"") != -1);
Assert.assertTrue(xml.indexOf("<value>70.9</value>") != -1);
@@ -158,7 +222,7 @@
Assert.assertTrue(xml.indexOf("0.799") != -1);
Assert.assertTrue(xml.indexOf("<mx name=\"test1\">") != -1);
// factor 5
- Assert.assertTrue(xml.indexOf("reference=\"45.0\" variable=\"L1\"") != -1);
+ Assert.assertTrue(xml.indexOf("variable=\"L1\" reference=\"45.0\"") != -1);
if (log.isDebugEnabled()) {
log.debug("testGetDesignPlanAsXML xml = " + xml);
@@ -168,6 +232,8 @@
/**
* Test method {@link MexicoHelper#getDesignPlanFromXML(File, TopiaContext)}.
*
+ * Sans groupe de facteur.
+ *
* @throws IOException
*/
@Test
@@ -189,12 +255,13 @@
* Test que l'export XML de l'import XML produise le meme xml.
*
* @throws IOException
+ * @throws IsisFishException
*/
@Test
- public void testExportImport() throws IOException {
+ public void testExportImport() throws IOException, IsisFishException {
// first export
- DesignPlan testDesignPlan = getTestDesignPlan();
+ DesignPlan testDesignPlan = getTestDesignPlan(false);
String xml1 = MexicoHelper.getDesignPlanAsXML(testDesignPlan);
if (log.isDebugEnabled()) {
log.debug("xml 1 = " + xml1);
@@ -203,11 +270,68 @@
// export
File testFile = new File("src/test/resources/mexico/mexicohelper_designplan.xml");
// topia context can be null in tests
- DesignPlan plan = MexicoHelper.getDesignPlanFromXML(testFile, null);
+ DesignPlan plan = MexicoHelper.getDesignPlanFromXML(testFile, regionContext);
String xml2 = MexicoHelper.getDesignPlanAsXML(plan);
if (log.isDebugEnabled()) {
log.debug("xml 2 = " + xml2);
}
Assert.assertEquals(xml1, xml2);
}
+
+ /**
+ * Test le chargement des groupes de facteurs et des facteurs de type
+ * regles depuis isis 3.3.1.0.
+ *
+ * @throws IOException
+ * @throws IsisFishException
+ */
+ @Test
+ public void testFactorGroupAndRule() throws IOException, IsisFishException {
+
+ DesignPlan testDesignPlan = getTestDesignPlan(true);
+
+ // test xml export
+ String xml = MexicoHelper.getDesignPlanAsXML(testDesignPlan);
+
+ // factor groups
+ Assert.assertTrue(xml.indexOf("<factors name=\"continuousgrp\">") != -1);
+ Assert.assertTrue(xml.indexOf("<factors name=\"continuousgrp\">") != -1);
+
+ // factor 6
+ Assert.assertTrue(xml.indexOf("<rule name=\"TACpoids\">") != -1);
+ Assert.assertTrue(xml.indexOf("<rule name=\"TailleMin\">") != -1);
+ Assert.assertTrue(xml.indexOf("<param key=\"rule.0.parameter.propSurvie\">42.0</param>") != -1);
+ Assert.assertTrue(xml.indexOf("<param key=\"rule.0.parameter.species\">fr.ifremer.isisfish.entities.Species#1169028645830#0.022262364425031378</param>") != -1);
+
+ if (log.isDebugEnabled()) {
+ log.debug("testFactorGroupAndRule xml = " + xml);
+ }
+ }
+
+ /**
+ * Test que l'export XML de l'import XML produise le meme xml.
+ *
+ * @throws IOException
+ * @throws IsisFishException
+ */
+ @Test
+ public void testExportImportWithGroup() throws IOException, IsisFishException {
+
+ // first export
+ DesignPlan testDesignPlan = getTestDesignPlan(true);
+ String xml1 = MexicoHelper.getDesignPlanAsXML(testDesignPlan);
+ if (log.isDebugEnabled()) {
+ log.debug("xml 1 = " + xml1);
+ }
+
+ // export
+ File testFile = new File("src/test/resources/mexico/mexicohelper_factorgroupdp.xml");
+ // topia context can be null in tests
+ DesignPlan plan = MexicoHelper.getDesignPlanFromXML(testFile, regionContext);
+ String xml2 = MexicoHelper.getDesignPlanAsXML(plan);
+ if (log.isDebugEnabled()) {
+ log.debug("xml 2 = " + xml2);
+ }
+ Assert.assertEquals(xml1, xml2);
+ }
}
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-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTest.java 2011-03-23 14:48:15 UTC (rev 3202)
@@ -108,9 +108,9 @@
factor3.setDomain(domain3);
factor3.setPath("fr.ifremer.isisfish.entities.PopulationGroup#1156461521076#0.6526656643346673#minLength");
- designPlan.add(factor1);
+ designPlan.addFactor(factor1);
//designPlan.add(factor2);
- designPlan.add(factor3);
+ designPlan.addFactor(factor3);
return designPlan;
}
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-03-23 14:46:56 UTC (rev 3201)
+++ isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_designplan.xml 2011-03-23 14:48:15 UTC (rev 3202)
@@ -6,7 +6,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2009 - 2010 Ifremer, Code Lutin
+ Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -23,7 +23,6 @@
<http://www.gnu.org/licenses/gpl-2.0.html>.
#L%
-->
-
<experimentalDesign>
<factors>
<factor name="factor 1 (double continuous)" property="continuous" type="real">
Added: 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 (rev 0)
+++ isis-fish/branches/3.3.1/src/test/resources/mexico/mexicohelper_factorgroupdp.xml 2011-03-23 14:48:15 UTC (rev 3202)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<experimentalDesign>
+ <factors>
+ <factors name="continuousgrp">
+ <factor name="factor 1 (double continuous)" property="continuous" type="real">
+ <target>fr.ifremer.isisfish.entities.PopulationGroup#1156461521013#0.1715620681984218#maxLength</target>
+ <domain>
+ <fixed cardinality="0">
+ <range min="0.0" max="50.0"/>
+ </fixed>
+ </domain>
+ </factor>
+ <factor name="factor 4 (MatrixContinuous)" property="matrixcontinuous" type="real">
+ <target>fr.ifremer.isisfish.entities.PopulationGroup#1156461521076#0.6526656643346673#minLength</target>
+ <domain>
+ <fixed cardinality="0">
+ <range min="0.0" max="1.0"/>
+ <coefficient value="0.799" operator="-"/>
+ <mx name="test1">
+ <dimension name="col1" size="3">
+ <label>null()</label>
+ <label>null()</label>
+ <label>null()</label>
+ </dimension>
+ <dimension name="col2" size="2">
+ <label>null()</label>
+ <label>null()</label>
+ </dimension>
+ <d>13.0</d>
+ <d>-14.0</d>
+ <d>21.0</d>
+ <d>2.0</d>
+ <d>12.0</d>
+ <d>-1.0</d>
+ </mx>
+ </fixed>
+ </domain>
+ </factor>
+ <factor name="factor 5 (EquationContinuous)" property="equationcontinuous" type="real">
+ <target>fr.ifremer.isisfish.entities.PopulationGroup#1156461521076#0.6526656643346673#maxLength</target>
+ <domain>
+ <fixed cardinality="0">
+ <range min="0.0" max="1.0"/>
+ <coefficient value="0.1" operator="-"/>
+ <equation variable="L1" reference="45.0"/>
+ </fixed>
+ </domain>
+ </factor>
+ </factors>
+ <factors name="discretegrp">
+ <factor name="factor 2 (double discrete)" property="discrete" type="real">
+ <target>fr.ifremer.isisfish.entities.PopulationGroup#1156461521064#0.022976136053553198#minLength</target>
+ <domain>
+ <fixed cardinality="5">
+ <enumeration>
+ <value>12.3</value>
+ <value>70.9</value>
+ <value>21.0</value>
+ <value>-12.1</value>
+ <value>-8.45</value>
+ </enumeration>
+ </fixed>
+ </domain>
+ </factor>
+ <factor name="factor 6 (RuleDiscrete)" property="discrete" type="rule">
+ <target>null</target>
+ <domain>
+ <fixed cardinality="2">
+ <enumeration>
+ <value>
+ <rules>
+ <rule name="TACpoids">
+ <param key="rule.0.parameter.beginDate">0</param>
+ <param key="rule.0.parameter.tacInTons">0.0</param>
+ <param key="rule.0.parameter.species">fr.ifremer.isisfish.entities.Species#1169028645830#0.022262364425031378</param>
+ <param key="rule.0.parameter.propSurvie">0.0</param>
+ <param key="rule.0.parameter.endDate">0</param>
+ <param key="rule.0.parameter.propTac">0.0</param>
+ </rule>
+ <rule name="TailleMin">
+ <param key="rule.0.parameter.beginDate">0</param>
+ <param key="rule.0.parameter.species">fr.ifremer.isisfish.entities.Species#1169028645830#0.022262364425031378</param>
+ <param key="rule.0.parameter.propSurvie">42.0</param>
+ <param key="rule.0.parameter.endDate">0</param>
+ <param key="rule.0.parameter.TailleMin">0.0</param>
+ </rule>
+ </rules>
+ </value>
+ <value>
+ <rules>
+ <rule name="TailleMin">
+ <param key="rule.0.parameter.beginDate">0</param>
+ <param key="rule.0.parameter.species">fr.ifremer.isisfish.entities.Species#1169028645830#0.022262364425031378</param>
+ <param key="rule.0.parameter.propSurvie">42.0</param>
+ <param key="rule.0.parameter.endDate">0</param>
+ <param key="rule.0.parameter.TailleMin">0.0</param>
+ </rule>
+ </rules>
+ </value>
+ </enumeration>
+ </fixed>
+ </domain>
+ </factor>
+ </factors>
+ <factor name="factor 3 (integer discrete)" property="discrete" type="integer">
+ <target>fr.ifremer.isisfish.entities.PopulationGroup#1156461521076#0.6526656643346673#minLength</target>
+ <domain>
+ <fixed cardinality="3">
+ <enumeration>
+ <value>13</value>
+ <value>14</value>
+ <value>45</value>
+ </enumeration>
+ </fixed>
+ </domain>
+ </factor>
+ </factors>
+</experimentalDesign>
\ No newline at end of file
1
0
r3201 - isis-fish/branches/3.3.1/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
23 Mar '11
Author: chatellier
Date: 2011-03-23 14:46:56 +0000 (Wed, 23 Mar 2011)
New Revision: 3201
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-03-23 14:45:26 UTC (rev 3200)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties 2011-03-23 14:46:56 UTC (rev 3201)
@@ -914,7 +914,7 @@
isisfish.sensitivity.increment=Cardinality
isisfish.sensitivity.lastValue=Last value
isisfish.sensitivity.methodfactornotsupported=The selected sensitivity method handles factors cardinalities
-isisfish.sensitivity.moveillegal=Can't compose a factor group with mixed discrete and continuous factors !
+isisfish.sensitivity.moveillegal=Can't compose a factor group with mixed discrete and continuous factors \!
isisfish.sensitivity.name=Factor name
isisfish.sensitivity.newfactorgroup.tip=Add new factor group
isisfish.sensitivity.newfactorname=Factor group name
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-03-23 14:45:26 UTC (rev 3200)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties 2011-03-23 14:46:56 UTC (rev 3201)
@@ -914,7 +914,7 @@
isisfish.sensitivity.increment=Cardinalit\u00E9
isisfish.sensitivity.lastValue=Derni\u00E8re valeur
isisfish.sensitivity.methodfactornotsupported=La m\u00E9thode de sensibilit\u00E9 choisie g\u00E8re les cardinalit\u00E9s des facteurs
-isisfish.sensitivity.moveillegal=Impossible d\'ajouter des facteurs discret et continues dans un m\u00EAme groupe de facteurs !
+isisfish.sensitivity.moveillegal=Impossible d'ajouter des facteurs discret et continues dans un m\u00EAme groupe de facteurs \!
isisfish.sensitivity.name=Nom du facteur
isisfish.sensitivity.newfactorgroup.tip=Ajouter un groupe de facteur
isisfish.sensitivity.newfactorname=Nom du groupe de facteurs
1
0
r3200 - in isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish: rule simulator
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
23 Mar '11
Author: chatellier
Date: 2011-03-23 14:45:26 +0000 (Wed, 23 Mar 2011)
New Revision: 3200
Log:
Move ruleParametertoProperties to Helper to be used in another context
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java 2011-03-23 14:44:28 UTC (rev 3199)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java 2011-03-23 14:45:26 UTC (rev 3200)
@@ -34,6 +34,7 @@
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.persistence.TopiaEntity;
+import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.RuleStorage;
import fr.ifremer.isisfish.util.ConverterUtil;
@@ -69,7 +70,7 @@
* @param region le topia context dont on a besoin
* @param props les propriétés contenant les paramètres de la règle
*
- * @deprecated use {@link #populateRule(int, TopiaContext , Rule, Properties)} instead.
+ * @deprecated since 3.3.0.0, use {@link #populateRule(int, TopiaContext , Rule, Properties)} instead.
*/
@Deprecated
public static void populateRule(int ruleIndex, RegionStorage region, Rule rule, Properties props) {
@@ -123,4 +124,36 @@
}
}
}
+
+ /**
+ * Permet de mettre les parametres de la regle sous une forme String pour
+ * pouvoir les relire ensuite.
+ *
+ * @param ruleIndex l'index de la rule
+ * @param context le context
+ * @param rule La regle dont on souhaite mettre les parametres dans l'objet
+ * Properties retourne
+ * @return L'objet Properties contenant les valeurs des parametres de la
+ * regle
+ */
+ public static Properties getRuleAsProperties(int ruleIndex, TopiaContext context, Rule rule) {
+ Properties result = new Properties();
+ ConvertUtilsBean beanUtils = ConverterUtil.getConverter(context);
+ for (String paramName : RuleStorage.getParameterNames(rule).keySet()) {
+ String paramValueString;
+ try {
+ Object value = RuleStorage.getParameterValue(rule, paramName);
+ paramValueString = beanUtils.convert(value);
+ if (paramValueString != null) {
+ result.setProperty("rule." + ruleIndex + ".parameter." + paramName, paramValueString);
+ }
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't convert parameter value to String: " + paramName, eee);
+ }
+ }
+ }
+
+ return result;
+ }
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java 2011-03-23 14:44:28 UTC (rev 3199)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java 2011-03-23 14:45:26 UTC (rev 3200)
@@ -295,38 +295,6 @@
}
/**
- * Permet de mettre les parametres de la regle sous une forme String pour
- * pouvoir les relire ensuite.
- *
- * @param ruleIndex l'index de la rule
- * @param rule La regle dont on souhaite mettre les parametres dans l'objet
- * Properties retourne
- * @return L'objet Properties contenant les valeurs des parametres de la
- * regle
- */
- protected Properties ruleParametertoProperties(int ruleIndex, Rule rule) {
- Properties result = new Properties();
- ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion()
- .getStorage());
- for (String paramName : RuleStorage.getParameterNames(rule).keySet()) {
- String paramValueString;
- try {
- Object value = RuleStorage.getParameterValue(rule, paramName);
- paramValueString = beanUtils.convert(value);
- if (paramValueString != null) {
- result.setProperty("rule." + ruleIndex + ".parameter." + paramName, paramValueString);
- }
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't convert parameter value to String: " + paramName, eee);
- }
- }
- }
-
- return result;
- }
-
- /**
* Permet de mettre les parametres de l'export sous une forme String pour
* pouvoir les relire ensuite.
*
@@ -1701,7 +1669,7 @@
int ruleIndex = 0;
for (Rule rule : getRules()) {
ruleList += RuleStorage.getName(rule) + ",";
- Properties ruleProp = ruleParametertoProperties(ruleIndex++, rule);
+ Properties ruleProp = RuleHelper.getRuleAsProperties(ruleIndex++, getRegion().getStorage(), rule);
result.putAll(ruleProp);
}
result.setProperty("rules", ruleList);
1
0
r3199 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
23 Mar '11
Author: chatellier
Date: 2011-03-23 14:44:28 +0000 (Wed, 23 Mar 2011)
New Revision: 3199
Log:
Revert visitor deletion. Visitor was customized containing a usefull hack.
Added:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionEntityVisitor.java
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionEntityVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionEntityVisitor.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionEntityVisitor.java 2011-03-23 14:44:28 UTC (rev 3199)
@@ -0,0 +1,73 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, Code Lutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.mexico.export;
+
+import org.nuiton.topia.persistence.EntityVisitor;
+import org.nuiton.topia.persistence.HorizontalEntityVisitor;
+import org.nuiton.topia.persistence.TopiaEntity;
+
+import fr.ifremer.isisfish.entities.Equation;
+
+/**
+ * Parcourt en largeur du model et délegation à un autre visiteur.
+ *
+ * Extend {@link HorizontalEntityVisitor} from topia to add
+ * a hack about internal entity equation.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class RegionEntityVisitor extends HorizontalEntityVisitor {
+
+ /**
+ * Constructor.
+ *
+ * @param delegateVisitor delegate visitor
+ */
+ public RegionEntityVisitor(EntityVisitor delegateVisitor) {
+ super(delegateVisitor);
+ }
+
+ /*
+ * @see org.nuiton.topia.persistence.EntityVisitor#visit(org.nuiton.topia.persistence.TopiaEntity, java.lang.String, java.lang.Class, java.lang.Object)
+ */
+ @Override
+ public void visit(TopiaEntity e, String name, Class<?> type, Object value) {
+ // si c'est une entité
+
+ // FIXME only hack about Equation is used instead of Topia visitor
+ if (value instanceof TopiaEntity && !(value instanceof Equation)) {
+ TopiaEntity entity = (TopiaEntity) value;
+ toVisitEntities.add(entity);
+ } else {
+ delegateVisitor.visit(e, name, type, value);
+ }
+ }
+
+} // HorizontallyEntityVisitor
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionEntityVisitor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java 2011-03-23 09:00:21 UTC (rev 3198)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java 2011-03-23 14:44:28 UTC (rev 3199)
@@ -62,7 +62,7 @@
regionExport.beginExport();
- HorizontalEntityVisitor visitor = new HorizontalEntityVisitor(regionExport);
+ RegionEntityVisitor visitor = new RegionEntityVisitor(regionExport);
// explore cells
for (Cell cell : region.getCell()) {
1
0
r3198 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
by chatellier@users.labs.libre-entreprise.org 23 Mar '11
23 Mar '11
Author: chatellier
Date: 2011-03-23 09:00:21 +0000 (Wed, 23 Mar 2011)
New Revision: 3198
Log:
Use horizontalentityvisitor from topia
Removed:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/HorizontalEntityVisitor.java
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java
Deleted: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/HorizontalEntityVisitor.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/HorizontalEntityVisitor.java 2011-03-22 15:03:22 UTC (rev 3197)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/HorizontalEntityVisitor.java 2011-03-23 09:00:21 UTC (rev 3198)
@@ -1,170 +0,0 @@
-/*
- * #%L
- * IsisFish
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin, Chatellier Eric
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-2.0.html>.
- * #L%
- */
-
-package fr.ifremer.isisfish.mexico.export;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.persistence.EntityVisitor;
-import org.nuiton.topia.persistence.TopiaEntity;
-
-import fr.ifremer.isisfish.entities.Equation;
-
-/**
- * Parcourt en largeur du model et délegation à un autre visiteur.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- *
- * @deprecated use those from topia
- */
- at Deprecated
-public class HorizontalEntityVisitor implements EntityVisitor {
-
- /** Class logger. */
- private static Log log = LogFactory.getLog(HorizontalEntityVisitor.class);
-
- /** Delegate visitor. */
- protected EntityVisitor delegateVisitor;
-
- /** Cache used to remember entity during exploration. */
- protected List<TopiaEntity> alreadyExplored;
-
- /** Entity to be visited later. */
- protected List<TopiaEntity> toVisitEntities;
-
- /**
- * Constructor.
- *
- * @param delegateVisitor delegate visitor
- */
- public HorizontalEntityVisitor(EntityVisitor delegateVisitor) {
- this.delegateVisitor = delegateVisitor;
- this.alreadyExplored = new ArrayList<TopiaEntity>();
- this.toVisitEntities = new ArrayList<TopiaEntity>();
- }
-
- /*
- * @see org.nuiton.topia.persistence.EntityVisitor#start(org.nuiton.topia.persistence.TopiaEntity)
- */
- @Override
- public void start(TopiaEntity entity) {
- delegateVisitor.start(entity);
- if (!alreadyExplored.contains(entity)) {
- alreadyExplored.add(entity);
- }
- }
-
- /*
- * @see org.nuiton.topia.persistence.EntityVisitor#visit(org.nuiton.topia.persistence.TopiaEntity, java.lang.String, java.lang.Class, java.lang.Object)
- */
- @Override
- public void visit(TopiaEntity e, String name, Class<?> type, Object value) {
- // si c'est une entité
-
- // FIXME only hack about Equation is used instead of Topia visitor
- if (value instanceof TopiaEntity && !(value instanceof Equation)) {
- TopiaEntity entity = (TopiaEntity) value;
- toVisitEntities.add(entity);
- } else {
- delegateVisitor.visit(e, name, type, value);
- }
- }
-
- /*
- * @see org.nuiton.topia.persistence.EntityVisitor#visit(org.nuiton.topia.persistence.TopiaEntity, java.lang.String, java.lang.Class, java.lang.Class, java.lang.Object)
- */
- @Override
- public void visit(TopiaEntity e, String name, Class<?> collectionType,
- Class<?> type, Object value) {
-
- Collection<?> values = (Collection<?>) value;
- if (values != null && !values.isEmpty()) {
- int i = 0;
- for (Object currentValue : values) {
- visit(e, name, type, collectionType, i++, currentValue);
- }
- }
-
- }
-
- /*
- * @see org.nuiton.topia.persistence.EntityVisitor#visit(org.nuiton.topia.persistence.TopiaEntity, java.lang.String, java.lang.Class, java.lang.Class, int, java.lang.Object)
- */
- @Override
- public void visit(TopiaEntity e, String name, Class<?> collectionType,
- Class<?> type, int index, Object value) {
- // si c'est une entité
- if (value instanceof TopiaEntity) {
- TopiaEntity entity = (TopiaEntity) value;
-
- toVisitEntities.add(entity);
- } else {
- delegateVisitor.visit(e, name, collectionType, type, index, value);
- }
- }
-
- /*
- * @see org.nuiton.topia.persistence.EntityVisitor#end(org.nuiton.topia.persistence.TopiaEntity)
- */
- @Override
- public void end(TopiaEntity entity) {
- delegateVisitor.end(entity);
-
- // here, must revisit all remembered entities
- List<TopiaEntity> currentEntities = new ArrayList<TopiaEntity>(toVisitEntities);
- // TODO verify if clearing here is enought
- toVisitEntities.clear();
- for (TopiaEntity currentEntity : currentEntities) {
- try {
- if (!alreadyExplored.contains(currentEntity)) {
- currentEntity.accept(this);
- }
- } catch (TopiaException ex) {
- if (log.isErrorEnabled()) {
- log.error("Error on horizontal exploration", ex);
- }
- }
- }
- }
-
- /*
- * @see org.nuiton.topia.persistence.EntityVisitor#clear()
- */
- @Override
- public void clear() {
- alreadyExplored.clear();
- toVisitEntities.clear();
- delegateVisitor.clear();
- }
-} // HorizontallyEntityVisitor
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java 2011-03-22 15:03:22 UTC (rev 3197)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/RegionExplorer.java 2011-03-23 09:00:21 UTC (rev 3198)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin, Chatellier Eric
+ * Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -25,9 +25,8 @@
package fr.ifremer.isisfish.mexico.export;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.HorizontalEntityVisitor;
import fr.ifremer.isisfish.entities.Cell;
import fr.ifremer.isisfish.entities.FisheryRegion;
@@ -52,9 +51,6 @@
*/
public class RegionExplorer {
- /** Class logger. */
- private static Log log = LogFactory.getLog(RegionExplorer.class);
-
/**
* Explore region and call export on each entity found.
*
@@ -65,7 +61,7 @@
public void explore(FisheryRegion region, RegionExport regionExport) throws TopiaException {
regionExport.beginExport();
-
+
HorizontalEntityVisitor visitor = new HorizontalEntityVisitor(regionExport);
// explore cells
1
0
r3197 - in isis-fish/branches/3.3.1/src: main/java/fr/ifremer/isisfish/datastore/migration main/java/fr/ifremer/isisfish/mexico main/java/fr/ifremer/isisfish/mexico/export main/java/fr/ifremer/isisfish/mexico/xml main/java/fr/ifremer/isisfish/ui main/java/fr/ifremer/isisfish/ui/input main/java/fr/ifremer/isisfish/ui/input/tree main/java/fr/ifremer/isisfish/ui/input/tree/loadors main/java/fr/ifremer/isisfish/ui/models main/java/fr/ifremer/isisfish/ui/models/common main/java/fr/ifremer/isi
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
22 Mar '11
Author: chatellier
Date: 2011-03-22 15:03:22 +0000 (Tue, 22 Mar 2011)
New Revision: 3197
Log:
Update license headers
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV0V32.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV32V33.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/package-info.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/package-info.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/CommonHandler.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/NavigationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/SimulationUI.jaxx
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/input/InputContentUI.jaxx
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/tree/FisheryDataProvider.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeNode.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/CellsNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/GearsNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/MetiersNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PopulationsNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PortsNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SetOfVesselsNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SpeciesNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/StrategiesNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/TripTypesNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/VesselTypesNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/ZonesNodeLoador.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/common/StringListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/package-info.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/RuleNamesListRenderer.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/rule/RuleMock.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomainTest.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomainTest.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/group/FactorGroupTest.java
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/widget/FormInterval.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/IntervalPanelTest.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/DatabaseMigrationClass.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -8,18 +8,18 @@
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV0V32.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV0V32.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV0V32.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -8,18 +8,18 @@
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV32V33.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV32V33.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/datastore/migration/MigrationV32V33.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -8,18 +8,18 @@
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/package-info.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/export/package-info.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 1999 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
/**
* Set of classes used during region's factor's enabled properties export.
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/package-info.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/package-info.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 1999 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
/**
* Mexico file format package.
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/package-info.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 1999 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
/**
* Design plan and scenario xml import/export.
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/CommonHandler.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/CommonHandler.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/CommonHandler.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -8,18 +8,18 @@
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/NavigationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/NavigationUI.jaxx 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/NavigationUI.jaxx 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,3 +1,27 @@
+<!--
+ #%L
+ IsisFish
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-2.0.html>.
+ #L%
+ -->
<JPanel layout='{new BorderLayout()}'>
</JPanel>
\ No newline at end of file
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/SimulationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/SimulationUI.jaxx 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/SimulationUI.jaxx 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,22 +1,27 @@
<!--
-/* *##%
- * Copyright (C) 2010 Ifremer, Code Lutin, Chatellier Eric
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
- -->
+ #%L
+ IsisFish
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 CodeLutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-2.0.html>.
+ #L%
+ -->
<JPanel layout='{new BorderLayout()}' abstract="true">
<import>
fr.ifremer.isisfish.ui.simulator.SimulAction;
@@ -92,6 +97,13 @@
getContextValue(SimulAction.class).saveSimulation(file);
}
}
+
+ /**
+ * Rafraichit l'arbre des facteurs.
+ */
+ public void refreshFactorTree() {
+
+ }
]]></script>
<JMenuBar constraints='BorderLayout.NORTH'>
<JMenu text="isisfish.simulation.menu.simulation">
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-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/WelcomeHandler.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -8,18 +8,18 @@
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
@@ -243,7 +243,7 @@
modelBuilder.addOption(IsisConfig.Option.USER_MAIL);
ConfigUI configUI = modelBuilder.buildUI(welcomeUI, _("isisfish.config.category.main"));
- JDialog dialogUI = new JDialog(welcomeUI, _("isisfish.ui.config.title"));
+ JDialog dialogUI = new JDialog(welcomeUI, _("isisfish.config.title"));
dialogUI.add(configUI);
dialogUI.pack();
dialogUI.setLocationRelativeTo(welcomeUI);
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputContentUI.jaxx 2011-03-22 15:03:22 UTC (rev 3197)
@@ -220,7 +220,8 @@
}
if (bean != null) {
FactorWizardUI wizard = new FactorWizardUI(this);
- wizard.initNew(source, bean, EditorHelper.canBeContinue(source, bean));
+ boolean continuePossible = EditorHelper.canBeContinue(source, bean);
+ wizard.initNew(source, bean, continuePossible);
wizard.pack();
wizard.setVisible(true);
}*/
@@ -263,7 +264,8 @@
if (editor != null) {
FactorWizardUI wizard = new FactorWizardUI(this);
- wizard.initNew(editor, bean, EditorHelper.canBeContinue(editor, bean));
+ boolean continuePossible = EditorHelper.canBeContinue(source, bean);
+ wizard.initNew(source, bean, continuePossible);
wizard.pack();
wizard.setLocationRelativeTo(this);
wizard.setVisible(true);
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-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,25 +1,23 @@
/*
* #%L
- *
- *
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
@@ -572,10 +570,7 @@
if (result == null) {
Constructor<?> constructor = uiClass.getConstructor(JAXXContext.class);
result = (InputContentUI<?>)constructor.newInstance(navigationUI);
-
- // fix parent container, doesn't work:(
- result.setContextValue(navigationUI, JAXXUtil.PARENT);
-
+
uiInstanceCache.put(uiClass, result);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryDataProvider.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryDataProvider.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryDataProvider.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,25 +1,23 @@
/*
* #%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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeNode.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeNode.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeNode.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,25 +1,23 @@
/*
* #%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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeRenderer.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeRenderer.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeRenderer.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,25 +1,23 @@
/*
* #%L
- *
- *
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/CellsNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/CellsNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/CellsNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/GearsNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/GearsNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/GearsNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/MetiersNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/MetiersNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/MetiersNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PopulationsNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PopulationsNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PopulationsNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PortsNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PortsNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/PortsNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SetOfVesselsNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SetOfVesselsNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SetOfVesselsNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SpeciesNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SpeciesNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/SpeciesNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/StrategiesNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/StrategiesNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/StrategiesNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/TripTypesNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/TripTypesNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/TripTypesNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/VesselTypesNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/VesselTypesNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/VesselTypesNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/ZonesNodeLoador.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/ZonesNodeLoador.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/loadors/ZonesNodeLoador.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,6 +1,5 @@
/*
* #%L
- *
* $Id$
* $HeadURL$
* %%
@@ -8,7 +7,7 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@@ -18,7 +17,7 @@
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.input.tree.loadors;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/common/StringListModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/common/StringListModel.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/common/StringListModel.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 1999 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
/* *##%
* Copyright (C) 2009-2010 Ifremer, Code Lutin
*
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/package-info.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/package-info.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 1999 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
/**
* Swing models used by both plan simulation and sensitivity simulation interface.
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/RuleNamesListRenderer.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/RuleNamesListRenderer.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/models/rule/RuleNamesListRenderer.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.ui.models.rule;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/rule/RuleMock.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/rule/RuleMock.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/rule/RuleMock.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2010 Ifremer, Code Lutin, Chatellier Eric
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 - 2011 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.rule;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomainTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomainTest.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/EquationContinuousDomainTest.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2010 Ifremer, Code Lutin, Chatellier Eric
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 - 2011 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.simulator.sensitivity.domain;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomainTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomainTest.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/domain/MatrixContinuousDomainTest.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2010 Ifremer, Code Lutin, Chatellier Eric
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 - 2011 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.simulator.sensitivity.domain;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/group/FactorGroupTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/group/FactorGroupTest.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/sensitivity/group/FactorGroupTest.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2010 Code Lutin, Chatellier Eric
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.simulator.sensitivity.group;
@@ -22,6 +29,7 @@
import fr.ifremer.isisfish.simulator.sensitivity.Domain;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
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-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -41,9 +41,9 @@
import fr.ifremer.isisfish.AbstractIsisFishTest;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
-import fr.ifremer.isisfish.simulator.sensitivity.group.FactorGroup;
import fr.ifremer.isisfish.ui.sensitivity.model.FactorTreeCellRenderer;
import fr.ifremer.isisfish.ui.sensitivity.model.FactorTreeModel;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/FormInterval.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/FormInterval.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/FormInterval.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2002 - 2009 Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2001 - 2011 Ifremer, CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.ui.widget;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/IntervalPanelTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/IntervalPanelTest.java 2011-03-22 14:58:06 UTC (rev 3196)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/ui/widget/IntervalPanelTest.java 2011-03-22 15:03:22 UTC (rev 3197)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2002 - 2010 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2002 - 2011 Ifremer, CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.ui.widget;
1
0
r3196 - isis-fish/branches/3.3.1/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
22 Mar '11
Author: chatellier
Date: 2011-03-22 14:58:06 +0000 (Tue, 22 Mar 2011)
New Revision: 3196
Log:
Implementation des groupes de facteurs (drag'n'drop)
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-03-22 14:58:00 UTC (rev 3195)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_en_GB.properties 2011-03-22 14:58:06 UTC (rev 3196)
@@ -914,7 +914,10 @@
isisfish.sensitivity.increment=Cardinality
isisfish.sensitivity.lastValue=Last value
isisfish.sensitivity.methodfactornotsupported=The selected sensitivity method handles factors cardinalities
+isisfish.sensitivity.moveillegal=Can't compose a factor group with mixed discrete and continuous factors !
isisfish.sensitivity.name=Factor name
+isisfish.sensitivity.newfactorgroup.tip=Add new factor group
+isisfish.sensitivity.newfactorname=Factor group name
isisfish.sensitivity.operator=Operator
isisfish.sensitivity.secondpass=Analyze results
isisfish.sensitivity.secondpass.title=Analyze results
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-03-22 14:58:00 UTC (rev 3195)
+++ isis-fish/branches/3.3.1/src/main/resources/i18n/isis-fish_fr_FR.properties 2011-03-22 14:58:06 UTC (rev 3196)
@@ -914,7 +914,10 @@
isisfish.sensitivity.increment=Cardinalit\u00E9
isisfish.sensitivity.lastValue=Derni\u00E8re valeur
isisfish.sensitivity.methodfactornotsupported=La m\u00E9thode de sensibilit\u00E9 choisie g\u00E8re les cardinalit\u00E9s des facteurs
+isisfish.sensitivity.moveillegal=Impossible d\'ajouter des facteurs discret et continues dans un m\u00EAme groupe de facteurs !
isisfish.sensitivity.name=Nom du facteur
+isisfish.sensitivity.newfactorgroup.tip=Ajouter un groupe de facteur
+isisfish.sensitivity.newfactorname=Nom du groupe de facteurs
isisfish.sensitivity.operator=Op\u00E9rateur
isisfish.sensitivity.secondpass=Analyse des r\u00E9sultats
isisfish.sensitivity.secondpass.title=Analyse des r\u00E9sultats
1
0
r3195 - in isis-fish/branches/3.3.1/src/main/resources/icons: . factors
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
22 Mar '11
Author: chatellier
Date: 2011-03-22 14:58:00 +0000 (Tue, 22 Mar 2011)
New Revision: 3195
Log:
Implementation des groupes de facteurs (drag'n'drop)
Added:
isis-fish/branches/3.3.1/src/main/resources/icons/factors/
isis-fish/branches/3.3.1/src/main/resources/icons/factors/c.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/ce.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/cg.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/cm.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/d.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/de.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/dg.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/dr.png
isis-fish/branches/3.3.1/src/main/resources/icons/factors/xg.png
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/c.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/c.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/ce.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/ce.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/cg.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/cg.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/cm.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/cm.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/d.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/d.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/de.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/de.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/dg.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/dg.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/dr.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/dr.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: isis-fish/branches/3.3.1/src/main/resources/icons/factors/xg.png
===================================================================
(Binary files differ)
Property changes on: isis-fish/branches/3.3.1/src/main/resources/icons/factors/xg.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r3194 - in isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui: sensitivity sensitivity/model simulator
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
by chatellier@users.labs.libre-entreprise.org 22 Mar '11
22 Mar '11
Author: chatellier
Date: 2011-03-22 14:57:49 +0000 (Tue, 22 Mar 2011)
New Revision: 3194
Log:
Implementation des groupes de facteurs (drag'n'drop)
Added:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTranferable.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTransferHandler.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTree.java
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
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/SensitivityAction.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityInputHandler.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorCardinalityTableModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeCellRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/package-info.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/RuleChooser.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -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
@@ -39,7 +39,6 @@
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;
-import jaxx.runtime.JAXXContext;
import jaxx.runtime.context.JAXXInitialContext;
import jaxx.runtime.swing.editor.NumberEditor;
@@ -55,9 +54,9 @@
import org.nuiton.topia.persistence.TopiaEntityContextable;
import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.Formule;
import fr.ifremer.isisfish.entities.Selectivity;
import fr.ifremer.isisfish.entities.TargetSpecies;
+import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
@@ -75,6 +74,7 @@
import fr.ifremer.isisfish.ui.input.RangeOfValuesUI;
import fr.ifremer.isisfish.ui.input.SelectivityEditorUI;
import fr.ifremer.isisfish.ui.input.SpeciesStructuredUI;
+import fr.ifremer.isisfish.ui.simulator.RuleChooser;
import fr.ifremer.isisfish.ui.widget.IntervalPanel;
/**
@@ -126,7 +126,16 @@
} else if (result instanceof MatrixEditor) {
MatrixEditor ui = (MatrixEditor) component;
- MatrixND m = (MatrixND) getMethodValue(entity, fieldName);
+
+ MatrixND m = null;
+ // cas des paramtres de simulation (population de depart)
+ if (entity == null) {
+ m = (MatrixND) ui.getMatrix();
+ }
+ // autre cas, attribut d'un bean
+ else {
+ m = (MatrixND) getMethodValue(entity, fieldName);
+ }
MatrixPanelEditor matrix = new MatrixPanelEditor(false);
if (m != null) {
matrix.setMatrix(m.clone());
@@ -454,7 +463,7 @@
ui.setClazz(origine.getClazz());
/// ??? was not set before
ui.setBeanProperty(origine.getBeanProperty());
- ui.setFormule((Formule) value);
+ ui.setFormule(origine.getFormule());
ui.setActive(true);
ui.refresh();
result = ui;
@@ -533,6 +542,10 @@
ui.setActive(true);
ui.refreshPanel();
result = ui;
+ } else if (result instanceof RuleChooser) {
+ RuleChooser ui = new RuleChooser();
+ ui.setRulesList((List<Rule>)value);
+ result = ui;
}
} catch (IllegalAccessException ex) {
if (log.isErrorEnabled()) {
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-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx 2011-03-22 14:57:49 UTC (rev 3194)
@@ -27,6 +27,7 @@
<import>
org.apache.commons.lang.StringUtils;
org.nuiton.topia.persistence.TopiaEntityContextable;
+ fr.ifremer.isisfish.ui.SimulationUI;
fr.ifremer.isisfish.ui.simulator.SimulAction;
fr.ifremer.isisfish.ui.input.InputSaveVerifier;
fr.ifremer.isisfish.simulator.sensitivity.Factor;
@@ -34,21 +35,22 @@
fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
- jaxx.runtime.JAXXUtil;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
java.util.SortedMap
javax.swing.JComponent
</import>
+
<Boolean id='continuePossible' javaBean='true'/>
<Boolean id='continueSelected' javaBean='false'/>
+
+ <Boolean id='discretePossible' javaBean='true'/>
<Boolean id='existingValue' javaBean='false'/>
<script><![CDATA[
-
protected JComponent cOrigine = null;
protected TopiaEntityContextable bean = null;
protected java.util.List<JComponent> discretComponents = new ArrayList<JComponent>();
@@ -76,9 +78,9 @@
});
}
-public void initNew(JComponent c, TopiaEntityContextable be, Boolean b) {
+public void initNew(JComponent source, TopiaEntityContextable be, boolean continuePossible) {
this.bean = be;
- this.cOrigine = c;
+ this.cOrigine = source;
// path is topiaId#property
// ex : fwn#fsd#0.3425345#name
@@ -87,11 +89,16 @@
String methodName = StringUtils.uncapitalize(EditorHelper.getMethod(cOrigine));
this.path = bean.getTopiaId() + "#" + methodName;
- factorName.setText(bean.toString() + "." + methodName);
- setContinuePossible(b);
+ factorNameField.setText(bean.toString() + "." + methodName);
+ setDiscretePossible(discretePossible);
+ setContinuePossible(continuePossible);
boolean selected = EditorHelper.isContinue(cOrigine);
+
+ // continue always auto selected ?
+ // warning equation can be discrete for now (only variable are continuous)
setContinueSelected(selected);
continueRadio.setSelected(selected);
+
if (isContinuePossible()){
if (EditorHelper.isRangeOfValue(cOrigine)) {
continuousPanel = EditorHelper.getContinuousRangeOfValuePanel(cOrigine, bean);
@@ -116,6 +123,9 @@
setContinueSelected(EditorHelper.isContinue(cOrigine));
}
+/**
+ * Reaffiche un facteur existant.
+ */
public void initExisting(JComponent cOrigine, Factor f) {
setExistingValue(true);
this.cOrigine = cOrigine;
@@ -124,20 +134,18 @@
Domain domain = f.getDomain();
this.factor = f;
+ String factorName = f.getName();
if (domain instanceof ContinuousDomain) {
if (domain instanceof EquationContinuousDomain) {
EquationContinuousDomain equationDomain = (EquationContinuousDomain)domain;
- String factorName2 = f.getName();
+
+ // dans le cas d'un facteur equation
+ // il faut enlever la varible du nom
+ // sinon, à la sauvegarde elle sera reajoutée
String suffix = "." + equationDomain.getVariableName();
- if (factorName2.endsWith(suffix)) {
- factorName2 = factorName2.substring(0, factorName2.length()-suffix.length());
- }
- factorName.setText(factorName2);
+ factorName = StringUtils.removeEnd(factorName, suffix);
}
- else {
- // for other ContinuousDomain name is the same
- factorName.setText(f.getName());
- }
+
ContinuousDomain cDomain = (ContinuousDomain) domain;
continuousPanel = EditorHelper.getContinuousPanelWithValue(cOrigine, cDomain, f);
@@ -148,9 +156,6 @@
setContinuePossible(true);
} else {
- // discret fator, name is the same
- factorName.setText(f.getName());
-
DiscreteDomain dDomain = (DiscreteDomain)domain;
int nb = dDomain.getValues().size();
@@ -177,9 +182,16 @@
tabPane.addTab("Factor " + i, js);
}
setContinuePossible(EditorHelper.canBeContinue(cOrigine, cache));
-
- this.pack();
}
+
+ factorNameField.setText(factorName);
+ if (factorName.startsWith("parameters.")) {
+ // les facteurs de parametres sont speciaux
+ // et ne doivent pas changer de nom
+ factorNameField.setEditable(false);
+ }
+
+ this.pack();
}
protected void init() {
continuousPanelContainer.add(continuousPanel, BorderLayout.CENTER);
@@ -208,16 +220,18 @@
}
protected void save() {
if (continueRadio.isSelected()) {
- getSensitivityAction().saveContinue(cOrigine, factorName.getText(), comment.getText(), path, continuousPanel, getSimulAction(), isExistingValue());
+ getSensitivityAction().saveContinue(cOrigine, factorNameField.getText(),
+ comment.getText(), path, continuousPanel, getSimulAction(), isExistingValue());
} else {
- getSensitivityAction().saveDiscret(cOrigine, factorName.getText(), comment.getText(), path, discretComponents, getSimulAction(), isExistingValue());
+ getSensitivityAction().saveDiscret(cOrigine, factorNameField.getText(),
+ comment.getText(), path, discretComponents, getSimulAction(), isExistingValue());
}
- getContextValue(SensitivityTabUI.class, JAXXUtil.PARENT).setFactorModel();
+ getContextValue(SimulationUI.class, "SimulationUI").refreshFactorTree();
exit();
}
protected void remove() {
getSimulAction().removeFactor(factor);
- getContextValue(SensitivityTabUI.class, JAXXUtil.PARENT).setFactorModel();
+ getContextValue(SimulationUI.class, "SimulationUI").refreshFactorTree();
exit();
}
protected void exit() {
@@ -227,54 +241,60 @@
</script>
<Table constraints='BorderLayout.CENTER'>
<row>
- <cell columns='1' fill='horizontal'>
+ <cell fill='horizontal'>
<JLabel text='isisfish.sensitivity.name'/>
</cell>
- <cell columns='3' fill='horizontal'>
- <JTextField id='factorName'/>
+ <cell columns='2' fill='horizontal'>
+ <JTextField id='factorNameField'/>
</cell>
</row>
<row>
- <cell columns='4' fill='horizontal'>
- <JRadioButton id='continueRadio' text='isisfish.sensitivity.continue'
- buttonGroup='factorType' visible='{isContinuePossible()}' selected='{false}' onActionPerformed='setContinueSelected(continueRadio.isSelected())'/>
+ <cell columns='3' fill='both' weightx='1' weighty='3'>
+ <JPanel layout="{new BorderLayout()}" visible='{isContinuePossible()}'>
+ <JRadioButton id='continueRadio' text='isisfish.sensitivity.continue'
+ buttonGroup='factorType' selected='{false}'
+ onActionPerformed='setContinueSelected(continueRadio.isSelected())'
+ constraints="BorderLayout.NORTH"/>
+ <JPanel id='continuousPanelContainer' layout='{new BorderLayout()}'
+ constraints="BorderLayout.CENTER"/>
+ </JPanel>
</cell>
</row>
<row>
- <cell columns='4' fill='both' weightx='1' weighty='2'>
- <JPanel id='continuousPanelContainer' layout='{new BorderLayout()}'/>
+ <cell columns='3' fill='both' weightx='1' weighty='3'>
+ <JPanel layout="{new BorderLayout()}">
+ <JRadioButton id='discret' text='isisfish.sensitivity.discret'
+ selected='{true}' buttonGroup='factorType'
+ onActionPerformed='setContinueSelected(continueRadio.isSelected())'
+ constraints="BorderLayout.NORTH"/>
+ <Table id='discretePanelContainer' constraints="BorderLayout.CENTER">
+ <row>
+ <cell fill='horizontal'>
+ <JLabel text='isisfish.sensitivity.selectDiscretNumber' enabled='{!isContinueSelected()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1'>
+ <JTextField id='discretNumber' enabled='{!isContinueSelected()}'/>
+ </cell>
+ <cell fill='horizontal'>
+ <JButton text='isisfish.sensitivity.validDiscretNumber' enabled='{!isContinueSelected()}' onActionPerformed='addTabs(discretNumber.getText())'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='3' fill='both' weightx='1' weighty='2'>
+ <JTabbedPane id='tabPane' visible='{!isContinueSelected()}' enabled='{!isContinueSelected()}'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
</cell>
</row>
<row>
- <cell columns='4' fill='horizontal'>
- <JRadioButton id='discret' text='isisfish.sensitivity.discret'
- selected='{true}' buttonGroup='factorType'
- onActionPerformed='setContinueSelected(continueRadio.isSelected())'/>
- </cell>
- </row>
- <row>
- <cell fill='horizontal'>
- <JLabel text='isisfish.sensitivity.selectDiscretNumber' enabled='{!isContinueSelected()}'/>
- </cell>
- <cell fill='horizontal'>
- <JTextField id='discretNumber' enabled='{!isContinueSelected()}'/>
- </cell>
- <cell columns='2' fill='horizontal'>
- <JButton text='isisfish.sensitivity.validDiscretNumber' enabled='{!isContinueSelected()}' onActionPerformed='addTabs(discretNumber.getText())'/>
- </cell>
- </row>
- <row>
- <cell columns='4' fill='both' weightx='1' weighty='2'>
- <JTabbedPane id='tabPane' visible='{!isContinueSelected()}' enabled='{!isContinueSelected()}'/>
- </cell>
- </row>
- <row>
- <cell columns='4' fill='horizontal'>
+ <cell columns='3' fill='horizontal'>
<JLabel text='isisfish.sensitivity.comment'/>
</cell>
</row>
<row>
- <cell columns='4' fill='both' weighty='1'>
+ <cell columns='3' fill='both' weighty='1'>
<JScrollPane>
<JTextArea id='comment'/>
</JScrollPane>
@@ -287,8 +307,8 @@
<cell fill='horizontal'>
<JButton id='remove' text='isisfish.common.remove' visible='{isExistingValue()}' onActionPerformed='remove()'/>
</cell>
- <cell columns='2' fill='horizontal'>
- <JButton id='save' text='isisfish.common.save' enabled='{!getFactorName().getText().isEmpty()}' onActionPerformed='save()'/>
+ <cell fill='horizontal'>
+ <JButton id='save' text='isisfish.common.save' enabled='{!getFactorNameField().getText().isEmpty()}' onActionPerformed='save()'/>
</cell>
</row>
</Table>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityAction.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityAction.java 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityAction.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -39,14 +39,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.topia.persistence.TopiaEntityAbstract;
import org.nuiton.topia.persistence.TopiaEntityContextable;
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.EquationDAO;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
import fr.ifremer.isisfish.ui.simulator.SimulAction;
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-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityInputHandler.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -1,37 +1,46 @@
/*
* #%L
- *
- *
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2011 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
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Lesser Public
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
package fr.ifremer.isisfish.ui.sensitivity;
+import static org.nuiton.i18n.I18n._;
+
import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.util.List;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaContext;
@@ -39,9 +48,10 @@
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.entities.FisheryRegion;
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.ui.input.InputContentUI;
import fr.ifremer.isisfish.ui.input.InputHandler;
-import fr.ifremer.isisfish.ui.input.InputUI;
import fr.ifremer.isisfish.ui.input.tree.FisheryDataProvider;
import fr.ifremer.isisfish.ui.input.tree.FisheryTreeHelper;
import fr.ifremer.isisfish.ui.input.tree.FisheryTreeNode;
@@ -146,4 +156,155 @@
}
}
}
+
+ /**
+ * Add new factor group in factor tree.
+ *
+ * @param sensitivityTabUI
+ */
+ public void addNewFactorGroup(SensitivityTabUI sensitivityTabUI) {
+ String factorName = JOptionPane.showInputDialog(sensitivityTabUI, _("isisfish.sensitivity.newfactorname"),
+ _("isisfish.sensitivity.title"), JOptionPane.QUESTION_MESSAGE);
+
+ if (StringUtils.isNotBlank(factorName)) {
+ FactorGroup rootFactorGroup = sensitivityTabUI.getSimulAction().getFactorGroup();
+ FactorGroup factorGroup = new FactorGroup(factorName);
+ rootFactorGroup.addFactor(factorGroup);
+ sensitivityTabUI.setFactorModel();
+ }
+ }
+
+ /**
+ * Move factors to another factorgroup.
+ *
+ * @param sensitivityTabUI
+ * @param selectedFactorGroup
+ * @param movedFactors
+ */
+ public void moveFactor(SensitivityTabUI sensitivityTabUI, FactorGroup selectedFactorGroup, List<Factor> movedFactors) {
+ try {
+ // add all factors, to do first, throw
+ // exception if can't be done
+ selectedFactorGroup.addAllFactors(movedFactors);
+
+ // remove duplicated from factor group
+ FactorGroup rootFactorGroup = sensitivityTabUI.getSimulAction().getFactorGroup();
+ if (!rootFactorGroup.equals(selectedFactorGroup)) {
+ rootFactorGroup.removeAll(movedFactors);
+ }
+ for (int index = 0 ; index < rootFactorGroup.size(); ++index) {
+ Factor factor = rootFactorGroup.get(index);
+ if (factor instanceof FactorGroup) {
+ FactorGroup factorGroup = (FactorGroup)factor;
+ if (!factorGroup.equals(selectedFactorGroup)) {
+ factorGroup.removeAll(movedFactors);
+ }
+ }
+ }
+ sensitivityTabUI.setFactorModel();
+ } catch (IllegalArgumentException ex) {
+ JOptionPane.showMessageDialog(sensitivityTabUI, _("isisfish.sensitivity.moveillegal"),
+ _("isisfish.sensitivity.title"), JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+ /**
+ * Mouse click on factors tree.
+ *
+ * <ul>
+ * <li>normal click : factor edit</li>
+ * <li>right click : popup menu</li>
+ * </ul>
+ *
+ * @param sensitivityTabUI ui
+ * @param e mouse event
+ */
+ public void factorsTreeMouseClicked(final SensitivityTabUI sensitivityTabUI, MouseEvent e) {
+ // clic droit
+ if (e.getButton() == MouseEvent.BUTTON3) {
+ JPopupMenu menu = new JPopupMenu();
+ JMenuItem menuItemDelete = new JMenuItem(_("isisfish.common.delete"));
+ menuItemDelete.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ deleteSelectedFactors(sensitivityTabUI);
+ }
+ });
+ menu.add(menuItemDelete);
+ menu.show(e.getComponent(), e.getX(), e.getY());
+ }
+ else if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
+ // autre double clic
+ factorSelected(sensitivityTabUI);
+ }
+ }
+
+ /**
+ * Factor selection, display modification wizard.
+ *
+ * @param sensitivityTabUI
+ */
+ protected void factorSelected(SensitivityTabUI sensitivityTabUI) {
+ // get selected factor
+ TreePath selectedPath = sensitivityTabUI.getFactorsTree().getSelectionPath();
+ Object[] pathWay = selectedPath.getPath();
+ Object selectedObject = pathWay[pathWay.length - 1];
+
+ if (selectedObject != null) {
+ if (!(selectedObject instanceof FactorGroup)) {
+ Factor selectedFactor = (Factor)selectedObject;
+ FactorWizardUI wizard = new FactorWizardUI(sensitivityTabUI);
+
+ JComponent component = sensitivityTabUI.getSimulAction().getFactorComponent(selectedFactor);
+ if (component != null) {
+ wizard.initExisting(component, selectedFactor);
+ wizard.pack();
+ wizard.setLocationRelativeTo(sensitivityTabUI);
+ wizard.setVisible(true);
+ }
+ else {
+
+ // cas d'un rechargement de simulation
+ // le facteur n'a pas d'instance de composant associé
+ // method 2
+ JComponent component2 = EditorHelper.getEditorForFactor(selectedFactor, sensitivityTabUI.getFisheryRegion().getTopiaContext());
+ if (component2 != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Component found is " + component2);
+ }
+ wizard.initExisting(component2, selectedFactor);
+ wizard.pack();
+ wizard.setLocationRelativeTo(sensitivityTabUI);
+ wizard.setVisible(true);
+ }
+ else {
+ if (log.isDebugEnabled()) {
+ log.debug("No component found, skip edition of factor " + selectedFactor.getName());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Delete selection factor.
+ */
+ protected void deleteSelectedFactors(SensitivityTabUI sensitivityTabUI) {
+ // get selected factor
+ TreePath selectedPath = sensitivityTabUI.getFactorsTree().getSelectionPath();
+ Object[] pathWay = selectedPath.getPath();
+ Object selectedObject = pathWay[pathWay.length - 1];
+
+ if (selectedObject != null) {
+ if (selectedObject instanceof Factor) {
+ Factor selectedFactor = (Factor)selectedObject;
+ if (log.isDebugEnabled()) {
+ log.debug("Deleting factor " + selectedFactor.getName());
+ }
+ sensitivityTabUI.getSimulAction().removeFactor(selectedFactor);
+ sensitivityTabUI.setFactorModel();
+ }
+ }
+ }
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityTabUI.jaxx 2011-03-22 14:57:49 UTC (rev 3194)
@@ -36,9 +36,10 @@
fr.ifremer.isisfish.ui.input.InputAction;
fr.ifremer.isisfish.ui.input.InputSaveVerifier;
fr.ifremer.isisfish.ui.simulator.SimulAction;
- fr.ifremer.isisfish.simulator.sensitivity.group.FactorGroup;
+ fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
fr.ifremer.isisfish.ui.sensitivity.model.FactorTreeModel;
fr.ifremer.isisfish.ui.sensitivity.model.FactorTreeCellRenderer;
+ fr.ifremer.isisfish.ui.sensitivity.model.FactorTree
javax.swing.JComponent
java.awt.event.ActionListener
javax.swing.JMenuItem
@@ -49,13 +50,6 @@
<fr.ifremer.isisfish.entities.FisheryRegion id='fisheryRegion' javaBean='null'/>
<script><![CDATA[
-
-
-protected void $afterCompleteSetup() {
- // end code constructor
- //getVerifier().setSensPanel(this);
-}
-
protected InputAction getInputAction() {
return getContextValue(InputAction.class);
}
@@ -72,67 +66,7 @@
return getContextValue(RegionStorage.class);
}
-/**
- * Mouse click on factors tree.
- *
- * <ul>
- * <li>normal click : factor edit</li>
- * <li>right click : popup menu</li>
- * </ul>
- */
-public void factorsTreeMouseClicked(MouseEvent e) {
- // clic droit
- if (e.getButton() == MouseEvent.BUTTON3) {
- JPopupMenu menu = new JPopupMenu();
- JMenuItem menuItemDelete = new JMenuItem(_("isisfish.common.delete"));
- menuItemDelete.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- deleteSelectedFactors();
- }
- });
- menu.add(menuItemDelete);
- menu.show(e.getComponent(), e.getX(), e.getY());
- }
- else {
- // autre clic
- factorSelected();
- }
-}
-protected void factorSelected() {
- Object selectedObject = factorsTree.getSelectionValue();
- if (selectedObject != null) {
- if (selectedObject instanceof Factor) {
- Factor selectedFactor = (Factor)selectedObject;
- FactorWizardUI wizard = new FactorWizardUI(this);
- JComponent component = getSimulAction().getFactorComponent(selectedFactor);
- if (component != null) {
- wizard.initExisting(component, selectedFactor);
- wizard.pack();
- wizard.setVisible(true);
- }
- else {
-
- // method 2
- JComponent component2 = EditorHelper.getEditorForFactor(selectedFactor, getFisheryRegion().getTopiaContext());
- if (component2 != null) {
- if (log.isDebugEnabled()) {
- log.debug("Component found is " + component2);
- }
- wizard.initExisting(component2, selectedFactor);
- wizard.pack();
- wizard.setVisible(true);
- }
- else {
- if (log.isDebugEnabled()) {
- log.debug("No component found, skip edition of factor " + selectedFactor.getName());
- }
- }
- }
- }
- }
-}
public void setTreeModel() {
if (getFisheryRegion() != null) {
getCardlayoutPrincipal().show(inputPanePrincipal,"normale");
@@ -154,24 +88,8 @@
FactorGroup factorGroup = getSimulAction().getFactorGroup();
FactorTreeModel model = new FactorTreeModel(factorGroup);
factorsTree.setModel(model);
- factorsTree.setRootVisible(true);
getParentContainer(SensitivityUI.class).getSensitivityChooserUI().setFactorCardinalityTableModel();
}
-
-protected void deleteSelectedFactors() {
- Object selectedObject = factorsTree.getSelectionValue();
-
- if (selectedObject != null) {
- if (selectedObject instanceof Factor) {
- Factor selectedFactor = (Factor)selectedObject;
- if (log.isDebugEnabled()) {
- log.debug("Deleting factor " + selectedFactor.getName());
- }
- getSimulAction().removeFactor(selectedFactor);
- setFactorModel();
- }
- }
-}
]]>
</script>
<JSplitPane oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'>
@@ -187,20 +105,19 @@
</JScrollPane>
<Table>
<row>
- <cell>
- <JButton icon="table.png" />
- </cell>
<cell anchor='west' weightx='1.0'>
- <JButton icon="table_multiple.png" />
+ <JButton icon="table_multiple.png" toolTipText="isisfish.sensitivity.newfactorgroup.tip"
+ onActionPerformed="getHandler().addNewFactorGroup(this)"/>
</cell>
</row>
<row>
<cell columns='2' fill="both" weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JAXXTree id="factorsTree" rootVisible="true" selectionRow='0'
- model='{new DefaultTreeModel(null)}'
+ <FactorTree id="factorsTree" constructorParams='this'
+ rootVisible="true" selectionRow='0'
+ model='{new FactorTreeModel(getSimulAction().getFactorGroup())}'
cellRenderer='{new FactorTreeCellRenderer()}'
- onMouseClicked='factorsTreeMouseClicked(event)'/>
+ onMouseClicked='getHandler().factorsTreeMouseClicked(this, event)'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUI.jaxx 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivityUI.jaxx 2011-03-22 14:57:49 UTC (rev 3194)
@@ -31,6 +31,12 @@
</import>
<script><![CDATA[
+ protected void $afterCompleteSetup() {
+ super.$afterCompleteSetup();
+ // both ParamsUI and SensitivityTabUI
+ setContextValue(new SensitivityAction());
+ }
+
/**
* Refresh all simulation launch UI.
*/
@@ -60,14 +66,20 @@
public void setEnabledAnalysePlanTab(boolean selected) {
// no analyse plan in AS
}
+
+ @Override
+ public void refreshFactorTree() {
+ sensitivityTabUI.setFactorModel();
+ }
]]></script>
<JTabbedPane id="bodyTabbedPane">
<tab title='isisfish.params.title'>
- <fr.ifremer.isisfish.ui.simulator.ParamsUI id='paramsUI' sensitivity='{true}' regionStorage="{getRegionStorage()}" constructorParams='this'/>
+ <fr.ifremer.isisfish.ui.simulator.ParamsUI id='paramsUI' sensitivity='{true}' regionStorage="{getRegionStorage()}"
+ constructorParams='new JAXXInitialContext().add(new InputAction()).add(new InputSaveVerifier()).add("SimulationUI", this).add(this)'/>
</tab>
<tab title='isisfish.sensitivity.title' enabled="false">
<fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI id="sensitivityTabUI"
- constructorParams='new JAXXInitialContext().add(new InputAction()).add(new SensitivityAction()).add(new InputSaveVerifier()).add(this)'/>
+ constructorParams='new JAXXInitialContext().add(new InputAction()).add(new InputSaveVerifier()).add("SimulationUI", this).add(this)'/>
</tab>
<tab title='isisfish.sensitivityChooser.title' enabled="false">
<SensitivityChooserUI id="sensitivityChooserUI" constructorParams='this'/>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorCardinalityTableModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorCardinalityTableModel.java 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorCardinalityTableModel.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.ui.sensitivity.model;
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTranferable.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTranferable.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTranferable.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -0,0 +1,119 @@
+/*
+ * #%L
+ * Isis-Fish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.sensitivity.model;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+
+/**
+ * Represent transfered data.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$ By : $Author$
+ */
+public class FactorTranferable implements Transferable {
+
+ /** log */
+ private static Log log = LogFactory.getLog(FactorTranferable.class);
+
+ /** Data transfer mime type */
+ protected static final String MIMETYPE = DataFlavor.javaJVMLocalObjectMimeType
+ + ";class=" + Factor.class.getName();
+
+ /** Data instance */
+ protected static DataFlavor myData;
+
+ /** Factors to transfer. Chosen implementation must be serializable. */
+ protected List<Factor> factorsToTransfer;
+
+ /**
+ * Constructor.
+ *
+ * @param factorsToTransfer factors to transfer
+ */
+ public FactorTranferable(List<Factor> factorsToTransfer) {
+
+ // save task
+ this.factorsToTransfer = factorsToTransfer;
+
+ // build new DataFlavor
+ try {
+ myData = new DataFlavor(MIMETYPE);
+ } catch (ClassNotFoundException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Class not found", e);
+ }
+ }
+ }
+
+ /*
+ * @see java.awt.datatransfer.Transferable#getTransferData(java.awt.datatransfer.DataFlavor)
+ */
+ @Override
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException, IOException {
+
+ List<Factor> factorsToTransfer = null;
+
+ if (flavor == null) {
+ throw new IOException("flavor is null");
+ }
+
+ if (flavor.equals(myData)) {
+ factorsToTransfer = this.factorsToTransfer;
+ } else {
+ throw new UnsupportedFlavorException(flavor);
+ }
+
+ return factorsToTransfer;
+ }
+
+ /*
+ * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
+ */
+ @Override
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] { myData };
+ }
+
+ /*
+ * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(java.awt.datatransfer.DataFlavor)
+ */
+ @Override
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return flavor.equals(myData);
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTranferable.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTransferHandler.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTransferHandler.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTransferHandler.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -0,0 +1,173 @@
+/*
+ * #%L
+ * jTimer
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2011 CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.sensitivity.model;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.JComponent;
+import javax.swing.TransferHandler;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
+
+/**
+ * Transfer handler used to transfer tasks in table.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$ By : $Author$
+ */
+public class FactorTransferHandler extends TransferHandler {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 5433321973795969278L;
+
+ /** log. */
+ private static Log log = LogFactory.getLog(FactorTransferHandler.class);
+
+ /** Associated ui */
+ protected SensitivityTabUI sensitivityTabUI;
+
+ /**
+ * Constructor.
+ *
+ * @param sensitivityTabUI associated ui
+ */
+ public FactorTransferHandler(SensitivityTabUI sensitivityTabUI) {
+ this.sensitivityTabUI = sensitivityTabUI;
+ }
+
+ @Override
+ public boolean canImport(JComponent cp, DataFlavor[] df) {
+
+ for (DataFlavor dataFlavor : df) {
+ if (dataFlavor.equals(FactorTranferable.myData)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean importData(JComponent component, Transferable transferable) {
+
+ boolean confirmImport = false;
+
+ /*if (transferable.isDataFlavorSupported(FactorTranferable.myData)) {
+ try {
+
+ FactorTree factorTree = (FactorTree) component;
+ FactorGroup selectedFactorGroup = factorTree.getSelectedFactorGroup();
+
+ if (selectedFactorGroup != null) {
+ Object myObject = transferable.getTransferData(FactorTranferable.myData);
+ List<Factor> movedFactors = (List<Factor>) myObject;
+ }
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Exception while transfering task", e);
+ }
+ } catch (UnsupportedFlavorException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Exception while transfering task", e);
+ }
+ }
+ }*/
+
+ confirmImport = true;
+
+ return confirmImport;
+
+ }
+
+ /**
+ * Get selected task in tree, and build Transferable object for it.
+ *
+ * @param cp component
+ * @return transferable instance for selected task
+ */
+ @Override
+ protected Transferable createTransferable(JComponent cp) {
+
+ Transferable transferable = null;
+
+ FactorTree factorTree = (FactorTree) cp;
+ // only task can be moved !
+ List<Factor> selectedFactors = factorTree.getSelectedFactors();
+ if (selectedFactors != null && !selectedFactors.isEmpty()) {
+ List<Factor> factors = new LinkedList<Factor>(selectedFactors);
+ transferable = new FactorTranferable(factors);
+ }
+
+ return transferable;
+ }
+
+ @Override
+ protected void exportDone(JComponent cp, Transferable transferable, int type) {
+ if (log.isDebugEnabled()) {
+ log.debug("Transfert done");
+ }
+
+ if (type == TransferHandler.MOVE) {
+
+ try {
+ FactorTree factorTree = (FactorTree) cp;
+ // elements here, task can be move to task or projects
+ FactorGroup selectedFactorGroup = factorTree.getSelectedFactorGroup();
+
+ if (selectedFactorGroup != null) {
+ Object myObject = transferable.getTransferData(FactorTranferable.myData);
+ List<Factor> movedFactors = (List<Factor>) myObject;
+ sensitivityTabUI.getHandler().moveFactor(sensitivityTabUI, selectedFactorGroup, movedFactors);
+ }
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Exception while transfering task", e);
+ }
+ } catch (UnsupportedFlavorException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Exception while transfering task", e);
+ }
+ }
+ }
+ }
+
+ @Override
+ public int getSourceActions(JComponent component) {
+ return MOVE;
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTransferHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTree.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTree.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTree.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -0,0 +1,120 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.sensitivity.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JTree;
+import javax.swing.tree.TreePath;
+
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
+
+/**
+ * Factor tree.
+ *
+ * Add drag and drop support.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class FactorTree extends JTree {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1999481128072081972L;
+
+ /**
+ * Constructor (add drag and drop).
+ *
+ * @param sensitivityTabUI parent ui
+ */
+ public FactorTree(SensitivityTabUI sensitivityTabUI) {
+ // enable drag n drop
+ setDragEnabled(true);
+ setTransferHandler(new FactorTransferHandler(sensitivityTabUI));
+ }
+
+ /**
+ * Return selected factor group.
+ *
+ * @return selected factor group
+ */
+ public FactorGroup getSelectedFactorGroup() {
+
+ FactorGroup factorGroup = null;
+
+ TreePath[] selectedPaths = getSelectionModel().getSelectionPaths();
+ if (selectedPaths != null) {
+ for (TreePath selectedPath : selectedPaths) {
+ if (selectedPath != null) {
+ Object[] pathWay = selectedPath.getPath();
+
+ if (pathWay[pathWay.length - 1] instanceof FactorGroup) {
+ if (factorGroup == null) {
+ factorGroup = (FactorGroup)pathWay[pathWay.length - 1];
+ }
+ else {
+ // multiselection de factor group
+ // on retourne rien
+ factorGroup = null;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return factorGroup;
+ }
+
+ /**
+ * Return selected factors.
+ *
+ * @return selected factors
+ */
+ public List<Factor> getSelectedFactors() {
+
+ List<Factor> factors = new ArrayList<Factor>();
+
+ TreePath[] selectedPaths = getSelectionModel().getSelectionPaths();
+ if (selectedPaths != null) {
+ for (TreePath selectedPath : selectedPaths) {
+ if (selectedPath != null) {
+ Object[] pathWay = selectedPath.getPath();
+
+ if (!(pathWay[pathWay.length - 1] instanceof FactorGroup)) {
+ factors.add((Factor)pathWay[pathWay.length - 1]);
+ }
+ }
+ }
+ }
+
+ return factors;
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTree.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeCellRenderer.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeCellRenderer.java 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeCellRenderer.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -1,30 +1,47 @@
-/* *##%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.ui.sensitivity.model;
import java.awt.Component;
+import java.util.HashMap;
+import java.util.Map;
+import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
+import org.nuiton.util.Resource;
+
+import fr.ifremer.isisfish.simulator.sensitivity.Domain;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
/**
* Factor tree cell renderer.
@@ -40,6 +57,20 @@
/** serialVersionUID. */
private static final long serialVersionUID = 1686424876690392268L;
+ /** Icon cache. */
+ protected Map<String, Icon> iconCache;
+
+ public FactorTreeCellRenderer() {
+ iconCache = new HashMap<String, Icon>();
+ iconCache.put("c", Resource.getIcon("/icons/factors/c.png")); // continuous
+ iconCache.put("ce", Resource.getIcon("/icons/factors/ce.png")); // continuous equation
+ iconCache.put("cm", Resource.getIcon("/icons/factors/cm.png")); // continuous matrix
+ iconCache.put("d", Resource.getIcon("/icons/factors/d.png")); // discrete
+ iconCache.put("dg", Resource.getIcon("/icons/factors/dg.png")); // group discrete
+ iconCache.put("cg", Resource.getIcon("/icons/factors/cg.png")); // group continuous
+ iconCache.put("xg", Resource.getIcon("/icons/factors/xg.png")); // group unknown
+ }
+
/*
* @see javax.swing.tree.TreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean)
*/
@@ -47,13 +78,51 @@
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean selected, boolean expanded, boolean leaf, int row,
boolean hasFocus) {
-
+
JLabel c = (JLabel)super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
+ String icon = null;
+ String text = null;
if (value instanceof Factor) {
Factor factor = (Factor)value;
- c.setText(factor.getName());
+ if (value instanceof FactorGroup) {
+ FactorGroup factorGroup = (FactorGroup)value;
+ if (!factorGroup.isMixed()) { // root
+ if (factorGroup.isDiscrete()) {
+ icon = "d";
+ }
+ else if (factorGroup.isContinuous()) {
+ icon = "c";
+ }
+ else {
+ icon = "x";
+ }
+ icon +="g"; // group
+ }
+ }
+ else {
+ Domain domain = factor.getDomain();
+
+ // get factor type
+ if (domain instanceof ContinuousDomain) {
+ icon = "c";
+ }
+ else {
+ icon = "d";
+ }
+
+ // get factor data type
+ if (domain instanceof EquationContinuousDomain) {
+ icon += "e";
+ }
+ else if (domain instanceof MatrixContinuousDomain) {
+ icon += "m";
+ }
+ }
+ text = factor.getName();
}
+ c.setIcon(iconCache.get(icon));
+ c.setText(text);
return c;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeModel.java 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/FactorTreeModel.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -1,20 +1,27 @@
-/* *##%
- * Copyright (C) 2009 - 2010 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
package fr.ifremer.isisfish.ui.sensitivity.model;
@@ -25,8 +32,9 @@
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
-import fr.ifremer.isisfish.simulator.sensitivity.group.FactorGroup;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
/**
* Cette classe gere l'affichage d'une liste de facteurs dans l'arbre.
@@ -143,7 +151,7 @@
*/
@Override
public void valueForPathChanged(TreePath path, Object newValue) {
- throw new RuntimeException("Not implemented");
+ throw new IsisFishRuntimeException("Not implemented");
}
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/package-info.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/package-info.java 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/sensitivity/model/package-info.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
/**
* Sensitivity specifics swing models.
*/
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2011-03-22 14:57:49 UTC (rev 3194)
@@ -1,13 +1,27 @@
-<!-- #%L IsisFish $Id$ $HeadURL$ %% Copyright (C) 2009 - 2011 Ifremer, CodeLutin,
- Chatellier Eric %% This program is free software: you can redistribute it
- and/or modify it under the terms of the GNU General Public License as published
- by the Free Software Foundation, either version 2 of the License, or (at
- your option) any later version. This program is distributed in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- Public License for more details. You should have received a copy of the GNU
- General Public License along with this program. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
- #L% -->
+<!--
+ #%L
+ IsisFish
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2005 - 2011 Ifremer, CodeLutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-2.0.html>.
+ #L%
+ -->
<Table>
<fr.ifremer.isisfish.datastore.RegionStorage id="regionStorage" javaBean="null" />
@@ -59,8 +73,6 @@
javax.swing.ComboBoxModel
</import>
<script><![CDATA[
-
-
// instances variables déclaration
SimulationServiceListener simulationListener;
StorageChangeListener regionStorageListener;
@@ -91,6 +103,7 @@
}
}
+SimulationService.getService().addSimulationServiceListener(simulationListener);
public void refresh() {
if (simulAction.getSimulationStorage() != null) {
@@ -99,9 +112,6 @@
fieldSimulParamsDesc.setText(simulAction.getSimulationParameter().getDescription());
setListSimulParamsStrategiesItems();
setListSimulParamsPopulationsItems();
-
- // rule component
- ruleChooser.setRegionStorage(simulAction.getRegionStorage());
}
/**
@@ -268,58 +278,10 @@
int index = listSimulParamsPopulationsModel.indexOf(p);
listSimulParamsPopulations.addSelectionInterval(index, index);
}
- populationSelected();
+ simulAction.populationSelected(this);
}
}
-/**
- * Population selection changed.
- *
- * Fill matrix panel with population effectif of selected population.
- */
-protected void populationSelected() {
- CardLayout layout = (CardLayout)populationEffectivesPanel.getLayout();
-
- Object[] selectedPopulationsValues = listSimulParamsPopulations.getSelectedValues();
- if (!ArrayUtils.isEmpty(selectedPopulationsValues)) {
- populationEffectivesTabbedPane.removeAll();
- simulAction.setPopulations(selectedPopulationsValues);
-
- for (Object selectedPopulationValue : selectedPopulationsValues) {
- Population selectedPopulation = (Population)selectedPopulationValue;
- // TODO add change listener on matrix panel !!!
- final MatrixPanelEditor matrixPanel = new MatrixPanelEditor();
- MatrixND populationEffectives = simulAction.getSimulationParameter().getNumberOf(selectedPopulation);
- matrixPanel.setMatrix(populationEffectives);
-
- JPanel matrixPanelComponent = new JPanel(new BorderLayout());
- matrixPanelComponent.add(matrixPanel, BorderLayout.CENTER);
-
- // add addFactorButton with matrixPanel (just in sensitivity cas)
- if (isSensitivity()) {
- // TODO choose another name than "id"
- matrixPanel.putClientProperty("id", selectedPopulation.getName());
- // TODO add another thing that action
- JButton addFactorButton = new JButton();
- addFactorButton.setAction(new AbstractAction() {
- public void actionPerformed(ActionEvent e) {
- addFactorWithComponent(matrixPanel);
- }
- });
- addFactorButton.setIcon(SwingUtil.createImageIcon("building_add.png"));
- matrixPanelComponent.add(addFactorButton, BorderLayout.EAST);
- }
-
- populationEffectivesTabbedPane.add(matrixPanelComponent, _("isisfish.params.populationEffectives", selectedPopulation.getName()));
- }
-
- layout.show(populationEffectivesPanel, "specific");
- }
- else {
- layout.show(populationEffectivesPanel, "default");
- }
-}
-
protected void strategySelected(){
simulAction.setStrategies(listSimulParamsStrategies.getSelectedValues());
}
@@ -361,47 +323,6 @@
simulAction.resetOldSimulatorNames();
fieldSimulParamsSelect.setModel(getSimulParamsSelectModel(false));
}
-
-/**
- * Action appelée lors du clic sur les boutons a coté des composants factorisables.
- *
- * Contrairement à l'interface 'input', on edite ici des facteurs existants,
- * (créé à la première demande).
- *
- * @param e l'event initial intersepté par le layer
- */
-protected void addFactorWithComponent(JComponent source) {
-
- if (log.isDebugEnabled()) {
- log.debug("Event intercepted on " + source);
- }
-
- // redo this, here manage just two case
- Factor selectedFactor = null;
- if (source instanceof RuleChooser) {
- selectedFactor = simulAction.getFactors().get("parameters.rules");
- if (selectedFactor == null) {
- selectedFactor = new Factor("parameters.rules");
- selectedFactor.setPath("parameters.rules");
- }
- }
- else {
- if (source instanceof MatrixPanelEditor) {
- // id here is not coherent with all other attributes (bean, beanID, method)
- String property = (String)source.getClientProperty("id");
- selectedFactor = simulAction.getFactors().get("parameters.population." + property);
- selectedFactor.setPath("parameters.population." + property);
- }
- }
-
- if (selectedFactor != null) {
- FactorWizardUI wizard = new FactorWizardUI(this);
- wizard.initExisting(source, selectedFactor);
- wizard.pack();
- SwingUtil.center(this, wizard);
- wizard.setVisible(true);
- }
-}
]]>
</script>
<row>
@@ -518,11 +439,9 @@
</cell>
</row>
<row>
- <cell columns="4" fill="both" weightx="1.0"
- weighty="0.6">
+ <cell columns="4" fill="both" weightx="1.0" weighty="0.6">
<JTabbedPane id="parametersTabbedPane" enabled="{getRegionStorage() != null}">
- <tab
- title='{_("isisfish.params.stategiesAndPopulations")}'>
+ <tab title='{_("isisfish.params.stategiesAndPopulations")}'>
<Table>
<row>
<cell fill="horizontal">
@@ -538,6 +457,7 @@
<JScrollPane>
<JList id="listSimulParamsStrategies"
selectionMode="{javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ selectionModel="{new jaxx.runtime.swing.OneClicListSelectionModel(listSimulParamsStrategies.getSelectionModel(), listSimulParamsStrategies.getModel())}"
onValueChanged='strategySelected()'
enabled="{getRegionStorage() != null}" />
</JScrollPane>
@@ -547,16 +467,15 @@
<JScrollPane>
<JList id="listSimulParamsPopulations"
selectionMode="{javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
- onValueChanged='populationSelected()'
+ selectionModel="{new jaxx.runtime.swing.OneClicListSelectionModel(listSimulParamsPopulations.getSelectionModel(), listSimulParamsPopulations.getModel())}"
+ onValueChanged='simulAction.populationSelected(this)'
enabled="{getRegionStorage() != null}" />
</JScrollPane>
</cell>
</row>
<row>
- <cell fill="both" weighty="1"
- columns="2">
- <JPanel
- id="populationEffectivesPanel"
+ <cell fill="both" weighty="1" columns="2">
+ <JPanel id="populationEffectivesPanel"
layout="{new CardLayout()}">
<JLabel text="isisfish.params.nopopulation"
horizontalAlignment="center"
@@ -575,16 +494,14 @@
<tab title='{_("isisfish.params.rules")}'>
<Table>
<row>
- <cell fill="both" weightx="1"
- weighty="1">
+ <cell fill="both" weightx="1" weighty="1">
<RuleChooser id="ruleChooser"
active="{getRegionStorage() != null}" />
</cell>
<cell>
- <JButton
- id="addRuleFactorButton"
+ <JButton id="addRuleFactorButton"
icon='{SwingUtil.createImageIcon("building_add.png")}'
- onActionPerformed="addFactorWithComponent(ruleChooser)"
+ onActionPerformed="simulAction.addFactorWithComponent(this, ruleChooser)"
visible="{isSensitivity()}" />
</cell>
</row>
@@ -601,8 +518,7 @@
<Table>
<row>
<cell fill="horizontal" weightx="0.3">
- <JCheckBox
- text="isisfish.params.usePreSimulationScript"
+ <JCheckBox text="isisfish.params.usePreSimulationScript"
id="fieldUseSimulPreScripts"
selected='{simulAction.getSimulationParameter().getUsePreScript()}'
visible='{!isSensitivity()}'
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/RuleChooser.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/RuleChooser.jaxx 2011-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/RuleChooser.jaxx 2011-03-22 14:57:49 UTC (rev 3194)
@@ -21,6 +21,8 @@
License along with this program. If not, see
<http://www.gnu.org/licenses/gpl-2.0.html>.
#L%
+
+ @param : Region storage (context)
-->
<Table>
<!-- Rules collection managed by current ui instance. -->
@@ -29,9 +31,6 @@
<!-- Active enabled binding property -->
<Boolean id="active" javaBean="true"/>
- <!-- Storage to edit rule parameters. -->
- <fr.ifremer.isisfish.datastore.RegionStorage id="regionStorage" javaBean="null"/>
-
<import>
fr.ifremer.isisfish.IsisFishException;
fr.ifremer.isisfish.datastore.RuleStorage;
@@ -43,13 +42,13 @@
fr.ifremer.isisfish.ui.util.ErrorHelper;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
+ fr.ifremer.isisfish.datastore.RegionStorage;
</import>
- <script><![CDATA[
-
+ <script><![CDATA[
protected void $afterCompleteSetup() {
// Manage rule list change
- addPropertyChangeListener("rulesList", new PropertyChangeListener() {
+ addPropertyChangeListener(PROPERTY_RULES_LIST, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getNewValue() == null) {
selectedRulesList.setModel(new fr.ifremer.isisfish.ui.models.rule.RuleListModel());
@@ -115,7 +114,7 @@
RuleParametersTableModel model = new RuleParametersTableModel(selectedRule);
selectedRuleParameterTable.setModel(model);
RuleParametersTableCellEditor cellEditor = new RuleParametersTableCellEditor(selectedRule);
- cellEditor.setRegion(getRegionStorage());
+ cellEditor.setRegion(getContextValue(RegionStorage.class));
RuleParametersTableCellRenderer cellRenderer = new RuleParametersTableCellRenderer(selectedRule);
selectedRuleParameterTable.getColumnModel().getColumn(0).setCellRenderer(cellRenderer);
selectedRuleParameterTable.getColumnModel().getColumn(1).setCellEditor(cellEditor);
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-03-22 14:47:37 UTC (rev 3193)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2011-03-22 14:57:49 UTC (rev 3194)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2005 - 2010 Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ * Copyright (C) 2005 - 2011 Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin, 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
@@ -27,6 +27,9 @@
import static org.nuiton.i18n.I18n._;
+import java.awt.BorderLayout;
+import java.awt.CardLayout;
+import java.awt.event.ActionEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -43,11 +46,18 @@
import java.util.SortedMap;
import java.util.TreeMap;
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
import javax.swing.JComponent;
+import javax.swing.JPanel;
+import jaxx.runtime.SwingUtil;
+
+import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.math.matrix.MatrixND;
+import org.nuiton.math.matrix.gui.MatrixPanelEditor;
import org.nuiton.topia.TopiaContext;
import fr.ifremer.isisfish.IsisFish;
@@ -62,7 +72,6 @@
import fr.ifremer.isisfish.datastore.SensitivityStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.datastore.SimulatorStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.Species;
import fr.ifremer.isisfish.entities.Strategy;
@@ -77,14 +86,16 @@
import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.FactorGroup;
import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
import fr.ifremer.isisfish.simulator.sensitivity.SensitivityException;
import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
-import fr.ifremer.isisfish.simulator.sensitivity.group.FactorGroup;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.RuleDomain;
import fr.ifremer.isisfish.ui.SimulationUI;
+import fr.ifremer.isisfish.ui.sensitivity.FactorWizardUI;
import fr.ifremer.isisfish.ui.util.ErrorHelper;
/**
@@ -104,16 +115,17 @@
private static Log log = LogFactory.getLog(SimulAction.class);
private static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd-HH-mm");
-
+
protected SimulationParameter param = null;
protected RegionStorage regionStorage = null;
protected SimulationStorage simulStorage = null;
-
protected List<String> oldSimulNames = null;
protected String simulName = null;
protected SensitivityStorage sensitivityStorage = null;
- protected SortedMap<String, Factor> factors;
-
+
+ protected FactorGroup factorGroup = new FactorGroup(_("isisfish.sensitivity.factors"), true);
+ protected SortedMap<String, Factor> factors = new TreeMap<String, Factor>();
+
/**
* @deprecated this is not a good idea to store factor source component in
* case, and found a new component instance that can edit a factor (simulation reloading)
@@ -160,9 +172,6 @@
}
ErrorHelper.showErrorDialog(_("isisfish.error.simulation.initsimulaction"), eee);
}
-
- // factors has been requested to be sorted
- factors = new TreeMap<String, Factor>();
}
protected void setName(String name) {
@@ -823,20 +832,7 @@
* @return factor list
*/
public FactorGroup getFactorGroup() {
- FactorGroup result = new FactorGroup(_("isisfish.sensitivity.factors"), true);
- for (Factor value : factors.values()) {
- result.addFactor(value);
- }
-
- // sort factor on name (sorted on tree map now)
- /*Collections.sort(result, new Comparator<Factor<?, ?>> (){
- @Override
- public int compare(Factor<?, ?> o1, Factor<?, ?> o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });*/
-
- return result;
+ return factorGroup;
}
public SortedMap<String, Factor> getFactors() {
@@ -847,6 +843,7 @@
if (log.isDebugEnabled()) {
log.debug("Add factor (" + f.getName() + ") : " +f.getPath());
}
+ factorGroup.addFactor(f);
factors.put(f.getPath() + f.getName(), f);
factorComponent.put(f.getPath() + f.getName(), c);
designPlan.setFactors(getFactorGroup().getFactors());
@@ -1126,4 +1123,104 @@
return result;
}
+
+ /**
+ * Population selection changed.
+ *
+ * Fill matrix panel with population effectif of selected population.
+ *
+ * @param paramsUI paramsUI
+ */
+ public void populationSelected(final ParamsUI paramsUI) {
+ CardLayout layout = (CardLayout)paramsUI.getPopulationEffectivesPanel().getLayout();
+
+ Object[] selectedPopulationsValues = paramsUI.getListSimulParamsPopulations().getSelectedValues();
+ if (!ArrayUtils.isEmpty(selectedPopulationsValues)) {
+ paramsUI.getPopulationEffectivesTabbedPane().removeAll();
+ setPopulations(selectedPopulationsValues);
+
+ for (Object selectedPopulationValue : selectedPopulationsValues) {
+ Population selectedPopulation = (Population)selectedPopulationValue;
+ final MatrixPanelEditor matrixPanel = new MatrixPanelEditor();
+ MatrixND populationEffectives = getSimulationParameter().getNumberOf(selectedPopulation);
+ matrixPanel.setMatrix(populationEffectives);
+
+ JPanel matrixPanelComponent = new JPanel(new BorderLayout());
+ matrixPanelComponent.add(matrixPanel, BorderLayout.CENTER);
+
+ // add addFactorButton with matrixPanel (just in sensitivity cas)
+ if (paramsUI.isSensitivity()) {
+ matrixPanel.putClientProperty("sensitivityPopulation", selectedPopulation);
+ // TODO add another thing that action
+ JButton addFactorButton = new JButton();
+ addFactorButton.setAction(new AbstractAction() {
+
+ public void actionPerformed(ActionEvent e) {
+ addFactorWithComponent(paramsUI, matrixPanel);
+ }
+ });
+ addFactorButton.setIcon(SwingUtil.createImageIcon("building_add.png"));
+ matrixPanelComponent.add(addFactorButton, BorderLayout.EAST);
+ }
+
+ paramsUI.getPopulationEffectivesTabbedPane().add(matrixPanelComponent, _("isisfish.params.populationEffectives", selectedPopulation.getName()));
+ }
+
+ layout.show(paramsUI.getPopulationEffectivesPanel(), "specific");
+ }
+ else {
+ layout.show(paramsUI.getPopulationEffectivesPanel(), "default");
+ }
+ }
+
+ /**
+ * Action appelée lors du clic sur les boutons a coté des composants factorisables.
+ *
+ * Contrairement à l'interface 'input', on edite ici des facteurs existants,
+ * (créé à la première demande).
+ *
+ * @param paramsUI paramsUI
+ * @param source la source de l'event
+ */
+ public void addFactorWithComponent(ParamsUI paramsUI, JComponent source) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Event intercepted on " + source);
+ }
+
+ Factor selectedFactor = null;
+
+ // new factor with rule domain
+ if (source instanceof RuleChooser) {
+ selectedFactor = getFactors().get("parameters.rules");
+ if (selectedFactor == null) {
+ selectedFactor = new Factor("parameters.rules");
+ selectedFactor.setPath("parameters.rules");
+ selectedFactor.setDomain(new RuleDomain());
+ }
+ }
+
+ // new factor with matrix continous domain
+ else if (source instanceof MatrixPanelEditor) {
+ Population population = (Population)source.getClientProperty("sensitivityPopulation");
+ String factorName = "parameters.population." + population.getName();
+ selectedFactor = getFactors().get(factorName);
+ if (selectedFactor == null) {
+ selectedFactor = new Factor(factorName);
+ selectedFactor.setPath(factorName);
+ MatrixContinuousDomain factorDomain = new MatrixContinuousDomain();
+ MatrixND populationEffectives = getSimulationParameter().getNumberOf(population);
+ factorDomain.setMatrix(populationEffectives.copy());
+ selectedFactor.setDomain(factorDomain);
+ }
+ }
+
+ if (selectedFactor != null) {
+ FactorWizardUI wizard = new FactorWizardUI(paramsUI);
+ wizard.initExisting(source, selectedFactor);
+ wizard.pack();
+ wizard.setLocationRelativeTo(paramsUI);
+ wizard.setVisible(true);
+ }
+ }
}
1
0