Jmexico-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
- 164 discussions
r38 - trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor
by sletellier@users.forge.codelutin.com 26 Jan '12
by sletellier@users.forge.codelutin.com 26 Jan '12
26 Jan '12
Author: sletellier
Date: 2012-01-26 15:40:44 +0100 (Thu, 26 Jan 2012)
New Revision: 38
Url: http://forge.codelutin.com/repositories/revision/jmexico/38
Log:
#789 Render factor with name
Modified:
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java 2012-01-24 13:39:06 UTC (rev 37)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java 2012-01-26 14:40:44 UTC (rev 38)
@@ -75,7 +75,7 @@
@Override
public int compare(Factor o1, Factor o2) {
- return o1.getId().compareTo(o2.getId());
+ return o1.getName().compareTo(o2.getName());
}
});
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java 2012-01-24 13:39:06 UTC (rev 37)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java 2012-01-26 14:40:44 UTC (rev 38)
@@ -32,6 +32,6 @@
@Override
protected void loadDecorators() {
- registerJXPathDecorator(Factor.class, "${" + Factor.PROPERTY_ID + "}$s");
+ registerJXPathDecorator(Factor.class, "${" + Factor.PROPERTY_NAME + "}$s");
}
}
1
0
Author: tchemit
Date: 2012-01-24 14:39:06 +0100 (Tue, 24 Jan 2012)
New Revision: 37
Url: http://forge.codelutin.com/repositories/revision/jmexico/37
Log:
fix url
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-01-24 13:29:30 UTC (rev 36)
+++ trunk/pom.xml 2012-01-24 13:39:06 UTC (rev 37)
@@ -36,6 +36,8 @@
</description>
<inceptionYear>2011</inceptionYear>
+ <url>http://maven-site.forge.codelutin.com/jmexico</url>
+
<organization>
<name>Code Lutin</name>
</organization>
1
0
Author: maven-release
Date: 2012-01-24 14:29:30 +0100 (Tue, 24 Jan 2012)
New Revision: 36
Url: http://forge.codelutin.com/repositories/revision/jmexico/36
Log:
fix project url
Modified:
tags/jmexico-0.1/pom.xml
Modified: tags/jmexico-0.1/pom.xml
===================================================================
--- tags/jmexico-0.1/pom.xml 2012-01-24 13:19:00 UTC (rev 35)
+++ tags/jmexico-0.1/pom.xml 2012-01-24 13:29:30 UTC (rev 36)
@@ -36,6 +36,8 @@
</description>
<inceptionYear>2011</inceptionYear>
+ <url>http://maven-site.forge.codelutin.com/jmexico</url>
+
<organization>
<name>Code Lutin</name>
</organization>
1
0
r35 - in trunk: . jmexico-editor jmexico-editor-demo jmexico-model
by maven-release@users.forge.codelutin.com 24 Jan '12
by maven-release@users.forge.codelutin.com 24 Jan '12
24 Jan '12
Author: maven-release
Date: 2012-01-24 14:19:00 +0100 (Tue, 24 Jan 2012)
New Revision: 35
Url: http://forge.codelutin.com/repositories/revision/jmexico/35
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/jmexico-editor-demo/pom.xml
trunk/jmexico-editor/pom.xml
trunk/jmexico-model/pom.xml
trunk/pom.xml
Modified: trunk/jmexico-editor/pom.xml
===================================================================
--- trunk/jmexico-editor/pom.xml 2012-01-24 13:18:59 UTC (rev 34)
+++ trunk/jmexico-editor/pom.xml 2012-01-24 13:19:00 UTC (rev 35)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.reseaumexico</groupId>
Modified: trunk/jmexico-editor-demo/pom.xml
===================================================================
--- trunk/jmexico-editor-demo/pom.xml 2012-01-24 13:18:59 UTC (rev 34)
+++ trunk/jmexico-editor-demo/pom.xml 2012-01-24 13:19:00 UTC (rev 35)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.reseaumexico</groupId>
Modified: trunk/jmexico-model/pom.xml
===================================================================
--- trunk/jmexico-model/pom.xml 2012-01-24 13:18:59 UTC (rev 34)
+++ trunk/jmexico-model/pom.xml 2012-01-24 13:19:00 UTC (rev 35)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.reseaumexico</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-01-24 13:18:59 UTC (rev 34)
+++ trunk/pom.xml 2012-01-24 13:19:00 UTC (rev 35)
@@ -16,7 +16,7 @@
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
<modules>
<module>jmexico-model</module>
@@ -196,11 +196,11 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.forge.codelutin.com/svn/jmexico/tags/jmexico-0.1</connection>
+ <connection>scm:svn:http://svn.forge.codelutin.com/svn/jmexico/trunk</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/jmexico/tags/jmexico-0.1
+ scm:svn:http://svn.forge.codelutin.com/svn/jmexico/trunk
</developerConnection>
- <url>http://forge.codelutin.com/repositories/browse/jmexico/tags/jmexico-0.1</url>
+ <url>http://forge.codelutin.com/repositories/browse/jmexico/trunk</url>
</scm>
<distributionManagement>
1
0
Author: maven-release
Date: 2012-01-24 14:18:59 +0100 (Tue, 24 Jan 2012)
New Revision: 34
Url: http://forge.codelutin.com/repositories/revision/jmexico/34
Log:
[maven-release-plugin] copy for tag jmexico-0.1
Added:
tags/jmexico-0.1/
1
0
r33 - in trunk: . jmexico-editor jmexico-editor-demo jmexico-model
by maven-release@users.forge.codelutin.com 24 Jan '12
by maven-release@users.forge.codelutin.com 24 Jan '12
24 Jan '12
Author: maven-release
Date: 2012-01-24 14:18:58 +0100 (Tue, 24 Jan 2012)
New Revision: 33
Url: http://forge.codelutin.com/repositories/revision/jmexico/33
Log:
[maven-release-plugin] prepare release jmexico-0.1
Modified:
trunk/jmexico-editor-demo/pom.xml
trunk/jmexico-editor/pom.xml
trunk/jmexico-model/pom.xml
trunk/pom.xml
Modified: trunk/jmexico-editor/pom.xml
===================================================================
--- trunk/jmexico-editor/pom.xml 2012-01-18 16:58:27 UTC (rev 32)
+++ trunk/jmexico-editor/pom.xml 2012-01-24 13:18:58 UTC (rev 33)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.reseaumexico</groupId>
Modified: trunk/jmexico-editor-demo/pom.xml
===================================================================
--- trunk/jmexico-editor-demo/pom.xml 2012-01-18 16:58:27 UTC (rev 32)
+++ trunk/jmexico-editor-demo/pom.xml 2012-01-24 13:18:58 UTC (rev 33)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.reseaumexico</groupId>
Modified: trunk/jmexico-model/pom.xml
===================================================================
--- trunk/jmexico-model/pom.xml 2012-01-18 16:58:27 UTC (rev 32)
+++ trunk/jmexico-model/pom.xml 2012-01-24 13:18:58 UTC (rev 33)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.reseaumexico</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-01-18 16:58:27 UTC (rev 32)
+++ trunk/pom.xml 2012-01-24 13:18:58 UTC (rev 33)
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -18,7 +16,7 @@
<groupId>fr.reseaumexico</groupId>
<artifactId>jmexico</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
<modules>
<module>jmexico-model</module>
@@ -198,11 +196,11 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.forge.codelutin.com/svn/jmexico/trunk</connection>
+ <connection>scm:svn:http://svn.forge.codelutin.com/svn/jmexico/tags/jmexico-0.1</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/jmexico/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/jmexico/tags/jmexico-0.1
</developerConnection>
- <url>http://forge.codelutin.com/repositories/browse/jmexico/trunk</url>
+ <url>http://forge.codelutin.com/repositories/browse/jmexico/tags/jmexico-0.1</url>
</scm>
<distributionManagement>
1
0
18 Jan '12
Author: tchemit
Date: 2012-01-18 17:58:27 +0100 (Wed, 18 Jan 2012)
New Revision: 32
Url: http://forge.codelutin.com/repositories/revision/jmexico/32
Log:
update headers
fix event method names
Removed:
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator/
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/
Modified:
trunk/jmexico-editor-demo/pom.xml
trunk/jmexico-editor-demo/src/main/assembly/bin.xml
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java
trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties
trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties
trunk/jmexico-editor-demo/src/main/resources/log4j.properties
trunk/jmexico-editor-demo/src/site/rst/index.rst
trunk/jmexico-editor-demo/src/site/site_fr.xml
trunk/jmexico-editor/pom.xml
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx
trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties
trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/DateFormatFactory.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/InputDesignImpl.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoTechnicalException.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoUtil.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoXmlConstant.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/ScenarioImpl.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignFactorEvent.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignScenarioEvent.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/ScenarioFactorValueEvent.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/ExperimentDesignParser.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/InputDesignParser.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/MexicoXmlParser.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/XmlParser.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/ExperimentDesignXmlWriter.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/InputDesignXmlWriter.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/MexicoXmlWriter.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlNode.java
trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlWriter.java
trunk/jmexico-model/src/main/xmi/mexico.properties
trunk/jmexico-model/src/main/xmi/mexico.zargo
trunk/jmexico-model/src/site/site_fr.xml
trunk/src/site/resources/examples/experimentDesign.xml
trunk/src/site/rst/index.rst
Modified: trunk/jmexico-editor/pom.xml
===================================================================
--- trunk/jmexico-editor/pom.xml 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/pom.xml 2012-01-18 16:58:27 UTC (rev 32)
@@ -112,13 +112,13 @@
<goal>parserJava</goal>
<goal>gen</goal>
</goals>
- <!--<configuration>-->
- <!--<entries>-->
- <!--<entry>-->
- <!--<basedir>${maven.gen.dir}/java/</basedir>-->
- <!--</entry>-->
- <!--</entries>-->
- <!--</configuration>-->
+ <configuration>
+ <entries>
+ <entry>
+ <basedir>${maven.gen.dir}/java/</basedir>
+ </entry>
+ </entries>
+ </configuration>
</execution>
</executions>
</plugin>
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx 2012-01-18 16:58:27 UTC (rev 32)
@@ -66,7 +66,7 @@
}
]]>
</script>
-
+
<JScrollPane constraints='BorderLayout.CENTER'>
<JTable id='inputDesignTable' model='{getModel()}'/>
</JScrollPane>
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -29,10 +29,11 @@
import fr.reseaumexico.model.InputDesign;
import fr.reseaumexico.model.Scenario;
import fr.reseaumexico.model.ScenarioImpl;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.swing.*;
import java.util.Collection;
import java.util.Map;
-import javax.swing.JOptionPane;
-import org.apache.commons.lang3.StringUtils;
import static org.nuiton.i18n.I18n._;
@@ -100,7 +101,7 @@
// show scenario select dialog
Collection<Scenario> scenarios = inputDesign.getScenario();
- Scenario scenario = (Scenario)JOptionPane.showInputDialog(
+ Scenario scenario = (Scenario) JOptionPane.showInputDialog(
editor,
_("jmexico.scenario.selectRemove"),
_("jmexico.scenario.selectRemove.title"),
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -31,16 +31,17 @@
import fr.reseaumexico.model.ValueType;
import fr.reseaumexico.model.event.InputDesignScenarioEvent;
import fr.reseaumexico.model.event.InputDesignScenarioListener;
+import org.apache.commons.lang3.ObjectUtils;
+
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableModel;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import org.apache.commons.lang3.ObjectUtils;
import static org.nuiton.i18n.I18n._;
@@ -68,7 +69,7 @@
// extract factors
factors = new LinkedList<Factor>(inputDesign.getExperimentDesign().getFactor());
-
+
// sort on id
Collections.sort(factors, new Comparator<Factor>() {
@@ -82,12 +83,12 @@
}
@Override
- public void onScenarioAdded(InputDesignScenarioEvent event) {
+ public void scenarioAdded(InputDesignScenarioEvent event) {
fireTableStructureChanged();
}
@Override
- public void onScenarioRemoved(InputDesignScenarioEvent event) {
+ public void scenarioRemoved(InputDesignScenarioEvent event) {
fireTableStructureChanged();
}
@@ -178,7 +179,7 @@
if (scenario == null) {
return null;
}
- Map<Factor,Object> factorValues = scenario.getFactorValues();
+ Map<Factor, Object> factorValues = scenario.getFactorValues();
Object result = factorValues.get(factor);
return result;
@@ -191,7 +192,7 @@
return;
}
if (columnIndex == 0) {
-
+
// must never append
return;
}
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -27,9 +27,7 @@
import fr.reseaumexico.model.Factor;
import jaxx.runtime.decorator.DecoratorProvider;
-/**
- * @author sletellier <letellier(a)codelutin.com>
- */
+/** @author sletellier <letellier(a)codelutin.com> */
public class MexicoDecoratorProvider extends DecoratorProvider {
@Override
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -25,24 +25,22 @@
package fr.reseaumexico.editor.factorValue;
import fr.reseaumexico.model.Factor;
-import java.awt.Component;
+import jaxx.runtime.JAXXContext;
+
+import javax.swing.*;
+import javax.swing.table.TableCellEditor;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
-import javax.swing.AbstractCellEditor;
-import javax.swing.JComboBox;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.table.TableCellEditor;
-import jaxx.runtime.JAXXContext;
/**
* Cell editor for factor values
*
* @author sletellier <letellier(a)codelutin.com>
- * @since 0.1
* @see TableCellEditor
+ * @since 0.1
*/
public class FactorValueCellEditor extends AbstractCellEditor
implements TableCellEditor, FocusListener {
@@ -96,7 +94,7 @@
// stop editing on select for combos
if (component instanceof JComboBox) {
- ((JComboBox)component).addActionListener(new ActionListener() {
+ ((JComboBox) component).addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -25,17 +25,16 @@
package fr.reseaumexico.editor.factorValue;
import fr.reseaumexico.model.Factor;
-import java.awt.Component;
-import javax.swing.JTable;
+import jaxx.runtime.JAXXContext;
+
+import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
-import jaxx.runtime.JAXXContext;
+import java.awt.*;
-/**
- * @author sletellier <letellier(a)codelutin.com>
- */
+/** @author sletellier <letellier(a)codelutin.com> */
public class FactorValueCellRenderer implements TableCellRenderer {
-
+
protected FactorValueEditorFactory factory;
protected TableCellRenderer delegate;
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx 2012-01-18 16:58:27 UTC (rev 32)
@@ -28,8 +28,8 @@
layout='{new BorderLayout()}'>
<import>
-java.awt.BorderLayout
-fr.reseaumexico.model.Factor
+ java.awt.BorderLayout
+ fr.reseaumexico.model.Factor
</import>
<Factor id='factor' initializer='getContextValue(Factor.class)'/>
@@ -42,4 +42,4 @@
]]>
</script>
-</JDialog>
\ No newline at end of file
+</JDialog>
Modified: trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties
===================================================================
--- trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,6 +1,8 @@
+jmexico.add.scenario=Add scenario
jmexico.error.scenario.name.used=Error \: scenario name '%1$s' is already used.
jmexico.error.title=Error
jmexico.factor.name=Factor
+jmexico.remove.scenario=Delete scenario
jmexico.scenario.inputName=Name of scenario to add \:
jmexico.scenario.inputName.title=Input a name for scenario to add
jmexico.scenario.selectRemove=Select scenario to delete
Modified: trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties
===================================================================
--- trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,6 +1,8 @@
+jmexico.add.scenario=Ajouter un scénario
jmexico.error.scenario.name.used=Erreur \: le scenario '%1$s' est déjà utilisé.
jmexico.error.title=Erreur
jmexico.factor.name=Facteur
+jmexico.remove.scenario=Supprimer un scénario
jmexico.scenario.inputName=Nom du scénario à ajouter \:
jmexico.scenario.inputName.title=Enter un nom pour le scenario à ajouter
jmexico.scenario.selectRemove=Selection du scénario à supprimer
Modified: trunk/jmexico-editor-demo/pom.xml
===================================================================
--- trunk/jmexico-editor-demo/pom.xml 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/pom.xml 2012-01-18 16:58:27 UTC (rev 32)
@@ -153,13 +153,13 @@
<goal>parserJava</goal>
<goal>gen</goal>
</goals>
- <!--<configuration>-->
- <!--<entries>-->
- <!--<entry>-->
- <!--<basedir>${maven.gen.dir}/java/</basedir>-->
- <!--</entry>-->
- <!--</entries>-->
- <!--</configuration>-->
+ <configuration>
+ <entries>
+ <entry>
+ <basedir>${maven.gen.dir}/java/</basedir>
+ </entry>
+ </entries>
+ </configuration>
</execution>
<execution>
<id>make-bundle</id>
Modified: trunk/jmexico-editor-demo/src/main/assembly/bin.xml
===================================================================
--- trunk/jmexico-editor-demo/src/main/assembly/bin.xml 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/assembly/bin.xml 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
<!--
#%L
- ObServe :: Client
+ JMexico :: Swing Editor Demo
- $Id: bin.xml 1391 2011-04-15 11:53:14Z chemit $
- $HeadURL: https://svn.mpl.ird.fr/osiris/observe/trunk/observe-cli/src/main/assembly/b… $
+ $Id$
+ $HeadURL$
%%
Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
%%
Modified: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
/*
* #%L
- * JMexico :: Swing Editor
+ * JMexico :: Swing Editor Demo
*
- * $Id: MexicoMainUI.css 24 2012-01-18 09:54:16Z sletellier $
- * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 Réseau Mexico, Codelutin
* %%
@@ -23,17 +23,20 @@
* #L%
*/
#menuFile {
- text:"jmexico.menu.file";
- mnemonic:F;
+ text: "jmexico.menu.file";
+ mnemonic: F;
}
+
#menuFileOpen {
- text:"jmexico.menu.file.open";
- mnemonic:O;
+ text: "jmexico.menu.file.open";
+ mnemonic: O;
}
+
#menuFileSave {
- text:"jmexico.menu.file.save";
- mnemonic:S;
+ text: "jmexico.menu.file.save";
+ mnemonic: S;
}
+
#exit {
- text:"jmexico.menu.exit";
-}
\ No newline at end of file
+ text: "jmexico.menu.exit";
+}
Modified: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
<!--
#%L
- JMexico :: Swing Editor
+ JMexico :: Swing Editor Demo
- $Id: MexicoMainUI.jaxx 26 2012-01-18 10:25:02Z sletellier $
- $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ $Id$
+ $HeadURL$
%%
Copyright (C) 2011 Réseau Mexico, Codelutin
%%
@@ -33,7 +33,7 @@
</import>
<MexicoEditorDemoUIHandler id="handler"
- initializer='getContextValue(MexicoEditorDemoUIHandler.class)'/>
+ initializer='getContextValue(MexicoEditorDemoUIHandler.class)'/>
<MexicoEditorDemoUIModel id="model"/>
Modified: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
/*
* #%L
- * JMexico :: Swing Editor
+ * JMexico :: Swing Editor Demo
*
- * $Id: MexicoMainUIHandler.java 26 2012-01-18 10:25:02Z sletellier $
- * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2011 Réseau Mexico, Codelutin
* %%
@@ -86,7 +86,7 @@
inputDesign.addInputDesignFactorListener(new InputDesignFactorListener() {
@Override
- public void onFactorValueChange(InputDesignFactorEvent event) {
+ public void factorValueChanged(InputDesignFactorEvent event) {
ui.setInputDesign(event.getSource());
}
});
@@ -94,12 +94,12 @@
inputDesign.addInputDesignScenarioListener(new InputDesignScenarioListener() {
@Override
- public void onScenarioAdded(InputDesignScenarioEvent event) {
+ public void scenarioAdded(InputDesignScenarioEvent event) {
ui.setInputDesign(event.getSource());
}
@Override
- public void onScenarioRemoved(InputDesignScenarioEvent event) {
+ public void scenarioRemoved(InputDesignScenarioEvent event) {
ui.setInputDesign(event.getSource());
}
});
Modified: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
/*
* #%L
- * JMexico :: Swing Editor
+ * JMexico :: Swing Editor Demo
*
* $Id$
- * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * $HeadURL$
* %%
* Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
* %%
Modified: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
/*
* #%L
- * JMexico :: Swing Editor
+ * JMexico :: Swing Editor Demo
*
* $Id$
- * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * $HeadURL$
* %%
* Copyright (C) 2011 Réseau Mexico, Codelutin
* %%
Modified: trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties
===================================================================
--- trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties 2012-01-18 16:58:27 UTC (rev 32)
@@ -1 +1,5 @@
jmexico.file.open.dialog=Open an InputDesign file.
+jmexico.menu.exit=Quit
+jmexico.menu.file=File
+jmexico.menu.file.open=Open
+jmexico.menu.file.save=Save
Modified: trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties
===================================================================
--- trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties 2012-01-18 16:58:27 UTC (rev 32)
@@ -1 +1,5 @@
jmexico.file.open.dialog=Ouvrir un fichier InputDesign
+jmexico.menu.exit=Quitter
+jmexico.menu.file=Fichier
+jmexico.menu.file.open=Ouvrir
+jmexico.menu.file.save=Sauver
Modified: trunk/jmexico-editor-demo/src/main/resources/log4j.properties
===================================================================
--- trunk/jmexico-editor-demo/src/main/resources/log4j.properties 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/main/resources/log4j.properties 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
###
# #%L
-# JMexico :: Swing Editor
+# JMexico :: Swing Editor Demo
#
# $Id$
-# $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+# $HeadURL$
# %%
# Copyright (C) 2011 Réseau Mexico, Codelutin
# %%
Modified: trunk/jmexico-editor-demo/src/site/rst/index.rst
===================================================================
--- trunk/jmexico-editor-demo/src/site/rst/index.rst 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/site/rst/index.rst 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,9 +1,9 @@
.. -
.. * #%L
-.. * JMexico :: Swing Editor
+.. * JMexico :: Swing Editor Demo
.. *
-.. * $Id: index.rst 28 2012-01-18 11:35:09Z tchemit $
-.. * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/s… $
+.. * $Id$
+.. * $HeadURL$
.. * %%
.. * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
.. * %%
Modified: trunk/jmexico-editor-demo/src/site/site_fr.xml
===================================================================
--- trunk/jmexico-editor-demo/src/site/site_fr.xml 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-editor-demo/src/site/site_fr.xml 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- JMexico :: Swing Editor
+ JMexico :: Swing Editor Demo
$Id$
- $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/s… $
+ $HeadURL$
%%
Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
%%
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/DateFormatFactory.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/DateFormatFactory.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/DateFormatFactory.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -29,10 +29,10 @@
/**
* Factory for format all jmexico dates using {@link SimpleDateFormat}
- *
+ *
* @author sletellier <letellier(a)codelutin.com>
+ * @see SimpleDateFormat
* @since 0.1
- * @see SimpleDateFormat
*/
public class DateFormatFactory {
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/InputDesignImpl.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/InputDesignImpl.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/InputDesignImpl.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -32,11 +32,12 @@
import fr.reseaumexico.model.event.InputDesignScenarioListener;
import fr.reseaumexico.model.event.ScenarioFactorValueEvent;
import fr.reseaumexico.model.event.ScenarioFactorValueListener;
+
+import javax.swing.event.EventListenerList;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collection;
import java.util.Map;
-import javax.swing.event.EventListenerList;
/**
* Implementation of {@link InputDesign} to provide listener API
@@ -49,12 +50,12 @@
private static final long serialVersionUID = 1L;
protected final EventListenerList listenerList;
-
+
protected final Map<Scenario, ScenarioFactorValueListener> scenarioFactorValueListenerMap;
public InputDesignImpl() {
- this.scenarioFactorValueListenerMap = Maps.newHashMap();
- this.listenerList = new EventListenerList();
+ scenarioFactorValueListenerMap = Maps.newHashMap();
+ listenerList = new EventListenerList();
addPropertyChangeListener(PROPERTY_SCENARIO, new PropertyChangeListener() {
@Override
@@ -76,15 +77,15 @@
@Override
public void addScenario(final Scenario scenarios) {
- if (this.scenario == null) {
- this.scenario = Lists.newArrayList();
+ if (scenario == null) {
+ scenario = Lists.newArrayList();
}
super.addScenario(scenarios);
ScenarioFactorValueListener scenarioFactorValueListener = new ScenarioFactorValueListener() {
@Override
- public void onFactorValueChange(ScenarioFactorValueEvent event) {
+ public void factorValueChanged(ScenarioFactorValueEvent event) {
fireFactorChanged(scenarios, event.getFactorId(), event.getFactorOldValue(), event.getFactorNewValue());
}
};
@@ -149,7 +150,7 @@
InputDesignScenarioEvent event = new InputDesignScenarioEvent(this, scenario);
InputDesignScenarioListener[] listeners = listenerList.getListeners(InputDesignScenarioListener.class);
for (InputDesignScenarioListener listener : listeners) {
- listener.onScenarioAdded(event);
+ listener.scenarioAdded(event);
}
}
@@ -157,7 +158,7 @@
InputDesignScenarioEvent event = new InputDesignScenarioEvent(this, scenario);
InputDesignScenarioListener[] listeners = listenerList.getListeners(InputDesignScenarioListener.class);
for (InputDesignScenarioListener listener : listeners) {
- listener.onScenarioRemoved(event);
+ listener.scenarioRemoved(event);
}
}
@@ -165,7 +166,7 @@
InputDesignFactorEvent event = new InputDesignFactorEvent(this, scenario, factorId, oldValue, newValue);
InputDesignFactorListener[] listeners = listenerList.getListeners(InputDesignFactorListener.class);
for (InputDesignFactorListener listener : listeners) {
- listener.onFactorValueChange(event);
+ listener.factorValueChanged(event);
}
}
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoTechnicalException.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoTechnicalException.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoTechnicalException.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -28,7 +28,7 @@
* Mexico technical exception
*
* @author sletellier <letellier(a)codelutin.com>
- * @since 0.1
+ * @since 0.1
*/
public class MexicoTechnicalException extends RuntimeException {
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoUtil.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoUtil.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoUtil.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -26,9 +26,7 @@
import org.apache.commons.lang3.StringUtils;
-/**
- * @author sletellier <letellier(a)codelutin.com>
- */
+/** @author sletellier <letellier(a)codelutin.com> */
public class MexicoUtil {
public static Object getTypedValue(ValueType type, String value) {
@@ -37,10 +35,18 @@
return null;
}
switch (type) {
- case INTEGER: result = Integer.parseInt(value); break;
- case BOOLEAN: result = Boolean.parseBoolean(value); break;
- case DECIMAL: result = Double.parseDouble(value); break;
- default: result = value; break;
+ case INTEGER:
+ result = Integer.parseInt(value);
+ break;
+ case BOOLEAN:
+ result = Boolean.parseBoolean(value);
+ break;
+ case DECIMAL:
+ result = Double.parseDouble(value);
+ break;
+ default:
+ result = value;
+ break;
// TODO sletelier : convert string to matrice
// case MATRICE:
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoXmlConstant.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoXmlConstant.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/MexicoXmlConstant.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -32,40 +32,40 @@
* @author sletellier <letellier(a)codelutin.com>
* @since 0.1
*/
-public class MexicoXmlConstant {
+public interface MexicoXmlConstant {
- public static final String EXPERIMENT_DESIGN = Introspector.decapitalize(ExperimentDesign.class.getSimpleName());
- public static final String EXPERIMENT_DESIGN_DATE = ExperimentDesign.PROPERTY_DATE;
- public static final String EXPERIMENT_DESIGN_ID = ExperimentDesign.PROPERTY_ID;
- public static final String EXPERIMENT_DESIGN_AUTHOR = ExperimentDesign.PROPERTY_AUTHOR;
- public static final String EXPERIMENT_DESIGN_LICENCE = ExperimentDesign.PROPERTY_LICENCE;
- public static final String EXPERIMENT_DESIGN_DESCRIPTION = ExperimentDesign.PROPERTY_DESCRIPTION;
- public static final String FACTORS = "factors";
- public static final String FACTOR = Introspector.decapitalize(Factor.class.getSimpleName());
- public static final String FACTOR_ID = Factor.PROPERTY_ID;
- public static final String FACTOR_NAME = Factor.PROPERTY_NAME;
- public static final String FACTOR_UNIT = Factor.PROPERTY_UNIT;
- public static final String FACTOR_DESCRIPTION = Factor.PROPERTY_DESCRIPTION;
- public static final String DOMAIN = Factor.PROPERTY_DOMAIN;
- public static final String DOMAIN_NAME = Domain.PROPERTY_NAME;
- public static final String DOMAIN_DISTRIBUTION_NAME = Domain.PROPERTY_DISTRIBUTION_NAME;
- public static final String DOMAIN_DISTRIBUTION_PARAMETER = Introspector.decapitalize(DistributionParameter.class.getSimpleName());
- public static final String DISTRIBUTION_PARAMETER_NAME = DistributionParameter.PROPERTY_NAME;
- public static final String DISTRIBUTION_PARAMETER_VALUE = DistributionParameter.PROPERTY_VALUE;
- public static final String DISTRIBUTION_PARAMETER_VALUE_TYPE = DistributionParameter.PROPERTY_VALUE_TYPE;
- public static final String DOMAIN_LEVEL = Introspector.decapitalize(Level.class.getSimpleName());
- public static final String LEVEL_VALUE = Level.PROPERTY_VALUE;
- public static final String LEVEL_WEIGHT = Level.PROPERTY_WEIGHT;
- public static final String DOMAIN_VALUE_TYPE = Domain.PROPERTY_VALUE_TYPE;
- public static final String DOMAIN_NOMINAL_VALUE = Domain.PROPERTY_NOMINAL_VALUE;
- public static final String FEATURE = Introspector.decapitalize(Feature.class.getSimpleName());
- public static final String FEATURE_NAME = Feature.PROPERTY_NAME;
- public static final String FEATURE_VALUE = Feature.PROPERTY_VALUE;
- public static final String FEATURE_VALUE_TYPE = Feature.PROPERTY_VALUE_TYPE;
- public static final String INPUT_DESIGN = Introspector.decapitalize(InputDesign.class.getSimpleName());
- public static final String INPUT_DESIGN_DATE = InputDesign.PROPERTY_DATE;
- public static final String SCENARIO = Introspector.decapitalize(Scenario.class.getSimpleName());
- public static final String SCENARIO_NAME = Scenario.PROPERTY_NAME;
- public static final String SCENARIO_ORDER_NUMBER = Scenario.PROPERTY_ORDER_NUMBER;
- public static final String SCENARIO_FACTOR_VALUES = Scenario.PROPERTY_FACTOR_VALUES;
+ String EXPERIMENT_DESIGN = Introspector.decapitalize(ExperimentDesign.class.getSimpleName());
+ String EXPERIMENT_DESIGN_DATE = ExperimentDesign.PROPERTY_DATE;
+ String EXPERIMENT_DESIGN_ID = ExperimentDesign.PROPERTY_ID;
+ String EXPERIMENT_DESIGN_AUTHOR = ExperimentDesign.PROPERTY_AUTHOR;
+ String EXPERIMENT_DESIGN_LICENCE = ExperimentDesign.PROPERTY_LICENCE;
+ String EXPERIMENT_DESIGN_DESCRIPTION = ExperimentDesign.PROPERTY_DESCRIPTION;
+ String FACTORS = "factors";
+ String FACTOR = Introspector.decapitalize(Factor.class.getSimpleName());
+ String FACTOR_ID = Factor.PROPERTY_ID;
+ String FACTOR_NAME = Factor.PROPERTY_NAME;
+ String FACTOR_UNIT = Factor.PROPERTY_UNIT;
+ String FACTOR_DESCRIPTION = Factor.PROPERTY_DESCRIPTION;
+ String DOMAIN = Factor.PROPERTY_DOMAIN;
+ String DOMAIN_NAME = Domain.PROPERTY_NAME;
+ String DOMAIN_DISTRIBUTION_NAME = Domain.PROPERTY_DISTRIBUTION_NAME;
+ String DOMAIN_DISTRIBUTION_PARAMETER = Introspector.decapitalize(DistributionParameter.class.getSimpleName());
+ String DISTRIBUTION_PARAMETER_NAME = DistributionParameter.PROPERTY_NAME;
+ String DISTRIBUTION_PARAMETER_VALUE = DistributionParameter.PROPERTY_VALUE;
+ String DISTRIBUTION_PARAMETER_VALUE_TYPE = DistributionParameter.PROPERTY_VALUE_TYPE;
+ String DOMAIN_LEVEL = Introspector.decapitalize(Level.class.getSimpleName());
+ String LEVEL_VALUE = Level.PROPERTY_VALUE;
+ String LEVEL_WEIGHT = Level.PROPERTY_WEIGHT;
+ String DOMAIN_VALUE_TYPE = Domain.PROPERTY_VALUE_TYPE;
+ String DOMAIN_NOMINAL_VALUE = Domain.PROPERTY_NOMINAL_VALUE;
+ String FEATURE = Introspector.decapitalize(Feature.class.getSimpleName());
+ String FEATURE_NAME = Feature.PROPERTY_NAME;
+ String FEATURE_VALUE = Feature.PROPERTY_VALUE;
+ String FEATURE_VALUE_TYPE = Feature.PROPERTY_VALUE_TYPE;
+ String INPUT_DESIGN = Introspector.decapitalize(InputDesign.class.getSimpleName());
+ String INPUT_DESIGN_DATE = InputDesign.PROPERTY_DATE;
+ String SCENARIO = Introspector.decapitalize(Scenario.class.getSimpleName());
+ String SCENARIO_NAME = Scenario.PROPERTY_NAME;
+ String SCENARIO_ORDER_NUMBER = Scenario.PROPERTY_ORDER_NUMBER;
+ String SCENARIO_FACTOR_VALUES = Scenario.PROPERTY_FACTOR_VALUES;
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/ScenarioImpl.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/ScenarioImpl.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/ScenarioImpl.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -27,8 +27,9 @@
import com.google.common.collect.Maps;
import fr.reseaumexico.model.event.ScenarioFactorValueEvent;
import fr.reseaumexico.model.event.ScenarioFactorValueListener;
+
+import javax.swing.event.EventListenerList;
import java.util.Map;
-import javax.swing.event.EventListenerList;
/**
* Implementation of {@link Scenario} to provide listener API
@@ -43,7 +44,7 @@
protected final EventListenerList factorListenerList;
public ScenarioImpl() {
- this.factorListenerList = new EventListenerList();
+ factorListenerList = new EventListenerList();
}
@Override
@@ -82,7 +83,7 @@
ScenarioFactorValueEvent event = new ScenarioFactorValueEvent(this, factorId, oldValue, newValue);
ScenarioFactorValueListener[] listeners = factorListenerList.getListeners(ScenarioFactorValueListener.class);
for (ScenarioFactorValueListener listener : listeners) {
- listener.onFactorValueChange(event);
+ listener.factorValueChanged(event);
}
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignFactorEvent.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignFactorEvent.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignFactorEvent.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -24,11 +24,12 @@
*/
package fr.reseaumexico.model.event;
+import fr.reseaumexico.model.Factor;
import fr.reseaumexico.model.InputDesign;
import fr.reseaumexico.model.Scenario;
/**
- * Event fired when {@link fr.reseaumexico.model.Factor} change on {@link InputDesign}
+ * Event fired when {@link Factor} change on {@link InputDesign}
*
* @author sletellier <letellier(a)codelutin.com>
* @since 0.1
@@ -38,7 +39,9 @@
private static final long serialVersionUID = 1L;
protected String factorId;
+
protected Object factorOldValue;
+
protected Object factorNewValue;
public InputDesignFactorEvent(InputDesign inputDesign,
@@ -48,8 +51,8 @@
Object newValue) {
super(inputDesign, scenario);
this.factorId = factorId;
- this.factorOldValue = oldValue;
- this.factorNewValue = newValue;
+ factorOldValue = oldValue;
+ factorNewValue = newValue;
}
public String getFactorId() {
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignScenarioEvent.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignScenarioEvent.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/InputDesignScenarioEvent.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -26,6 +26,7 @@
import fr.reseaumexico.model.InputDesign;
import fr.reseaumexico.model.Scenario;
+
import java.util.EventObject;
/**
@@ -40,7 +41,8 @@
protected Scenario scenario;
- public InputDesignScenarioEvent(InputDesign inputDesign, Scenario scenario) {
+ public InputDesignScenarioEvent(InputDesign inputDesign,
+ Scenario scenario) {
super(inputDesign);
this.scenario = scenario;
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/ScenarioFactorValueEvent.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/ScenarioFactorValueEvent.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/event/ScenarioFactorValueEvent.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -24,11 +24,13 @@
*/
package fr.reseaumexico.model.event;
+import fr.reseaumexico.model.Factor;
import fr.reseaumexico.model.Scenario;
+
import java.util.EventObject;
/**
- * Event fired when {@link fr.reseaumexico.model.Factor} change on {@link Scenario}
+ * Event fired when {@link Factor} change on {@link Scenario}
*
* @author sletellier <letellier(a)codelutin.com>
* @since 0.1
@@ -38,10 +40,15 @@
private static final long serialVersionUID = 1L;
protected String factorId;
+
protected Object factorOldValue;
+
protected Object factorNewValue;
- public ScenarioFactorValueEvent(Scenario scenario, String factorId, Object factorOldValue, Object factorNewValue) {
+ public ScenarioFactorValueEvent(Scenario scenario,
+ String factorId,
+ Object factorOldValue,
+ Object factorNewValue) {
super(scenario);
this.factorId = factorId;
this.factorOldValue = factorOldValue;
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/ExperimentDesignParser.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/ExperimentDesignParser.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/ExperimentDesignParser.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -39,56 +39,31 @@
import fr.reseaumexico.model.Level;
import fr.reseaumexico.model.LevelImpl;
import fr.reseaumexico.model.MexicoTechnicalException;
+import fr.reseaumexico.model.MexicoXmlConstant;
import fr.reseaumexico.model.ValueType;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import static fr.reseaumexico.model.MexicoXmlConstant.DISTRIBUTION_PARAMETER_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.DISTRIBUTION_PARAMETER_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.DISTRIBUTION_PARAMETER_VALUE_TYPE;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_DISTRIBUTION_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_DISTRIBUTION_PARAMETER;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_LEVEL;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_NOMINAL_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_VALUE_TYPE;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_AUTHOR;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_DATE;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_DESCRIPTION;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_ID;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_LICENCE;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTORS;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR_DESCRIPTION;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR_ID;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE_VALUE_TYPE;
-import static fr.reseaumexico.model.MexicoXmlConstant.LEVEL_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.LEVEL_WEIGHT;
-
/**
- * Parser for experiment design xml files, build a {@link ExperimentDesign} model
+ * Parser for experiment design xml files, build a {@link ExperimentDesign} model.
*
* @author sletellier <letellier(a)codelutin.com>
* @since 0.1
*/
-public class ExperimentDesignParser extends MexicoXmlParser<ExperimentDesign> {
+public class ExperimentDesignParser extends MexicoXmlParser<ExperimentDesign> implements MexicoXmlConstant {
protected Map<String, Factor> factors;
public ExperimentDesignParser(File file) throws FileNotFoundException {
super(file);
- this.factors = Maps.newHashMap();
+ factors = Maps.newHashMap();
}
@Override
@@ -135,6 +110,7 @@
parser.nextTag();
}
}
+
protected void parseFactors(XmlPullParser parser, ExperimentDesign model) throws IOException, XmlPullParserException {
// factors
@@ -210,6 +186,7 @@
return factor;
}
+
protected Domain parseDomain(XmlPullParser parser) throws XmlPullParserException, IOException {
Domain domain = new DomainImpl();
@@ -238,7 +215,7 @@
// distributionParameters
int eventType = parser.nextTag();
if (eventType == XmlPullParser.START_TAG &&
- parserEqual(parser, DOMAIN_DISTRIBUTION_PARAMETER)) {
+ parserEqual(parser, DOMAIN_DISTRIBUTION_PARAMETER)) {
List<DistributionParameter> distributionParameters = Lists.newArrayList();
while (parserEqual(parser, DOMAIN_DISTRIBUTION_PARAMETER)) {
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/InputDesignParser.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/InputDesignParser.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/InputDesignParser.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -34,14 +34,15 @@
import fr.reseaumexico.model.Scenario;
import fr.reseaumexico.model.ScenarioImpl;
import fr.reseaumexico.model.ValueType;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR;
import static fr.reseaumexico.model.MexicoXmlConstant.INPUT_DESIGN;
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/MexicoXmlParser.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/MexicoXmlParser.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/MexicoXmlParser.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -27,6 +27,7 @@
import fr.reseaumexico.model.DateFormatFactory;
import fr.reseaumexico.model.MexicoUtil;
import fr.reseaumexico.model.ValueType;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.text.ParseException;
@@ -47,7 +48,7 @@
public Date parseDate(String toParse) throws ParseException {
return DateFormatFactory.getMexicoDateFormat().parse(toParse);
}
-
+
public Object getTypedValue(ValueType type, String value) {
return MexicoUtil.getTypedValue(type, value);
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/XmlParser.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/XmlParser.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/XmlParser.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -24,28 +24,29 @@
*/
package fr.reseaumexico.model.parser;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.ParseException;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
/**
* Abstract parser to get model from xml file using XPP3
- *
+ *
* @author sletellier <letellier(a)codelutin.com>
+ * @see XmlPullParser
* @since 0.1
- * @see XmlPullParser
*/
public abstract class XmlParser<M> extends FileReader {
public XmlParser(File file) throws FileNotFoundException {
super(file);
}
-
+
public M getModel() throws XmlPullParserException, IOException, ParseException {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/ExperimentDesignXmlWriter.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/ExperimentDesignXmlWriter.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/ExperimentDesignXmlWriter.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -29,37 +29,13 @@
import fr.reseaumexico.model.ExperimentDesign;
import fr.reseaumexico.model.Factor;
import fr.reseaumexico.model.Level;
+import org.apache.commons.lang3.StringUtils;
+
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Date;
-import org.apache.commons.lang3.StringUtils;
-import static fr.reseaumexico.model.MexicoXmlConstant.DISTRIBUTION_PARAMETER_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.DISTRIBUTION_PARAMETER_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.DISTRIBUTION_PARAMETER_VALUE_TYPE;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_DISTRIBUTION_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_DISTRIBUTION_PARAMETER;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_LEVEL;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_NOMINAL_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.DOMAIN_VALUE_TYPE;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_AUTHOR;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_DATE;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_DESCRIPTION;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_ID;
-import static fr.reseaumexico.model.MexicoXmlConstant.EXPERIMENT_DESIGN_LICENCE;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTORS;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR_DESCRIPTION;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR_ID;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR_UNIT;
-import static fr.reseaumexico.model.MexicoXmlConstant.LEVEL_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.LEVEL_WEIGHT;
-
/**
* Writer to create experiment design file with {@link ExperimentDesign} model
*
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/InputDesignXmlWriter.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/InputDesignXmlWriter.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/InputDesignXmlWriter.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -27,19 +27,12 @@
import fr.reseaumexico.model.Factor;
import fr.reseaumexico.model.InputDesign;
import fr.reseaumexico.model.Scenario;
+
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Map;
-import static fr.reseaumexico.model.MexicoXmlConstant.FACTOR;
-import static fr.reseaumexico.model.MexicoXmlConstant.INPUT_DESIGN;
-import static fr.reseaumexico.model.MexicoXmlConstant.INPUT_DESIGN_DATE;
-import static fr.reseaumexico.model.MexicoXmlConstant.SCENARIO;
-import static fr.reseaumexico.model.MexicoXmlConstant.SCENARIO_FACTOR_VALUES;
-import static fr.reseaumexico.model.MexicoXmlConstant.SCENARIO_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.SCENARIO_ORDER_NUMBER;
-
/**
* Writer to create input design file with {@link InputDesign} model
*
@@ -83,8 +76,8 @@
addParameter(scenariosXmlNode, SCENARIO_ORDER_NUMBER, scenario.getOrderNumber());
// factor values
- Map<Factor,Object> factorValues = scenario.getFactorValues();
- for (Map.Entry<Factor,Object> entry : factorValues.entrySet()) {
+ Map<Factor, Object> factorValues = scenario.getFactorValues();
+ for (Map.Entry<Factor, Object> entry : factorValues.entrySet()) {
Object value = entry.getValue();
XmlNode factorValueXmlNode = XmlNode.createElement(scenariosXmlNode, SCENARIO_FACTOR_VALUES, String.valueOf(value));
factorValueXmlNode.addAttribute(FACTOR, entry.getKey().getId());
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/MexicoXmlWriter.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/MexicoXmlWriter.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/MexicoXmlWriter.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -26,23 +26,20 @@
import fr.reseaumexico.model.DateFormatFactory;
import fr.reseaumexico.model.Feature;
+import fr.reseaumexico.model.MexicoXmlConstant;
+
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Date;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE_NAME;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE_VALUE;
-import static fr.reseaumexico.model.MexicoXmlConstant.FEATURE_VALUE_TYPE;
-
/**
* Abstract writer create mexico files with specific model
*
* @author sletellier <letellier(a)codelutin.com>
* @since 0.1
*/
-public abstract class MexicoXmlWriter<M> extends XmlWriter<M> {
+public abstract class MexicoXmlWriter<M> extends XmlWriter<M> implements MexicoXmlConstant {
protected MexicoXmlWriter(File file, M model) throws IOException {
super(file, model);
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlNode.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlNode.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlNode.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -26,15 +26,16 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
-import org.apache.commons.lang3.StringEscapeUtils;
-import org.apache.commons.lang3.StringUtils;
/**
* Represent an XML node
- *
+ *
* @author sletellier <letellier(a)codelutin.com>
* @since 0.1
*/
@@ -57,16 +58,16 @@
public XmlNode(String tagName, String text) {
this.tagName = tagName;
this.text = text;
- this.children = Lists.newLinkedList();
- this.attributes = Maps.newHashMap();
+ children = Lists.newLinkedList();
+ attributes = Maps.newHashMap();
}
-
+
public void add(XmlNode e) {
- this.children.add(e);
+ children.add(e);
}
-
+
public void addAttribute(String name, String value) {
- this.attributes.put(name, value);
+ attributes.put(name, value);
}
public String toXml(int indent) {
@@ -98,30 +99,30 @@
addToBuilder(stringBuilder, END_TAG, getIndentPrefix(start, indent), tagName);
}
}
-
+
protected void addToBuilder(StringBuilder stringBuilder, String template, String prefix, String tagName) {
stringBuilder.append(String.format(template, prefix, tagName, getAttributesAsString()));
}
-
+
protected String getIndentPrefix(int start, int lenght) {
String result = "";
- for (int i=0;i<start + lenght;i++) {
+ for (int i = 0; i < start + lenght; i++) {
result += " ";
}
return result;
}
-
+
protected String getAttributesAsString() {
StringBuilder builder = new StringBuilder();
- Set<Map.Entry<String,String>> entries = attributes.entrySet();
- for (Map.Entry<String,String> entry : entries) {
+ Set<Map.Entry<String, String>> entries = attributes.entrySet();
+ for (Map.Entry<String, String> entry : entries) {
// add to builder param like : name="value"
builder.append(" ")
- .append(entry.getKey())
- .append("=\"")
- .append(StringEscapeUtils.escapeXml(entry.getValue()))
- .append("\"");
+ .append(entry.getKey())
+ .append("=\"")
+ .append(StringEscapeUtils.escapeXml(entry.getValue()))
+ .append("\"");
}
return builder.toString();
}
Modified: trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlWriter.java
===================================================================
--- trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlWriter.java 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/writer/XmlWriter.java 2012-01-18 16:58:27 UTC (rev 32)
@@ -48,7 +48,7 @@
public void write() throws IOException {
String toWrite = getRootElement().toXml(INDENT);
- super.write(toWrite);
+ write(toWrite);
}
public abstract XmlNode getRootElement();
Modified: trunk/jmexico-model/src/main/xmi/mexico.properties
===================================================================
--- trunk/jmexico-model/src/main/xmi/mexico.properties 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/main/xmi/mexico.properties 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,3 +1,27 @@
+###
+# #%L
+# JMexico :: Model
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+# %%
+# 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%
+###
model.tagValue.constantPrefix=PROPERTY_
model.tagValue.version=0.1
Modified: trunk/jmexico-model/src/main/xmi/mexico.zargo
===================================================================
(Binary files differ)
Modified: trunk/jmexico-model/src/site/site_fr.xml
===================================================================
--- trunk/jmexico-model/src/site/site_fr.xml 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/jmexico-model/src/site/site_fr.xml 2012-01-18 16:58:27 UTC (rev 32)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- JMexico :: Swing Editor
+ JMexico :: Model
$Id$
$HeadURL$
Modified: trunk/src/site/resources/examples/experimentDesign.xml
===================================================================
--- trunk/src/site/resources/examples/experimentDesign.xml 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/src/site/resources/examples/experimentDesign.xml 2012-01-18 16:58:27 UTC (rev 32)
@@ -647,4 +647,4 @@
<feature name="ScaleValue_name" value="tres eleve" valueType="STRING"/>
</factor>
</factors>
-</experimentDesign>
\ No newline at end of file
+</experimentDesign>
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2012-01-18 16:16:00 UTC (rev 31)
+++ trunk/src/site/rst/index.rst 2012-01-18 16:58:27 UTC (rev 32)
@@ -66,4 +66,4 @@
Ensuite ouvrir l'input design d'exemple...
.. _experimentDesign: ./examples/experimentDesign.xml
-.. _inputDesign: ./examples/inputDesign.xml
\ No newline at end of file
+.. _inputDesign: ./examples/inputDesign.xml
1
0
r31 - in trunk: jmexico-editor/src/main/java/fr/reseaumexico/editor jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor jmexico-editor-demo jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo
by tchemit@users.forge.codelutin.com 18 Jan '12
by tchemit@users.forge.codelutin.com 18 Jan '12
18 Jan '12
Author: tchemit
Date: 2012-01-18 17:16:00 +0100 (Wed, 18 Jan 2012)
New Revision: 31
Url: http://forge.codelutin.com/repositories/revision/jmexico/31
Log:
change packages
Added:
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditorFactory.java
Removed:
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator/MexicoDecoratorProvider.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditorHandler.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignTableModel.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/
Modified:
trunk/jmexico-editor-demo/pom.xml
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,85 @@
+<!--
+ #%L
+ JMexico :: Swing Editor
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 Réseau Mexico, Codelutin
+ %%
+ 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%
+ -->
+<JPanel id='inputDesignEditor' layout='{new BorderLayout()}'>
+
+ <import>
+ fr.reseaumexico.model.InputDesign
+ fr.reseaumexico.model.Factor
+ fr.reseaumexico.editor.InputDesignTableModel
+ fr.reseaumexico.editor.factorValue.FactorValueCellEditor
+ fr.reseaumexico.editor.factorValue.FactorValueCellRenderer
+ fr.reseaumexico.editor.MexicoDecoratorProvider
+ jaxx.runtime.swing.renderer.DecoratorProviderTableCellRenderer
+ </import>
+
+ <InputDesignEditorHandler id='handler'/>
+
+ <InputDesignTableModel id='model' javaBean="new InputDesignTableModel()"/>
+
+ <FactorValueCellEditor id='cellEditor' constructorParams='this'/>
+
+ <FactorValueCellRenderer id='cellRenderer' constructorParams='this'/>
+
+ <script>
+ <![CDATA[
+
+private void $afterCompleteSetup() {
+
+ // table renderer
+ // TODO sletellier 20111221 : do on time for all, put in context ?
+ MexicoDecoratorProvider mexicoDecoratorProvider = new MexicoDecoratorProvider();
+ inputDesignTable.setDefaultRenderer(Factor.class, new DecoratorProviderTableCellRenderer(mexicoDecoratorProvider));
+ inputDesignTable.setDefaultRenderer(Object.class, getCellRenderer());
+
+ // cell editor
+ inputDesignTable.setDefaultEditor(Object.class, getCellEditor());
+}
+
+public void setInputDesign(InputDesign inputDesign) {
+ getModel().setInputDesign(inputDesign);
+}
+
+public InputDesign getInputDesign() {
+ return getModel().getInputDesign();
+}
+ ]]>
+ </script>
+
+ <JScrollPane constraints='BorderLayout.CENTER'>
+ <JTable id='inputDesignTable' model='{getModel()}'/>
+ </JScrollPane>
+
+ <JPanel id='factorActionPanel' constraints='BorderLayout.SOUTH'>
+ <JButton id='addScenarioButton'
+ text='jmexico.add.scenario'
+ constraints='BorderLayout.WEST'
+ onActionPerformed='getHandler().addScenario(this)'/>
+ <JButton id='removeScenarioButton'
+ text='jmexico.remove.scenario'
+ constraints='BorderLayout.EAST'
+ onActionPerformed='getHandler().removeScenario(this)'/>
+ </JPanel>
+
+</JPanel>
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditor.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditorHandler.java)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,117 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor;
+
+import com.google.common.collect.Maps;
+import fr.reseaumexico.model.Factor;
+import fr.reseaumexico.model.InputDesign;
+import fr.reseaumexico.model.Scenario;
+import fr.reseaumexico.model.ScenarioImpl;
+import java.util.Collection;
+import java.util.Map;
+import javax.swing.JOptionPane;
+import org.apache.commons.lang3.StringUtils;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 0.1
+ */
+public class InputDesignEditorHandler {
+
+ public void addScenario(InputDesignEditor editor) {
+ InputDesign inputDesign = editor.getInputDesign();
+
+ String selectedName = JOptionPane.showInputDialog(editor,
+ _("jmexico.scenario.inputName"),
+ _("jmexico.scenario.inputName.title"),
+ JOptionPane.QUESTION_MESSAGE);
+
+ // if user enter name
+ if (StringUtils.isNotBlank(selectedName)) {
+
+ // check that name is never used
+ Collection<Scenario> scenarios = inputDesign.getScenario();
+
+ int maxOrder = 0;
+ for (Scenario scenario : scenarios) {
+ if (selectedName.equalsIgnoreCase(scenario.getName())) {
+
+ JOptionPane.showMessageDialog(editor,
+ _("jmexico.error.title"),
+ _("jmexico.error.scenario.name.used"),
+ JOptionPane.ERROR_MESSAGE);
+
+ return;
+ }
+ int orderNumber = scenario.getOrderNumber();
+ if (maxOrder < orderNumber) {
+ maxOrder = orderNumber;
+ }
+ }
+
+ // create new scenario
+ Scenario scenarioToAdd = new ScenarioImpl();
+
+ // set last order
+ // TODO sletellier 20111219 : ask user order number
+ scenarioToAdd.setOrderNumber(maxOrder + 1);
+
+ // set name
+ scenarioToAdd.setName(selectedName);
+
+ // create all empty factor values
+ Collection<Factor> factors = inputDesign.getExperimentDesign().getFactor();
+ Map<Factor, Object> factorValues = Maps.newHashMap();
+ for (Factor factor : factors) {
+ factorValues.put(factor, null);
+ }
+ scenarioToAdd.setFactorValues(factorValues);
+
+ inputDesign.addScenario(scenarioToAdd);
+ }
+ }
+
+ public void removeScenario(InputDesignEditor editor) {
+ InputDesign inputDesign = editor.getInputDesign();
+
+ // show scenario select dialog
+ Collection<Scenario> scenarios = inputDesign.getScenario();
+ Scenario scenario = (Scenario)JOptionPane.showInputDialog(
+ editor,
+ _("jmexico.scenario.selectRemove"),
+ _("jmexico.scenario.selectRemove.title"),
+ JOptionPane.PLAIN_MESSAGE,
+ null,
+ scenarios.toArray(),
+ null);
+
+ // if scenario is selected
+ if (scenario != null) {
+ inputDesign.removeScenario(scenario);
+ }
+ }
+}
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignTableModel.java)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,212 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor;
+
+import fr.reseaumexico.model.Factor;
+import fr.reseaumexico.model.InputDesign;
+import fr.reseaumexico.model.MexicoUtil;
+import fr.reseaumexico.model.Scenario;
+import fr.reseaumexico.model.ValueType;
+import fr.reseaumexico.model.event.InputDesignScenarioEvent;
+import fr.reseaumexico.model.event.InputDesignScenarioListener;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import org.apache.commons.lang3.ObjectUtils;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 0.1
+ */
+public class InputDesignTableModel extends AbstractTableModel implements InputDesignScenarioListener {
+
+ private static final long serialVersionUID = 1L;
+
+ protected TableModel delegate;
+
+ protected InputDesign inputDesign;
+
+ protected List<Factor> factors;
+
+ public InputDesignTableModel() {
+ delegate = new DefaultTableModel();
+ }
+
+ public void setInputDesign(InputDesign inputDesign) {
+ this.inputDesign = inputDesign;
+ inputDesign.addInputDesignScenarioListener(this);
+
+ // extract factors
+ factors = new LinkedList<Factor>(inputDesign.getExperimentDesign().getFactor());
+
+ // sort on id
+ Collections.sort(factors, new Comparator<Factor>() {
+
+ @Override
+ public int compare(Factor o1, Factor o2) {
+ return o1.getId().compareTo(o2.getId());
+ }
+ });
+
+ fireTableStructureChanged();
+ }
+
+ @Override
+ public void onScenarioAdded(InputDesignScenarioEvent event) {
+ fireTableStructureChanged();
+ }
+
+ @Override
+ public void onScenarioRemoved(InputDesignScenarioEvent event) {
+ fireTableStructureChanged();
+ }
+
+ public InputDesign getInputDesign() {
+ return inputDesign;
+ }
+
+ public Collection<Scenario> getScenarios() {
+ return inputDesign.getScenario();
+ }
+
+ public Scenario getScenario(int i) {
+ return inputDesign.getScenario(i);
+ }
+
+ public Factor getFactor(int i) {
+ return factors.get(i);
+ }
+
+ @Override
+ public int getRowCount() {
+ if (inputDesign == null) {
+ return delegate.getRowCount();
+ }
+ return factors == null ? 0 : factors.size();
+ }
+
+ @Override
+ public int getColumnCount() {
+ if (inputDesign == null) {
+ return delegate.getColumnCount();
+ }
+ Collection<Scenario> scenarios = getScenarios();
+ if (scenarios == null) {
+ return 1;
+ }
+ return scenarios.size() + 1;
+ }
+
+ @Override
+ public String getColumnName(int rowIndex) {
+ if (inputDesign == null) {
+ return delegate.getColumnName(rowIndex);
+ }
+ if (rowIndex == 0) {
+ return _("jmexico.factor.name");
+ }
+ Scenario scenario = getScenario(rowIndex - 1);
+ return scenario == null ? "" : scenario.getName();
+ }
+
+ @Override
+ public Class<?> getColumnClass(int rowIndex) {
+ if (inputDesign == null) {
+ return delegate.getColumnClass(rowIndex);
+ }
+ if (rowIndex == 0) {
+ return Factor.class;
+ }
+ return Object.class;
+ }
+
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ if (inputDesign == null) {
+ return delegate.isCellEditable(rowIndex, columnIndex);
+ }
+ return columnIndex > 0;
+ }
+
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ if (inputDesign == null) {
+ return delegate.getValueAt(rowIndex, columnIndex);
+ }
+
+ // get key on rowIndex
+ Factor factor = getFactor(rowIndex);
+
+ // first column is factors
+ if (columnIndex == 0) {
+ return factor;
+ }
+
+ // others are scenarios
+ columnIndex = columnIndex - 1;
+ Scenario scenario = getScenario(columnIndex);
+ if (scenario == null) {
+ return null;
+ }
+ Map<Factor,Object> factorValues = scenario.getFactorValues();
+
+ Object result = factorValues.get(factor);
+ return result;
+ }
+
+ @Override
+ public void setValueAt(Object o, int rowIndex, int columnIndex) {
+ if (inputDesign == null) {
+ delegate.setValueAt(o, rowIndex, columnIndex);
+ return;
+ }
+ if (columnIndex == 0) {
+
+ // must never append
+ return;
+ }
+ int scenarioIndex = columnIndex - 1;
+ Scenario scenario = getScenario(scenarioIndex);
+
+ // get key if rowIndex
+ Factor factor = getFactor(rowIndex);
+
+ // take care of type
+ ValueType valueType = factor.getDomain().getValueType();
+
+ String value = ObjectUtils.toString(o);
+ scenario.setFactorValue(factor, MexicoUtil.getTypedValue(valueType, value));
+
+ fireTableCellUpdated(rowIndex, columnIndex);
+ }
+}
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator/MexicoDecoratorProvider.java)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor;
+
+import fr.reseaumexico.model.Factor;
+import jaxx.runtime.decorator.DecoratorProvider;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ */
+public class MexicoDecoratorProvider extends DecoratorProvider {
+
+ @Override
+ protected void loadDecorators() {
+ registerJXPathDecorator(Factor.class, "${" + Factor.PROPERTY_ID + "}$s");
+ }
+}
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/MexicoDecoratorProvider.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,147 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor.factorValue;
+
+import fr.reseaumexico.model.Factor;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import javax.swing.AbstractCellEditor;
+import javax.swing.JComboBox;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.table.TableCellEditor;
+import jaxx.runtime.JAXXContext;
+
+/**
+ * Cell editor for factor values
+ *
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 0.1
+ * @see TableCellEditor
+ */
+public class FactorValueCellEditor extends AbstractCellEditor
+ implements TableCellEditor, FocusListener {
+
+ private static final long serialVersionUID = 1L;
+
+ protected JTable table;
+ protected Factor factor;
+ protected Object currentValue;
+ protected JTextField defaultInlineEditor;
+ protected FactorValueEditorFactory.FactorValueCellEditor specificEditor;
+ protected boolean isEditing;
+ protected FactorValueEditorFactory factory;
+
+ public FactorValueCellEditor(JAXXContext context) {
+ defaultInlineEditor = new JTextField();
+ defaultInlineEditor.addFocusListener(this);
+
+ // search specific factory in context
+ factory = context.getContextValue(FactorValueEditorFactory.class);
+
+ // if not found, use mexico one
+ if (factory == null) {
+ factory = new FactorValueEditorFactory();
+ }
+ }
+
+ @Override
+ public Object getCellEditorValue() {
+ if (isEditing) {
+ currentValue = defaultInlineEditor.getText();
+ isEditing = false;
+ }
+ if (specificEditor != null) {
+ currentValue = specificEditor.getValue();
+ }
+ return currentValue;
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
+ // get factor
+ factor = (Factor) table.getValueAt(row, 0);
+
+ currentValue = value;
+
+ specificEditor = factory.getCellEditor(factor, currentValue);
+
+ if (specificEditor != null) {
+ Component component = specificEditor.getComponent();
+
+ // stop editing on select for combos
+ if (component instanceof JComboBox) {
+ ((JComboBox)component).addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ fireEditingStopped();
+ }
+ });
+ }
+
+ component.addFocusListener(new FocusListener() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ fireEditingStopped();
+ }
+ });
+
+ return component;
+ }
+ defaultInlineEditor.setText(currentValue == null ? "" : String.valueOf(currentValue));
+ return defaultInlineEditor;
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+
+ // get factor
+ FactorValueEditor editor = factory.getDialogEditor(factor, currentValue);
+ if (editor == null) {
+ isEditing = true;
+ } else {
+ // display ui
+ editor.setVisible(true);
+ currentValue = editor.getValue();
+ defaultInlineEditor.setText(currentValue == null ? "" : String.valueOf(currentValue));
+ fireEditingStopped();
+ }
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ fireEditingStopped();
+ }
+}
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellEditor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,71 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor.factorValue;
+
+import fr.reseaumexico.model.Factor;
+import java.awt.Component;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import jaxx.runtime.JAXXContext;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ */
+public class FactorValueCellRenderer implements TableCellRenderer {
+
+ protected FactorValueEditorFactory factory;
+ protected TableCellRenderer delegate;
+
+ public FactorValueCellRenderer(JAXXContext context) {
+
+ // search specific factory in context
+ factory = context.getContextValue(FactorValueEditorFactory.class);
+
+ // if not found, use mexico one
+ if (factory == null) {
+ factory = new FactorValueEditorFactory();
+ }
+
+ delegate = new DefaultTableCellRenderer();
+
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) {
+ Factor factor = (Factor) table.getValueAt(row, 0);
+
+ FactorValueEditorFactory.FactorValueCellRenderer specificRenderer = factory.getRenderedComponent(factor, value);
+
+ Component result;
+ if (specificRenderer == null) {
+ result = delegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ } else {
+ result = specificRenderer.getComponent();
+ }
+
+ return result;
+ }
+}
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditor.jaxx)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,45 @@
+<!--
+ #%L
+ JMexico :: Swing Editor
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+ %%
+ 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%
+ -->
+<JDialog abstract='true'
+ genericType='B'
+ modal='true'
+ layout='{new BorderLayout()}'>
+
+ <import>
+java.awt.BorderLayout
+fr.reseaumexico.model.Factor
+ </import>
+
+ <Factor id='factor' initializer='getContextValue(Factor.class)'/>
+
+ <script><![CDATA[
+
+public abstract B getValue();
+
+public abstract void setValue(B data);
+ ]]>
+ </script>
+
+</JDialog>
\ No newline at end of file
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditor.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditorFactory.java (from rev 30, trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java)
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditorFactory.java (rev 0)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditorFactory.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -0,0 +1,266 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor.factorValue;
+
+import com.google.common.collect.Maps;
+import fr.reseaumexico.model.Domain;
+import fr.reseaumexico.model.Factor;
+import fr.reseaumexico.model.ValueType;
+import jaxx.runtime.swing.editor.NumberEditor;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.Map;
+
+/**
+ * Factory used to open specific editor to input factor value
+ *
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 0.1
+ */
+public class FactorValueEditorFactory {
+
+ protected Map<Factor, FactorValueCellEditor<?>> factorValueEditorCache = Maps.newHashMap();
+
+ /**
+ * Provide specific {@link JDialog} editor for factor value
+ *
+ * @param factor concerned
+ * @param value value to edit
+ * @return {@link FactorValueEditor} contain editor to open as {@link JDialog},
+ * null if cell editor must be used
+ */
+ public FactorValueEditor getDialogEditor(Factor factor, Object value) {
+
+ // TODO sletellier 20121221 : open specific editor
+
+// if (oldValue == null) {
+//
+// JAXXInitialContext context = new JAXXInitialContext();
+// context.add(factor);
+// FactorValueEditor<B> editor = (FactorValueEditor<B>) new FactorValueEditorImpl(context);
+// editor.setValue(oldValue);
+// return editor;
+// }
+
+ return null;
+ }
+
+ protected FactorValueCellEditor<?> getFactorValueCellEditor(Factor factor) {
+ return factorValueEditorCache.get(factor);
+ }
+
+ protected void setFactorValueCellEditor(Factor factor, FactorValueCellEditor<?> editor) {
+ factorValueEditorCache.put(factor, editor);
+ }
+
+ /**
+ * Provide specific cell editor for factor value
+ *
+ * @param factor concerned
+ * @param value value to edit
+ * @return {@link FactorValueCellEditor} contain editor to display
+ */
+ public FactorValueCellEditor getCellEditor(Factor factor, Object value) {
+
+ FactorValueCellEditor<?> factorValueCellEditor = getFactorValueCellEditor(factor);
+
+ // get type
+ Domain domain = factor.getDomain();
+ ValueType valueType = ValueType.STRING;
+ if (domain != null) {
+ valueType = domain.getValueType();
+ }
+
+ if (factorValueCellEditor == null) {
+ switch (valueType) {
+ case INTEGER:
+ factorValueCellEditor = new IntegerFactorValueInlineEditor();
+ break;
+ case DECIMAL:
+ factorValueCellEditor = new DecimalFactorValueInlineEditor();
+ break;
+ case BOOLEAN:
+ factorValueCellEditor = new BooleanFactorValueInlineEditor();
+ break;
+ default:
+ factorValueCellEditor = new DefaultFactorValueInlineEditor();
+ }
+ }
+
+ setFactorValueCellEditor(factor, factorValueCellEditor);
+
+ factorValueCellEditor.setValue(value);
+ return factorValueCellEditor;
+ }
+
+ /**
+ * Provide a specific cell renderer for factor value
+ *
+ * @param factor concerned
+ * @param value value to edit
+ * @return {@link FactorValueCellRenderer} contain renderer to display
+ */
+ public FactorValueCellRenderer getRenderedComponent(Factor factor, Object value) {
+ return getCellEditor(factor, value);
+ }
+
+ protected interface FactorValueCellRenderer {
+
+ Component getComponent();
+
+ void setValue(Object value);
+ }
+
+ protected interface FactorValueCellEditor<B> extends FactorValueCellRenderer {
+
+ B getValue();
+
+ void setValue(Object value);
+
+ Component getComponent();
+ }
+
+ protected static class DefaultFactorValueInlineEditor implements FactorValueCellEditor<String> {
+
+ protected JTextField component;
+
+ public DefaultFactorValueInlineEditor() {
+ component = new JTextField();
+ component.setBorder(null);
+ }
+
+ @Override
+ public void setValue(Object value) {
+ component.setText(getStringValue(value));
+ }
+
+ @Override
+ public String getValue() {
+ return component.getText();
+ }
+
+ @Override
+ public Component getComponent() {
+ return component;
+ }
+ }
+
+ protected static class BooleanFactorValueInlineEditor implements FactorValueCellEditor<Boolean> {
+
+ protected JCheckBox checkBox;
+
+ public BooleanFactorValueInlineEditor() {
+ checkBox = new JCheckBox();
+ }
+
+ @Override
+ public Boolean getValue() {
+ return checkBox.isSelected();
+ }
+
+ @Override
+ public void setValue(Object value) {
+ if (value != null) {
+ checkBox.setSelected((Boolean) value);
+ }
+ }
+
+ @Override
+ public Component getComponent() {
+ return checkBox;
+ }
+ }
+
+ protected static class IntegerFactorValueInlineEditor implements FactorValueCellEditor<Integer> {
+
+ protected NumberEditor numberEditor;
+
+ public IntegerFactorValueInlineEditor() {
+ numberEditor = new NumberEditor();
+ numberEditor.getTextField().setBorder(null);
+
+ numberEditor.setUseFloat(false);
+ numberEditor.setUseSign(true);
+ }
+
+ @Override
+ public Integer getValue() {
+ return (Integer) numberEditor.getModel();
+ }
+
+ @Override
+ public void setValue(Object value) {
+ // FIXME sletellier 20120105 : we dont need to set modelText
+ numberEditor.setModel((Integer) value);
+ numberEditor.setModelText(getStringValue(value));
+ }
+
+ @Override
+ public Component getComponent() {
+ return numberEditor;
+ }
+ }
+
+ protected static class DecimalFactorValueInlineEditor implements FactorValueCellEditor<Double> {
+
+ protected NumberEditor numberEditor;
+
+ public DecimalFactorValueInlineEditor() {
+ numberEditor = new NumberEditor();
+ numberEditor.getTextField().setBorder(null);
+
+ numberEditor.setModelType(Double.class);
+ numberEditor.setUseFloat(true);
+ numberEditor.setUseSign(true);
+ }
+
+ @Override
+ public Double getValue() {
+ return (Double) numberEditor.getModel();
+ }
+
+ @Override
+ public void setValue(Object value) {
+ numberEditor.setModel((Double) value);
+ // FIXME sletellier 20120105 : we dont need to set modelText
+ numberEditor.setModelText(getStringValue(value));
+ }
+
+ @Override
+ public Component getComponent() {
+ return numberEditor;
+ }
+ }
+
+ protected static String getStringValue(Object value) {
+ String text = String.valueOf(value);
+ if (value == null) {
+ text = StringUtils.EMPTY;
+ }
+ return text;
+ }
+}
Property changes on: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/factorValue/FactorValueEditorFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator/MexicoDecoratorProvider.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator/MexicoDecoratorProvider.java 2012-01-18 16:06:23 UTC (rev 30)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/decorator/MexicoDecoratorProvider.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -1,39 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
- * %%
- * 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.reseaumexico.editor.ui.decorator;
-
-import fr.reseaumexico.model.Factor;
-import jaxx.runtime.decorator.DecoratorProvider;
-
-/**
- * @author sletellier <letellier(a)codelutin.com>
- */
-public class MexicoDecoratorProvider extends DecoratorProvider {
-
- @Override
- protected void loadDecorators() {
- registerJXPathDecorator(Factor.class, "${" + Factor.PROPERTY_ID + "}$s");
- }
-}
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx 2012-01-18 16:06:23 UTC (rev 30)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx 2012-01-18 16:16:00 UTC (rev 31)
@@ -1,85 +0,0 @@
-<!--
- #%L
- JMexico :: Swing Editor
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Réseau Mexico, Codelutin
- %%
- 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%
- -->
-<JPanel id='inputDesignEditor' layout='{new BorderLayout()}'>
-
- <import>
- fr.reseaumexico.model.InputDesign
- fr.reseaumexico.model.Factor
- fr.reseaumexico.editor.ui.editor.InputDesignTableModel
- fr.reseaumexico.editor.ui.editor.factorValue.FactorValueCellEditor
- fr.reseaumexico.editor.ui.editor.factorValue.FactorValueCellRenderer
- fr.reseaumexico.editor.ui.decorator.MexicoDecoratorProvider
- jaxx.runtime.swing.renderer.DecoratorProviderTableCellRenderer
- </import>
-
- <InputDesignEditorHandler id='handler'/>
-
- <InputDesignTableModel id='model' javaBean="new InputDesignTableModel()"/>
-
- <FactorValueCellEditor id='cellEditor' constructorParams='this'/>
-
- <FactorValueCellRenderer id='cellRenderer' constructorParams='this'/>
-
- <script>
- <![CDATA[
-
-private void $afterCompleteSetup() {
-
- // table renderer
- // TODO sletellier 20111221 : do on time for all, put in context ?
- MexicoDecoratorProvider mexicoDecoratorProvider = new MexicoDecoratorProvider();
- inputDesignTable.setDefaultRenderer(Factor.class, new DecoratorProviderTableCellRenderer(mexicoDecoratorProvider));
- inputDesignTable.setDefaultRenderer(Object.class, getCellRenderer());
-
- // cell editor
- inputDesignTable.setDefaultEditor(Object.class, getCellEditor());
-}
-
-public void setInputDesign(InputDesign inputDesign) {
- getModel().setInputDesign(inputDesign);
-}
-
-public InputDesign getInputDesign() {
- return getModel().getInputDesign();
-}
- ]]>
- </script>
-
- <JScrollPane constraints='BorderLayout.CENTER'>
- <JTable id='inputDesignTable' model='{getModel()}'/>
- </JScrollPane>
-
- <JPanel id='factorActionPanel' constraints='BorderLayout.SOUTH'>
- <JButton id='addScenarioButton'
- text='jmexico.add.scenario'
- constraints='BorderLayout.WEST'
- onActionPerformed='getHandler().addScenario(this)'/>
- <JButton id='removeScenarioButton'
- text='jmexico.remove.scenario'
- constraints='BorderLayout.EAST'
- onActionPerformed='getHandler().removeScenario(this)'/>
- </JPanel>
-
-</JPanel>
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditorHandler.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditorHandler.java 2012-01-18 16:06:23 UTC (rev 30)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditorHandler.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -1,117 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Réseau Mexico, Codelutin
- * %%
- * 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.reseaumexico.editor.ui.editor;
-
-import com.google.common.collect.Maps;
-import fr.reseaumexico.model.Factor;
-import fr.reseaumexico.model.InputDesign;
-import fr.reseaumexico.model.Scenario;
-import fr.reseaumexico.model.ScenarioImpl;
-import java.util.Collection;
-import java.util.Map;
-import javax.swing.JOptionPane;
-import org.apache.commons.lang3.StringUtils;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * @author sletellier <letellier(a)codelutin.com>
- * @since 0.1
- */
-public class InputDesignEditorHandler {
-
- public void addScenario(InputDesignEditor editor) {
- InputDesign inputDesign = editor.getInputDesign();
-
- String selectedName = JOptionPane.showInputDialog(editor,
- _("jmexico.scenario.inputName"),
- _("jmexico.scenario.inputName.title"),
- JOptionPane.QUESTION_MESSAGE);
-
- // if user enter name
- if (StringUtils.isNotBlank(selectedName)) {
-
- // check that name is never used
- Collection<Scenario> scenarios = inputDesign.getScenario();
-
- int maxOrder = 0;
- for (Scenario scenario : scenarios) {
- if (selectedName.equalsIgnoreCase(scenario.getName())) {
-
- JOptionPane.showMessageDialog(editor,
- _("jmexico.error.title"),
- _("jmexico.error.scenario.name.used"),
- JOptionPane.ERROR_MESSAGE);
-
- return;
- }
- int orderNumber = scenario.getOrderNumber();
- if (maxOrder < orderNumber) {
- maxOrder = orderNumber;
- }
- }
-
- // create new scenario
- Scenario scenarioToAdd = new ScenarioImpl();
-
- // set last order
- // TODO sletellier 20111219 : ask user order number
- scenarioToAdd.setOrderNumber(maxOrder + 1);
-
- // set name
- scenarioToAdd.setName(selectedName);
-
- // create all empty factor values
- Collection<Factor> factors = inputDesign.getExperimentDesign().getFactor();
- Map<Factor, Object> factorValues = Maps.newHashMap();
- for (Factor factor : factors) {
- factorValues.put(factor, null);
- }
- scenarioToAdd.setFactorValues(factorValues);
-
- inputDesign.addScenario(scenarioToAdd);
- }
- }
-
- public void removeScenario(InputDesignEditor editor) {
- InputDesign inputDesign = editor.getInputDesign();
-
- // show scenario select dialog
- Collection<Scenario> scenarios = inputDesign.getScenario();
- Scenario scenario = (Scenario)JOptionPane.showInputDialog(
- editor,
- _("jmexico.scenario.selectRemove"),
- _("jmexico.scenario.selectRemove.title"),
- JOptionPane.PLAIN_MESSAGE,
- null,
- scenarios.toArray(),
- null);
-
- // if scenario is selected
- if (scenario != null) {
- inputDesign.removeScenario(scenario);
- }
- }
-}
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignTableModel.java
===================================================================
--- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignTableModel.java 2012-01-18 16:06:23 UTC (rev 30)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignTableModel.java 2012-01-18 16:16:00 UTC (rev 31)
@@ -1,210 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Réseau Mexico, Codelutin
- * %%
- * 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.reseaumexico.editor.ui.editor;
-
-import fr.reseaumexico.model.Factor;
-import fr.reseaumexico.model.InputDesign;
-import fr.reseaumexico.model.MexicoUtil;
-import fr.reseaumexico.model.Scenario;
-import fr.reseaumexico.model.ValueType;
-import fr.reseaumexico.model.event.InputDesignScenarioEvent;
-import fr.reseaumexico.model.event.InputDesignScenarioListener;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import org.apache.commons.lang3.ObjectUtils;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * @author sletellier <letellier(a)codelutin.com>
- * @since 0.1
- */
-public class InputDesignTableModel extends AbstractTableModel implements InputDesignScenarioListener {
-
- private static final long serialVersionUID = 1L;
-
- protected TableModel delegate;
- protected InputDesign inputDesign;
- protected List<Factor> factors;
-
- public InputDesignTableModel() {
- delegate = new DefaultTableModel();
- }
-
- public void setInputDesign(InputDesign inputDesign) {
- this.inputDesign = inputDesign;
- inputDesign.addInputDesignScenarioListener(this);
-
- // extract factors
- factors = new LinkedList<Factor>(inputDesign.getExperimentDesign().getFactor());
-
- // sort on id
- Collections.sort(factors, new Comparator<Factor>() {
-
- @Override
- public int compare(Factor o1, Factor o2) {
- return o1.getId().compareTo(o2.getId());
- }
- });
-
- fireTableStructureChanged();
- }
-
- @Override
- public void onScenarioAdded(InputDesignScenarioEvent event) {
- fireTableStructureChanged();
- }
-
- @Override
- public void onScenarioRemoved(InputDesignScenarioEvent event) {
- fireTableStructureChanged();
- }
-
- public InputDesign getInputDesign() {
- return inputDesign;
- }
-
- public Collection<Scenario> getScenarios() {
- return inputDesign.getScenario();
- }
-
- public Scenario getScenario(int i) {
- return inputDesign.getScenario(i);
- }
-
- public Factor getFactor(int i) {
- return factors.get(i);
- }
-
- @Override
- public int getRowCount() {
- if (inputDesign == null) {
- return delegate.getRowCount();
- }
- return factors == null ? 0 : factors.size();
- }
-
- @Override
- public int getColumnCount() {
- if (inputDesign == null) {
- return delegate.getColumnCount();
- }
- Collection<Scenario> scenarios = getScenarios();
- if (scenarios == null) {
- return 1;
- }
- return scenarios.size() + 1;
- }
-
- @Override
- public String getColumnName(int rowIndex) {
- if (inputDesign == null) {
- return delegate.getColumnName(rowIndex);
- }
- if (rowIndex == 0) {
- return _("jmexico.factor.name");
- }
- Scenario scenario = getScenario(rowIndex - 1);
- return scenario == null ? "" : scenario.getName();
- }
-
- @Override
- public Class<?> getColumnClass(int rowIndex) {
- if (inputDesign == null) {
- return delegate.getColumnClass(rowIndex);
- }
- if (rowIndex == 0) {
- return Factor.class;
- }
- return Object.class;
- }
-
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- if (inputDesign == null) {
- return delegate.isCellEditable(rowIndex, columnIndex);
- }
- return columnIndex > 0;
- }
-
- @Override
- public Object getValueAt(int rowIndex, int columnIndex) {
- if (inputDesign == null) {
- return delegate.getValueAt(rowIndex, columnIndex);
- }
-
- // get key on rowIndex
- Factor factor = getFactor(rowIndex);
-
- // first column is factors
- if (columnIndex == 0) {
- return factor;
- }
-
- // others are scenarios
- columnIndex = columnIndex - 1;
- Scenario scenario = getScenario(columnIndex);
- if (scenario == null) {
- return null;
- }
- Map<Factor,Object> factorValues = scenario.getFactorValues();
-
- Object result = factorValues.get(factor);
- return result;
- }
-
- @Override
- public void setValueAt(Object o, int rowIndex, int columnIndex) {
- if (inputDesign == null) {
- delegate.setValueAt(o, rowIndex, columnIndex);
- return;
- }
- if (columnIndex == 0) {
-
- // must never append
- return;
- }
- int scenarioIndex = columnIndex - 1;
- Scenario scenario = getScenario(scenarioIndex);
-
- // get key if rowIndex
- Factor factor = getFactor(rowIndex);
-
- // take care of type
- ValueType valueType = factor.getDomain().getValueType();
-
- String value = ObjectUtils.toString(o);
- scenario.setFactorValue(factor, MexicoUtil.getTypedValue(valueType, value));
-
- fireTableCellUpdated(rowIndex, columnIndex);
- }
-}
Modified: trunk/jmexico-editor-demo/pom.xml
===================================================================
--- trunk/jmexico-editor-demo/pom.xml 2012-01-18 16:06:23 UTC (rev 30)
+++ trunk/jmexico-editor-demo/pom.xml 2012-01-18 16:16:00 UTC (rev 31)
@@ -64,8 +64,8 @@
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
- <name>JMexico :: Swing Editor</name>
- <description>JMexico - Swing Editor module</description>
+ <name>JMexico :: Swing Editor Demo</name>
+ <description>JMexico - Swing Editor Demo module</description>
<properties>
Modified: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx 2012-01-18 16:06:23 UTC (rev 30)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx 2012-01-18 16:16:00 UTC (rev 31)
@@ -28,7 +28,7 @@
onWindowClosing='getHandler().closeApplication(this)'>
<import>
- fr.reseaumexico.editor.ui.editor.InputDesignEditor
+ fr.reseaumexico.editor.InputDesignEditor
fr.reseaumexico.model.InputDesign
</import>
1
0
18 Jan '12
Author: tchemit
Date: 2012-01-18 17:06:23 +0100 (Wed, 18 Jan 2012)
New Revision: 30
Url: http://forge.codelutin.com/repositories/revision/jmexico/30
Log:
add a real demo module
Added:
trunk/jmexico-editor-demo/
trunk/jmexico-editor-demo/LICENSE.txt
trunk/jmexico-editor-demo/README.txt
trunk/jmexico-editor-demo/changelog.txt
trunk/jmexico-editor-demo/pom.xml
trunk/jmexico-editor-demo/src/
trunk/jmexico-editor-demo/src/license/
trunk/jmexico-editor-demo/src/license/THIRD-PARTY.properties
trunk/jmexico-editor-demo/src/main/
trunk/jmexico-editor-demo/src/main/assembly/
trunk/jmexico-editor-demo/src/main/assembly/bin.xml
trunk/jmexico-editor-demo/src/main/assembly/bin/
trunk/jmexico-editor-demo/src/main/assembly/bin/README.txt
trunk/jmexico-editor-demo/src/main/assembly/bin/go.bat
trunk/jmexico-editor-demo/src/main/assembly/bin/go.sh
trunk/jmexico-editor-demo/src/main/java/
trunk/jmexico-editor-demo/src/main/java/fr/
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java
trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java
trunk/jmexico-editor-demo/src/main/resources/
trunk/jmexico-editor-demo/src/main/resources/i18n/
trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties
trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties
trunk/jmexico-editor-demo/src/main/resources/log4j.properties
trunk/jmexico-editor-demo/src/site/
trunk/jmexico-editor-demo/src/site/rst/
trunk/jmexico-editor-demo/src/site/rst/index.rst
trunk/jmexico-editor-demo/src/site/site_fr.xml
trunk/jmexico-editor-demo/src/test/
trunk/jmexico-editor-demo/src/test/java/
trunk/jmexico-editor/
trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties
trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties
trunk/jmexico-model/src/main/xmi/mexico.properties
Removed:
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.css
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoUIModel.java
trunk/jmexico-editor/src/main/resources/i18n/jmexico-swing-editor_en_GB.properties
trunk/jmexico-editor/src/main/resources/i18n/jmexico-swing-editor_fr_FR.properties
trunk/jmexico-swing-editor/
Modified:
trunk/jmexico-editor/pom.xml
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java
trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java
trunk/pom.xml
trunk/src/site/site_fr.xml
Modified: trunk/jmexico-editor/pom.xml
===================================================================
--- trunk/jmexico-swing-editor/pom.xml 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/pom.xml 2012-01-18 16:06:23 UTC (rev 30)
@@ -14,7 +14,7 @@
</parent>
<groupId>fr.reseaumexico</groupId>
- <artifactId>jmexico-swing-editor</artifactId>
+ <artifactId>jmexico-editor</artifactId>
<dependencies>
@@ -70,12 +70,10 @@
<!-- ************************************************************* -->
<name>JMexico :: Swing Editor</name>
- <description>JMexico - Swing Editor module</description>
+ <description>JMexico - Editor module</description>
<properties>
- <maven.jar.main.class>fr.reseaumexico.editor.RunMexico</maven.jar.main.class>
-
<!-- jaxx configuration -->
<jaxx.addProjectClassPath>true</jaxx.addProjectClassPath>
<jaxx.addSourcesToClassPath>true</jaxx.addSourcesToClassPath>
@@ -89,33 +87,7 @@
<build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <useUniqueVersions>true</useUniqueVersions>
- <addClasspath>true</addClasspath>
- <classpathPrefix>./lib/</classpathPrefix>
- </manifest>
- </archive>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- </pluginManagement>
-
<plugins>
<plugin>
@@ -129,27 +101,8 @@
</execution>
</executions>
</plugin>
-
+
<plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <overWriteIfNewer>true</overWriteIfNewer>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- <silent>true</silent>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
<groupId>org.nuiton.i18n</groupId>
<artifactId>maven-i18n-plugin</artifactId>
<executions>
@@ -174,82 +127,5 @@
</build>
- <profiles>
- <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin -->
- <profile>
- <id>jnlp</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
-
- <defaultGoal>verify</defaultGoal>
- <plugins>
- <!-- key store secrets availables -->
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <executions>
- <execution>
- <id>get-keystore</id>
- <goals>
- <goal>share-server-secret</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <serverId>codelutin-keystore</serverId>
- <privateKeyOut>keystorepath</privateKeyOut>
- <passwordOut>keystorepass</passwordOut>
- <usernameOut>keyalias</usernameOut>
- <passphraseOut>keypass</passphraseOut>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- make webstart -->
- <plugin>
- <groupId>org.codehaus.mojo.webstart</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-jnlp</id>
- <phase>package</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin -->
- <profile>
- <id>reporting</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo.webstart</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <version>${webstartPluginVersion}</version>
- </plugin>
- </plugins>
- </reporting>
-
- </profile>
- </profiles>
-
</project>
\ No newline at end of file
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,56 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Réseau Mexico, Codelutin
- * %%
- * 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.reseaumexico.editor;
-
-import fr.reseaumexico.editor.ui.MexicoMainUI;
-import fr.reseaumexico.editor.ui.MexicoMainUIHandler;
-import jaxx.runtime.context.JAXXInitialContext;
-import jaxx.runtime.swing.ErrorDialogUI;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author sletellier <letellier(a)codelutin.com>
- * @since 0.1
- */
-public class RunMexico {
-
- /** Logger */
- private static Log log = LogFactory.getLog(RunMexico.class);
-
- public static void main(String[] args) {
-
- try {
- JAXXInitialContext jaxxContext = new JAXXInitialContext();
- MexicoMainUIHandler mainHandler = new MexicoMainUIHandler();
-
- MexicoMainUI mainUI = mainHandler.initUI(jaxxContext);
- } catch (Exception eee) {
- log.error(eee.getMessage(), eee);
- ErrorDialogUI.showError(eee);
- System.exit(1);
- }
- }
-}
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.css
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.css 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.css 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,39 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Réseau Mexico, Codelutin
- * %%
- * 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%
- */
-#menuFile {
- text:"jmexico.menu.file";
- mnemonic:F;
-}
-#menuFileOpen {
- text:"jmexico.menu.file.open";
- mnemonic:O;
-}
-#menuFileSave {
- text:"jmexico.menu.file.save";
- mnemonic:S;
-}
-#exit {
- text:"jmexico.menu.exit";
-}
\ No newline at end of file
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,72 +0,0 @@
-<!--
- #%L
- JMexico :: Swing Editor
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Réseau Mexico, Codelutin
- %%
- 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%
- -->
-<JFrame id='mainFrame' decorator='help'
- width='800' height='800'
- layout='{new BorderLayout()}'
- onWindowClosing='getHandler().closeApplication(this)'>
-
- <import>
- fr.reseaumexico.editor.ui.editor.InputDesignEditor
- fr.reseaumexico.model.InputDesign
- </import>
-
- <MexicoMainUIHandler id="handler"
- initializer='getContextValue(MexicoMainUIHandler.class)'/>
-
- <MexicoUIModel id="model"/>
-
- <script>
- <![CDATA[
-
-public void setInputDesign(InputDesign inputDesign) {
- getModel().setInputDesign(inputDesign);
- inputDesignEditor.setInputDesign(inputDesign);
-}
-
-public InputDesign getInputDesign() {
- return getModel().getInputDesign();
-}
- ]]>
- </script>
-
- <!-- menu -->
- <JMenuBar id='menu'>
- <JMenu id='menuFile'>
- <JMenuItem id='menuFileOpen'
- onActionPerformed="getHandler().openFile(this)"/>
-
- <JMenuItem id='menuFileSave'
- enabled='{getModel().isOptionChanged()}'
- onActionPerformed="getHandler().saveFile(this)"/>
-
- <JSeparator/>
-
- <JMenuItem id='exit'
- onActionPerformed="getHandler().closeApplication(this)"/>
-
- </JMenu>
- </JMenuBar>
- <InputDesignEditor id='inputDesignEditor' constraints='BorderLayout.CENTER'/>
-</JFrame>
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,150 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Réseau Mexico, Codelutin
- * %%
- * 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.reseaumexico.editor.ui;
-
-import fr.reseaumexico.model.InputDesign;
-import fr.reseaumexico.model.event.InputDesignFactorEvent;
-import fr.reseaumexico.model.event.InputDesignFactorListener;
-import fr.reseaumexico.model.event.InputDesignScenarioEvent;
-import fr.reseaumexico.model.event.InputDesignScenarioListener;
-import fr.reseaumexico.model.parser.InputDesignParser;
-import fr.reseaumexico.model.writer.InputDesignXmlWriter;
-import java.io.File;
-import java.io.IOException;
-import javax.swing.JFileChooser;
-import jaxx.runtime.context.JAXXInitialContext;
-import jaxx.runtime.swing.ErrorDialogUI;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Handler of main UI
- *
- * @author sletellier <letellier(a)codelutin.com>
- * @since 0.1
- */
-public class MexicoMainUIHandler {
-
- /** Logger */
- private static Log log = LogFactory.getLog(MexicoMainUIHandler.class);
-
- public void closeApplication(MexicoMainUI ui) {
- ui.dispose();
- }
-
- public MexicoMainUI initUI(JAXXInitialContext context) {
-
- // share handler
- context.add(this);
-
- // construt main UI
- MexicoMainUI ui = new MexicoMainUI(context);
-
- // display
- ui.setVisible(true);
-
- // synch to error dialog
- ErrorDialogUI.init(ui);
-
- return ui;
- }
-
- public void openFile(final MexicoMainUI ui) {
- JFileChooser fileChooser = new JFileChooser();
- fileChooser.setDialogTitle(_("jmexico.file.open.dialog"));
- int returnVal = fileChooser.showOpenDialog(ui);
- if(returnVal == JFileChooser.APPROVE_OPTION) {
- File selectedFile = fileChooser.getSelectedFile();
- InputDesign inputDesign = readInputDesignFile(selectedFile);
-
- // add listener to listen option values changes
- inputDesign.addInputDesignFactorListener(new InputDesignFactorListener() {
-
- @Override
- public void onFactorValueChange(InputDesignFactorEvent event) {
- ui.setInputDesign(event.getSource());
- }
- });
- // add listener to listen option values changes
- inputDesign.addInputDesignScenarioListener(new InputDesignScenarioListener() {
-
- @Override
- public void onScenarioAdded(InputDesignScenarioEvent event) {
- ui.setInputDesign(event.getSource());
- }
-
- @Override
- public void onScenarioRemoved(InputDesignScenarioEvent event) {
- ui.setInputDesign(event.getSource());
- }
- });
-
- ui.setInputDesign(inputDesign);
-
- // keep selected file
- ui.getModel().setInputDesignFile(selectedFile);
- }
- }
-
- public void saveFile(MexicoMainUI ui) {
- // get selected file
- File selectedFile = ui.getModel().getInputDesignFile();
-
- // save modified model
- try {
- InputDesignXmlWriter writer = new InputDesignXmlWriter(selectedFile, ui.getInputDesign());
- try {
- writer.write();
- } finally {
- writer.close();
- ui.getModel().setOptionChanged(false);
- }
- } catch (IOException eee) {
- log.error("Failed to save inputDesign file '" + selectedFile.getName() + "'", eee);
- ErrorDialogUI.showError(eee);
- }
- }
-
- protected InputDesign readInputDesignFile(File selectedFile) {
- InputDesign inputDesignModel = null;
- try {
- // parse inputDesign
- InputDesignParser inputDesignParser = new InputDesignParser(selectedFile);
- try {
- inputDesignModel = inputDesignParser.getModel();
- } finally {
- inputDesignParser.close();
- }
-
- } catch (Exception eee) {
- log.error("Failed to read inputDesign file '" + selectedFile.getName() + "'", eee);
- ErrorDialogUI.showError(eee);
- }
-
- return inputDesignModel;
- }
-}
Deleted: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoUIModel.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoUIModel.java 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoUIModel.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,97 +0,0 @@
-/*
- * #%L
- * JMexico :: Swing Editor
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
- * %%
- * 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.reseaumexico.editor.ui;
-
-import fr.reseaumexico.model.InputDesign;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.File;
-
-/**
- * @author sletellier <letellier(a)codelutin.com>
- */
-public class MexicoUIModel {
-
- protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
-
- public static final String PROPERTY_OPTION_CHANGED = "optionChanged";
- public static final String PROPERTY_INPUT_DESIGN = "inputDesign";
- public static final String PROPERTY_INPUT_DESIGN_FILE = "inputDesignFile";
-
- protected InputDesign inputDesign;
- protected File inputDesignFile;
- protected boolean optionChanged;
-
- public File getInputDesignFile() {
- return inputDesignFile;
- }
-
- public void setInputDesignFile(File inputDesignFile) {
- File oldInputDesignFile = getInputDesignFile();
- this.inputDesignFile = inputDesignFile;
- firePropertyChange(PROPERTY_INPUT_DESIGN_FILE, oldInputDesignFile, inputDesignFile);
- }
-
- public InputDesign getInputDesign() {
- return inputDesign;
- }
-
- public void setInputDesign(InputDesign inputDesign) {
- InputDesign oldInputDesign = getInputDesign();
- this.inputDesign = inputDesign;
- setOptionChanged(true);
- firePropertyChange(PROPERTY_INPUT_DESIGN, oldInputDesign, inputDesign);
- }
-
- public boolean isOptionChanged() {
- return optionChanged;
- }
-
- public void setOptionChanged(boolean optionChanged) {
- boolean oldValue = isOptionChanged();
- this.optionChanged = optionChanged;
- firePropertyChange(PROPERTY_OPTION_CHANGED, oldValue, optionChanged);
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- pcs.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- pcs.addPropertyChangeListener(propertyName, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- pcs.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- pcs.removePropertyChangeListener(propertyName, listener);
- }
-
- protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
- pcs.firePropertyChange(propertyName, oldValue, newValue);
- }
-}
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/InputDesignEditor.jaxx 2012-01-18 16:06:23 UTC (rev 30)
@@ -25,8 +25,6 @@
<JPanel id='inputDesignEditor' layout='{new BorderLayout()}'>
<import>
- javax.swing.table.TableModel
- javax.swing.table.DefaultTableModel
fr.reseaumexico.model.InputDesign
fr.reseaumexico.model.Factor
fr.reseaumexico.editor.ui.editor.InputDesignTableModel
@@ -70,8 +68,7 @@
</script>
<JScrollPane constraints='BorderLayout.CENTER'>
- <JTable id='inputDesignTable'
- model='{getModel()}'/>
+ <JTable id='inputDesignTable' model='{getModel()}'/>
</JScrollPane>
<JPanel id='factorActionPanel' constraints='BorderLayout.SOUTH'>
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -54,7 +54,7 @@
protected Object currentValue;
protected JTextField defaultInlineEditor;
protected FactorValueEditorFactory.FactorValueCellEditor specificEditor;
- protected boolean isEditing = false;
+ protected boolean isEditing;
protected FactorValueEditorFactory factory;
public FactorValueCellEditor(JAXXContext context) {
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -48,9 +48,9 @@
if (factory == null) {
factory = new FactorValueEditorFactory();
}
-
- this.delegate = new DefaultTableCellRenderer();
+ delegate = new DefaultTableCellRenderer();
+
}
@Override
Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -31,6 +31,7 @@
import java.awt.Component;
import java.util.Map;
import javax.swing.JCheckBox;
+import javax.swing.JDialog;
import javax.swing.JTextField;
import jaxx.runtime.swing.editor.NumberEditor;
import org.apache.commons.lang3.StringUtils;
@@ -46,11 +47,11 @@
protected Map<Factor, FactorValueCellEditor<?>> factorValueEditorCache = Maps.newHashMap();
/**
- * Provide specific {@link javax.swing.JDialog} editor for factor value
+ * Provide specific {@link JDialog} editor for factor value
*
* @param factor concerned
* @param value value to edit
- * @return {@link FactorValueEditor} contain editor to open as {@link javax.swing.JDialog},
+ * @return {@link FactorValueEditor} contain editor to open as {@link JDialog},
* null if cell editor must be used
*/
public FactorValueEditor getDialogEditor(Factor factor, Object value) {
@@ -121,17 +122,17 @@
return getCellEditor(factor, value);
}
- protected static interface FactorValueCellRenderer {
+ protected interface FactorValueCellRenderer {
- public abstract Component getComponent();
- public abstract void setValue(Object value);
+ Component getComponent();
+ void setValue(Object value);
}
- protected static interface FactorValueCellEditor<B> extends FactorValueCellRenderer {
+ protected interface FactorValueCellEditor<B> extends FactorValueCellRenderer {
- public abstract B getValue();
- public abstract void setValue(Object value);
- public abstract Component getComponent();
+ B getValue();
+ void setValue(Object value);
+ Component getComponent();
}
protected static class DefaultFactorValueInlineEditor implements FactorValueCellEditor<String> {
@@ -139,8 +140,8 @@
protected JTextField component;
public DefaultFactorValueInlineEditor() {
- this.component = new JTextField();
- this.component.setBorder(null);
+ component = new JTextField();
+ component.setBorder(null);
}
@Override
@@ -164,7 +165,7 @@
protected JCheckBox checkBox;
public BooleanFactorValueInlineEditor() {
- this.checkBox = new JCheckBox();
+ checkBox = new JCheckBox();
}
@Override
@@ -175,7 +176,7 @@
@Override
public void setValue(Object value) {
if (value != null) {
- this.checkBox.setSelected((Boolean)value);
+ checkBox.setSelected((Boolean) value);
}
}
@@ -190,7 +191,7 @@
protected NumberEditor numberEditor;
public IntegerFactorValueInlineEditor() {
- this.numberEditor = new NumberEditor();
+ numberEditor = new NumberEditor();
numberEditor.getTextField().setBorder(null);
numberEditor.setUseFloat(false);
@@ -220,7 +221,7 @@
protected NumberEditor numberEditor;
public DecimalFactorValueInlineEditor() {
- this.numberEditor = new NumberEditor();
+ numberEditor = new NumberEditor();
numberEditor.getTextField().setBorder(null);
numberEditor.setModelType(Double.class);
Added: trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties
===================================================================
--- trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties (rev 0)
+++ trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,7 @@
+jmexico.error.scenario.name.used=Error \: scenario name '%1$s' is already used.
+jmexico.error.title=Error
+jmexico.factor.name=Factor
+jmexico.scenario.inputName=Name of scenario to add \:
+jmexico.scenario.inputName.title=Input a name for scenario to add
+jmexico.scenario.selectRemove=Select scenario to delete
+jmexico.scenario.selectRemove.title=Select scenario to remove
Property changes on: trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_en_GB.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties
===================================================================
--- trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties (rev 0)
+++ trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,7 @@
+jmexico.error.scenario.name.used=Erreur \: le scenario '%1$s' est déjà utilisé.
+jmexico.error.title=Erreur
+jmexico.factor.name=Facteur
+jmexico.scenario.inputName=Nom du scénario à ajouter \:
+jmexico.scenario.inputName.title=Enter un nom pour le scenario à ajouter
+jmexico.scenario.selectRemove=Selection du scénario à supprimer
+jmexico.scenario.selectRemove.title=Select scenario to remove
Property changes on: trunk/jmexico-editor/src/main/resources/i18n/jmexico-editor_fr_FR.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/jmexico-editor/src/main/resources/i18n/jmexico-swing-editor_en_GB.properties
===================================================================
--- trunk/jmexico-swing-editor/src/main/resources/i18n/jmexico-swing-editor_en_GB.properties 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/resources/i18n/jmexico-swing-editor_en_GB.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,15 +0,0 @@
-jmexico.add.scenario=Add a scenario
-jmexico.error.scenario.name.used=Error \: scenario name '%1$s' is already used.
-jmexico.error.title=Error
-jmexico.factor.name=Factor
-jmexico.file.open.dialog=Open an InputDesign file.
-jmexico.input.msg=New value
-jmexico.menu.exit=Exit
-jmexico.menu.file=File
-jmexico.menu.file.open=Open
-jmexico.menu.file.save=Save
-jmexico.remove.scenario=Delete a scenario
-jmexico.scenario.inputName=Name of scenario to add \:
-jmexico.scenario.inputName.title=Input a name for scenario to add
-jmexico.scenario.selectRemove=Select scenario to delete
-jmexico.scenario.selectRemove.title=Select scenario to remove
Deleted: trunk/jmexico-editor/src/main/resources/i18n/jmexico-swing-editor_fr_FR.properties
===================================================================
--- trunk/jmexico-swing-editor/src/main/resources/i18n/jmexico-swing-editor_fr_FR.properties 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/jmexico-editor/src/main/resources/i18n/jmexico-swing-editor_fr_FR.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -1,15 +0,0 @@
-jmexico.add.scenario=Ajout d'un scenario
-jmexico.error.scenario.name.used=Erreur \: le scenario '%1$s' est déjà utilisé.
-jmexico.error.title=Erreur
-jmexico.factor.name=Facteur
-jmexico.file.open.dialog=Ouvrir un fichier InputDesign
-jmexico.input.msg=Nouvelle valeur
-jmexico.menu.exit=Quitter
-jmexico.menu.file=Fichier
-jmexico.menu.file.open=Ouvrir
-jmexico.menu.file.save=Sauvegarder
-jmexico.remove.scenario=Suppression d'un scenario
-jmexico.scenario.inputName=Nom du scénario à ajouter \:
-jmexico.scenario.inputName.title=Enter un nom pour le scenario à ajouter
-jmexico.scenario.selectRemove=Selection du scénario à supprimer
-jmexico.scenario.selectRemove.title=Select scenario to remove
Property changes on: trunk/jmexico-editor-demo
___________________________________________________________________
Added: svn:ignore
+ target
*.ipr
*.iws
*.iml
*.log
Added: trunk/jmexico-editor-demo/LICENSE.txt
===================================================================
--- trunk/jmexico-editor-demo/LICENSE.txt (rev 0)
+++ trunk/jmexico-editor-demo/LICENSE.txt 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Property changes on: trunk/jmexico-editor-demo/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jmexico-editor-demo/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jmexico-editor-demo/changelog.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/pom.xml
===================================================================
--- trunk/jmexico-editor-demo/pom.xml (rev 0)
+++ trunk/jmexico-editor-demo/pom.xml 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>fr.reseaumexico</groupId>
+ <artifactId>jmexico</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <groupId>fr.reseaumexico</groupId>
+ <artifactId>jmexico-editor-demo</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jmexico-model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jmexico-editor</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>nuiton-i18n</artifactId>
+ </dependency>
+
+ <!-- jaxx dependencies -->
+ <dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-runtime</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-widgets</artifactId>
+ </dependency>
+
+ <!-- logging dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>JMexico :: Swing Editor</name>
+ <description>JMexico - Swing Editor module</description>
+
+ <properties>
+
+ <maven.jar.main.class>fr.reseaumexico.editor.demo.RunMexicoEditorDemo</maven.jar.main.class>
+
+ <!-- jaxx configuration -->
+ <jaxx.addProjectClassPath>true</jaxx.addProjectClassPath>
+ <jaxx.addSourcesToClassPath>true</jaxx.addSourcesToClassPath>
+ <jaxx.autoImportCss>true</jaxx.autoImportCss>
+ <jaxx.autoRecurseInCss>false</jaxx.autoRecurseInCss>
+
+ <i18n.bundleOutputName>jmexico-editor-demo-i18n</i18n.bundleOutputName>
+
+ <!-- generate license bundled files -->
+ <license.generateBundle>true</license.generateBundle>
+
+ </properties>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <build>
+
+ <pluginManagement>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <useUniqueVersions>true</useUniqueVersions>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>./lib/</classpathPrefix>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </pluginManagement>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>maven-jaxx-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ <silent>true</silent>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>scan-sources</id>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
+ <!--<configuration>-->
+ <!--<entries>-->
+ <!--<entry>-->
+ <!--<basedir>${maven.gen.dir}/java/</basedir>-->
+ <!--</entry>-->
+ <!--</entries>-->
+ <!--</configuration>-->
+ </execution>
+ <execution>
+ <id>make-bundle</id>
+ <goals>
+ <goal>bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-licenses</id>
+ <goals>
+ <goal>update-project-license</goal>
+ <goal>add-third-party</goal>
+ </goals>
+ <configuration>
+ <licenseMerges>
+ <licenseMerge>
+ The Apache Software License, Version 2.0|Apache License, Version 2.0
+ </licenseMerge>
+ <licenseMerge>BSD License|BSD</licenseMerge>
+ </licenseMerges>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <profiles>
+
+ <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin -->
+ <profile>
+ <id>jnlp</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+ <!-- key store secrets availables -->
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-helper-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-keystore</id>
+ <goals>
+ <goal>share-server-secret</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <serverId>codelutin-keystore</serverId>
+ <privateKeyOut>keystorepath</privateKeyOut>
+ <passwordOut>keystorepass</passwordOut>
+ <usernameOut>keyalias</usernameOut>
+ <passphraseOut>keypass</passphraseOut>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- make webstart -->
+ <plugin>
+ <groupId>org.codehaus.mojo.webstart</groupId>
+ <artifactId>webstart-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-jnlp</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jnlp-inline</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>assembly-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ <attach>false</attach>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-assemblies</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin -->
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo.webstart</groupId>
+ <artifactId>webstart-maven-plugin</artifactId>
+ <version>${webstartPluginVersion}</version>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ </profile>
+ </profiles>
+
+</project>
\ No newline at end of file
Property changes on: trunk/jmexico-editor-demo/pom.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/jmexico-editor-demo/src/license/THIRD-PARTY.properties (rev 0)
+++ trunk/jmexico-editor-demo/src/license/THIRD-PARTY.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,21 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - Apache Software License, version 1.1
+# - BSD License
+# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - GNU General Public License - Version 2 with the class path exception
+# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL)
+# - Lesser General Public License (LGPL) v 3.0
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
+# - MIT License
+# - Public Domain
+# - The Apache Software License, Version 2.0
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Mon Jan 16 12:09:15 CET 2012
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
Property changes on: trunk/jmexico-editor-demo/src/license/THIRD-PARTY.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/main/assembly/bin/README.txt
===================================================================
--- trunk/jmexico-editor-demo/src/main/assembly/bin/README.txt (rev 0)
+++ trunk/jmexico-editor-demo/src/main/assembly/bin/README.txt 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,16 @@
+Démarrage de la démo
+--------------------
+
+Pour lancer la démo, taper la commande suivante dans une console :
+
+./go.sh
+
+ou
+
+./go.bat
+
+Vous pouvez aussi dans un explorateur double cliquer sur le fichier jar dans
+ce même répertoire.
+
+Note : Pour cela votre explorateur de fichier doit être configurer pour lancer
+ des applications java.
Added: trunk/jmexico-editor-demo/src/main/assembly/bin/go.bat
===================================================================
--- trunk/jmexico-editor-demo/src/main/assembly/bin/go.bat (rev 0)
+++ trunk/jmexico-editor-demo/src/main/assembly/bin/go.bat 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1 @@
+java -Xmx512M -Xms512M -jar ${project.build.finalName}.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
\ No newline at end of file
Property changes on: trunk/jmexico-editor-demo/src/main/assembly/bin/go.bat
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/jmexico-editor-demo/src/main/assembly/bin/go.sh
===================================================================
--- trunk/jmexico-editor-demo/src/main/assembly/bin/go.sh (rev 0)
+++ trunk/jmexico-editor-demo/src/main/assembly/bin/go.sh 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,28 @@
+###
+# #%L
+# ObServe :: Client
+#
+# $Id: go.sh 1306 2011-02-15 21:15:22Z chemit $
+# $HeadURL: https://svn.mpl.ird.fr/osiris/observe/trunk/observe-cli/src/main/assembly/b… $
+# %%
+# Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
+# %%
+# 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
+# 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-3.0.html>.
+# #L%
+###
+#!/bin/sh
+
+MX=512M
+java -Xmx$MX -Xms$MX -jar ${project.build.finalName}.jar "$@"
\ No newline at end of file
Property changes on: trunk/jmexico-editor-demo/src/main/assembly/bin/go.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/jmexico-editor-demo/src/main/assembly/bin.xml
===================================================================
--- trunk/jmexico-editor-demo/src/main/assembly/bin.xml (rev 0)
+++ trunk/jmexico-editor-demo/src/main/assembly/bin.xml 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,69 @@
+<!--
+ #%L
+ ObServe :: Client
+
+ $Id: bin.xml 1391 2011-04-15 11:53:14Z chemit $
+ $HeadURL: https://svn.mpl.ird.fr/osiris/observe/trunk/observe-cli/src/main/assembly/b… $
+ %%
+ Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
+ %%
+ 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%
+ -->
+<assembly>
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+
+ <fileSets>
+
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>0755</fileMode>
+ <includes>
+ <include>${project.build.finalName}.jar</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>THIRD-PARTY.txt</include>
+ <include>LICENSE.txt</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/assembly/bin</directory>
+ <outputDirectory>/</outputDirectory>
+ <fileMode>0755</fileMode>
+ <filtered>true</filtered>
+ <includes>
+ <include>go.*</include>
+ <include>README.txt</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+</assembly>
Property changes on: trunk/jmexico-editor-demo/src/main/assembly/bin.xml
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css (rev 0)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.css 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id: MexicoMainUI.css 24 2012-01-18 09:54:16Z sletellier $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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%
+ */
+#menuFile {
+ text:"jmexico.menu.file";
+ mnemonic:F;
+}
+#menuFileOpen {
+ text:"jmexico.menu.file.open";
+ mnemonic:O;
+}
+#menuFileSave {
+ text:"jmexico.menu.file.save";
+ mnemonic:S;
+}
+#exit {
+ text:"jmexico.menu.exit";
+}
\ No newline at end of file
Added: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx (rev 0)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUI.jaxx 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,72 @@
+<!--
+ #%L
+ JMexico :: Swing Editor
+
+ $Id: MexicoMainUI.jaxx 26 2012-01-18 10:25:02Z sletellier $
+ $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ %%
+ Copyright (C) 2011 Réseau Mexico, Codelutin
+ %%
+ 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%
+ -->
+<JFrame id='mainFrame' decorator='help'
+ width='800' height='800'
+ layout='{new BorderLayout()}'
+ onWindowClosing='getHandler().closeApplication(this)'>
+
+ <import>
+ fr.reseaumexico.editor.ui.editor.InputDesignEditor
+ fr.reseaumexico.model.InputDesign
+ </import>
+
+ <MexicoEditorDemoUIHandler id="handler"
+ initializer='getContextValue(MexicoEditorDemoUIHandler.class)'/>
+
+ <MexicoEditorDemoUIModel id="model"/>
+
+ <script>
+ <![CDATA[
+
+public void setInputDesign(InputDesign inputDesign) {
+ getModel().setInputDesign(inputDesign);
+ inputDesignEditor.setInputDesign(inputDesign);
+}
+
+public InputDesign getInputDesign() {
+ return getModel().getInputDesign();
+}
+ ]]>
+ </script>
+
+ <!-- menu -->
+ <JMenuBar id='menu'>
+ <JMenu id='menuFile'>
+ <JMenuItem id='menuFileOpen'
+ onActionPerformed="getHandler().openFile(this)"/>
+
+ <JMenuItem id='menuFileSave'
+ enabled='{getModel().isOptionChanged()}'
+ onActionPerformed="getHandler().saveFile(this)"/>
+
+ <JSeparator/>
+
+ <JMenuItem id='exit'
+ onActionPerformed="getHandler().closeApplication(this)"/>
+
+ </JMenu>
+ </JMenuBar>
+ <InputDesignEditor id='inputDesignEditor' constraints='BorderLayout.CENTER'/>
+</JFrame>
Added: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java (rev 0)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIHandler.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,151 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id: MexicoMainUIHandler.java 26 2012-01-18 10:25:02Z sletellier $
+ * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor.demo;
+
+import fr.reseaumexico.model.InputDesign;
+import fr.reseaumexico.model.event.InputDesignFactorEvent;
+import fr.reseaumexico.model.event.InputDesignFactorListener;
+import fr.reseaumexico.model.event.InputDesignScenarioEvent;
+import fr.reseaumexico.model.event.InputDesignScenarioListener;
+import fr.reseaumexico.model.parser.InputDesignParser;
+import fr.reseaumexico.model.writer.InputDesignXmlWriter;
+import jaxx.runtime.context.JAXXInitialContext;
+import jaxx.runtime.swing.ErrorDialogUI;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.*;
+import java.io.File;
+import java.io.IOException;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Handler of main UI
+ *
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 0.1
+ */
+public class MexicoEditorDemoUIHandler {
+
+ /** Logger */
+ private static Log log = LogFactory.getLog(MexicoEditorDemoUIHandler.class);
+
+ public void closeApplication(MexicoEditorDemoUI ui) {
+ ui.dispose();
+ }
+
+ public MexicoEditorDemoUI initUI(JAXXInitialContext context) {
+
+ // share handler
+ context.add(this);
+
+ // construt main UI
+ MexicoEditorDemoUI ui = new MexicoEditorDemoUI(context);
+
+ // display
+ ui.setVisible(true);
+
+ // synch to error dialog
+ ErrorDialogUI.init(ui);
+
+ return ui;
+ }
+
+ public void openFile(final MexicoEditorDemoUI ui) {
+ JFileChooser fileChooser = new JFileChooser();
+ fileChooser.setDialogTitle(_("jmexico.file.open.dialog"));
+ int returnVal = fileChooser.showOpenDialog(ui);
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File selectedFile = fileChooser.getSelectedFile();
+ InputDesign inputDesign = readInputDesignFile(selectedFile);
+
+ // add listener to listen option values changes
+ inputDesign.addInputDesignFactorListener(new InputDesignFactorListener() {
+
+ @Override
+ public void onFactorValueChange(InputDesignFactorEvent event) {
+ ui.setInputDesign(event.getSource());
+ }
+ });
+ // add listener to listen option values changes
+ inputDesign.addInputDesignScenarioListener(new InputDesignScenarioListener() {
+
+ @Override
+ public void onScenarioAdded(InputDesignScenarioEvent event) {
+ ui.setInputDesign(event.getSource());
+ }
+
+ @Override
+ public void onScenarioRemoved(InputDesignScenarioEvent event) {
+ ui.setInputDesign(event.getSource());
+ }
+ });
+
+ ui.setInputDesign(inputDesign);
+
+ // keep selected file
+ ui.getModel().setInputDesignFile(selectedFile);
+ }
+ }
+
+ public void saveFile(MexicoEditorDemoUI ui) {
+ // get selected file
+ File selectedFile = ui.getModel().getInputDesignFile();
+
+ // save modified model
+ try {
+ InputDesignXmlWriter writer = new InputDesignXmlWriter(selectedFile, ui.getInputDesign());
+ try {
+ writer.write();
+ } finally {
+ writer.close();
+ ui.getModel().setOptionChanged(false);
+ }
+ } catch (IOException eee) {
+ log.error("Failed to save inputDesign file '" + selectedFile.getName() + "'", eee);
+ ErrorDialogUI.showError(eee);
+ }
+ }
+
+ protected InputDesign readInputDesignFile(File selectedFile) {
+ InputDesign inputDesignModel = null;
+ try {
+ // parse inputDesign
+ InputDesignParser inputDesignParser = new InputDesignParser(selectedFile);
+ try {
+ inputDesignModel = inputDesignParser.getModel();
+ } finally {
+ inputDesignParser.close();
+ }
+
+ } catch (Exception eee) {
+ log.error("Failed to read inputDesign file '" + selectedFile.getName() + "'", eee);
+ ErrorDialogUI.showError(eee);
+ }
+
+ return inputDesignModel;
+ }
+}
Added: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java (rev 0)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,96 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * %%
+ * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor.demo;
+
+import fr.reseaumexico.model.InputDesign;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+
+/** @author sletellier <letellier(a)codelutin.com> */
+public class MexicoEditorDemoUIModel {
+
+ protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+
+ public static final String PROPERTY_OPTION_CHANGED = "optionChanged";
+ public static final String PROPERTY_INPUT_DESIGN = "inputDesign";
+ public static final String PROPERTY_INPUT_DESIGN_FILE = "inputDesignFile";
+
+ protected InputDesign inputDesign;
+ protected File inputDesignFile;
+ protected boolean optionChanged;
+
+ public File getInputDesignFile() {
+ return inputDesignFile;
+ }
+
+ public void setInputDesignFile(File inputDesignFile) {
+ File oldInputDesignFile = getInputDesignFile();
+ this.inputDesignFile = inputDesignFile;
+ firePropertyChange(PROPERTY_INPUT_DESIGN_FILE, oldInputDesignFile, inputDesignFile);
+ }
+
+ public InputDesign getInputDesign() {
+ return inputDesign;
+ }
+
+ public void setInputDesign(InputDesign inputDesign) {
+ InputDesign oldInputDesign = getInputDesign();
+ this.inputDesign = inputDesign;
+ setOptionChanged(true);
+ firePropertyChange(PROPERTY_INPUT_DESIGN, oldInputDesign, inputDesign);
+ }
+
+ public boolean isOptionChanged() {
+ return optionChanged;
+ }
+
+ public void setOptionChanged(boolean optionChanged) {
+ boolean oldValue = isOptionChanged();
+ this.optionChanged = optionChanged;
+ firePropertyChange(PROPERTY_OPTION_CHANGED, oldValue, optionChanged);
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ pcs.addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ pcs.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ pcs.removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ pcs.removePropertyChangeListener(propertyName, listener);
+ }
+
+ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ pcs.firePropertyChange(propertyName, oldValue, newValue);
+ }
+}
Property changes on: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/MexicoEditorDemoUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java
===================================================================
--- trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java (rev 0)
+++ trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,58 @@
+/*
+ * #%L
+ * JMexico :: Swing Editor
+ *
+ * $Id$
+ * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+ * %%
+ * Copyright (C) 2011 Réseau Mexico, Codelutin
+ * %%
+ * 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.reseaumexico.editor.demo;
+
+import jaxx.runtime.context.JAXXInitialContext;
+import jaxx.runtime.swing.ErrorDialogUI;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.i18n.I18n;
+import org.nuiton.i18n.init.DefaultI18nInitializer;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 0.1
+ */
+public class RunMexicoEditorDemo {
+
+ /** Logger */
+ private static Log log = LogFactory.getLog(RunMexicoEditorDemo.class);
+
+ public static void main(String[] args) {
+
+ try {
+
+ I18n.init(new DefaultI18nInitializer("jmexico-editor-demo-i18n"), null);
+ JAXXInitialContext jaxxContext = new JAXXInitialContext();
+ MexicoEditorDemoUIHandler mainHandler = new MexicoEditorDemoUIHandler();
+
+ MexicoEditorDemoUI mainUI = mainHandler.initUI(jaxxContext);
+ } catch (Exception eee) {
+ log.error(eee.getMessage(), eee);
+ ErrorDialogUI.showError(eee);
+ System.exit(1);
+ }
+ }
+}
Property changes on: trunk/jmexico-editor-demo/src/main/java/fr/reseaumexico/editor/demo/RunMexicoEditorDemo.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties
===================================================================
--- trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties (rev 0)
+++ trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1 @@
+jmexico.file.open.dialog=Open an InputDesign file.
Property changes on: trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_en_GB.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties
===================================================================
--- trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties (rev 0)
+++ trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1 @@
+jmexico.file.open.dialog=Ouvrir un fichier InputDesign
Property changes on: trunk/jmexico-editor-demo/src/main/resources/i18n/jmexico-editor-demo_fr_FR.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/main/resources/log4j.properties
===================================================================
--- trunk/jmexico-editor-demo/src/main/resources/log4j.properties (rev 0)
+++ trunk/jmexico-editor-demo/src/main/resources/log4j.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,34 @@
+###
+# #%L
+# JMexico :: Swing Editor
+#
+# $Id$
+# $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/m… $
+# %%
+# Copyright (C) 2011 Réseau Mexico, Codelutin
+# %%
+# 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%
+###
+# Global logging configuration
+log4j.rootLogger=ERROR, stdout
+
+# Console output
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
+
+# mexicos
+log4j.logger.fr.reseaumexico.editor=INFO
Property changes on: trunk/jmexico-editor-demo/src/main/resources/log4j.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-editor-demo/src/site/rst/index.rst
===================================================================
--- trunk/jmexico-editor-demo/src/site/rst/index.rst (rev 0)
+++ trunk/jmexico-editor-demo/src/site/rst/index.rst 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,43 @@
+.. -
+.. * #%L
+.. * JMexico :: Swing Editor
+.. *
+.. * $Id: index.rst 28 2012-01-18 11:35:09Z tchemit $
+.. * $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/s… $
+.. * %%
+.. * Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+.. * %%
+.. * 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%
+.. -
+======================
+JMexico - Swing Editor
+======================
+
+:Authors: Tony Chemit <chemit(a)codelutin.com>
+
+.. contents:: Table des matières
+ :depth: 2
+
+.. sectnum::
+ :start: 1
+ :depth: 2
+
+Présentation
+------------
+
+Démo de l'éditeur d'input design.
+
+Continuer cette documentation.
Added: trunk/jmexico-editor-demo/src/site/site_fr.xml
===================================================================
--- trunk/jmexico-editor-demo/src/site/site_fr.xml (rev 0)
+++ trunk/jmexico-editor-demo/src/site/site_fr.xml 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JMexico :: Swing Editor
+
+ $Id$
+ $HeadURL: http://svn.forge.codelutin.com/svn/jmexico/trunk/jmexico-swing-editor/src/s… $
+ %%
+ Copyright (C) 2011 - 2012 Réseau Mexico, Codelutin
+ %%
+ 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%
+ -->
+
+
+
+<project name="${project.name}">
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item name="Accueil" href="index.html"/>
+ <item name="Lancer la démo" href="jnlp/launch.jnlp"/>
+ </menu>
+
+ </body>
+</project>
Property changes on: trunk/jmexico-editor-demo/src/site/site_fr.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jmexico-model/src/main/xmi/mexico.properties
===================================================================
--- trunk/jmexico-model/src/main/xmi/mexico.properties (rev 0)
+++ trunk/jmexico-model/src/main/xmi/mexico.properties 2012-01-18 16:06:23 UTC (rev 30)
@@ -0,0 +1,4 @@
+
+model.tagValue.constantPrefix=PROPERTY_
+model.tagValue.version=0.1
+model.tagValue.doNotGenerateBooleanGetMethods=true
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/pom.xml 2012-01-18 16:06:23 UTC (rev 30)
@@ -22,7 +22,8 @@
<modules>
<module>jmexico-model</module>
- <module>jmexico-swing-editor</module>
+ <module>jmexico-editor</module>
+ <module>jmexico-editor-demo</module>
</modules>
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2012-01-18 11:41:27 UTC (rev 29)
+++ trunk/src/site/site_fr.xml 2012-01-18 16:06:23 UTC (rev 30)
@@ -59,7 +59,7 @@
<menu name="Utilisateur">
<item name="Accueil" href="index.html"/>
- <item name="Lancer la démo" href="jmexico-swing-editor/jnlp/launch.jnlp"/>
+ <item name="Lancer la démo" href="jmexico-editor-demo/jnlp/launch.jnlp"/>
</menu>
<menu ref="reports"/>
</body>
1
0
r29 - trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue
by sletellier@users.forge.codelutin.com 18 Jan '12
by sletellier@users.forge.codelutin.com 18 Jan '12
18 Jan '12
Author: sletellier
Date: 2012-01-18 12:41:27 +0100 (Wed, 18 Jan 2012)
New Revision: 29
Url: http://forge.codelutin.com/repositories/revision/jmexico/29
Log:
Add cache on editor factory
Modified:
trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java
trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java
trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java
Modified: trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java 2012-01-18 11:35:09 UTC (rev 28)
+++ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellEditor.java 2012-01-18 11:41:27 UTC (rev 29)
@@ -85,7 +85,6 @@
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
// get factor
- // TODO sletellier 20111221 : Take care of type
factor = (Factor) table.getValueAt(row, 0);
currentValue = value;
@@ -106,6 +105,19 @@
});
}
+ component.addFocusListener(new FocusListener() {
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ // do nothing
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ fireEditingStopped();
+ }
+ });
+
return component;
}
defaultInlineEditor.setText(currentValue == null ? "" : String.valueOf(currentValue));
@@ -116,7 +128,6 @@
public void focusGained(FocusEvent e) {
// get factor
- // TODO sletellier 20111221 : Take care of type
FactorValueEditor editor = factory.getDialogEditor(factor, currentValue);
if (editor == null) {
isEditing = true;
@@ -131,5 +142,6 @@
@Override
public void focusLost(FocusEvent e) {
+ fireEditingStopped();
}
}
Modified: trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 11:35:09 UTC (rev 28)
+++ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueCellRenderer.java 2012-01-18 11:41:27 UTC (rev 29)
@@ -40,6 +40,7 @@
protected TableCellRenderer delegate;
public FactorValueCellRenderer(JAXXContext context) {
+
// search specific factory in context
factory = context.getContextValue(FactorValueEditorFactory.class);
@@ -53,17 +54,18 @@
}
@Override
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+ public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) {
Factor factor = (Factor) table.getValueAt(row, 0);
- FactorValueEditorFactory.FactorValueCellRenderer specificEditor = factory.getRenderedComponent(factor, value);
+ FactorValueEditorFactory.FactorValueCellRenderer specificRenderer = factory.getRenderedComponent(factor, value);
Component result;
- if (specificEditor == null) {
+ if (specificRenderer == null) {
result = delegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
} else {
- result = specificEditor.getComponent();
+ result = specificRenderer.getComponent();
}
+
return result;
}
}
Modified: trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java
===================================================================
--- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java 2012-01-18 11:35:09 UTC (rev 28)
+++ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/editor/factorValue/FactorValueEditorFactory.java 2012-01-18 11:41:27 UTC (rev 29)
@@ -24,10 +24,12 @@
*/
package fr.reseaumexico.editor.ui.editor.factorValue;
+import com.google.common.collect.Maps;
import fr.reseaumexico.model.Domain;
import fr.reseaumexico.model.Factor;
import fr.reseaumexico.model.ValueType;
import java.awt.Component;
+import java.util.Map;
import javax.swing.JCheckBox;
import javax.swing.JTextField;
import jaxx.runtime.swing.editor.NumberEditor;
@@ -40,6 +42,8 @@
* @since 0.1
*/
public class FactorValueEditorFactory {
+
+ protected Map<Factor, FactorValueCellEditor<?>> factorValueEditorCache = Maps.newHashMap();
/**
* Provide specific {@link javax.swing.JDialog} editor for factor value
@@ -65,6 +69,14 @@
return null;
}
+ protected FactorValueCellEditor<?> getFactorValueCellEditor(Factor factor) {
+ return factorValueEditorCache.get(factor);
+ }
+
+ protected void setFactorValueCellEditor(Factor factor, FactorValueCellEditor<?> editor) {
+ factorValueEditorCache.put(factor, editor);
+ }
+
/**
* Provide specific cell editor for factor value
*
@@ -74,17 +86,28 @@
*/
public FactorValueCellEditor getCellEditor(Factor factor, Object value) {
+ FactorValueCellEditor<?> factorValueCellEditor = getFactorValueCellEditor(factor);
+
// get type
Domain domain = factor.getDomain();
+ ValueType valueType = ValueType.STRING;
if (domain != null) {
- ValueType valueType = domain.getValueType();
+ valueType = domain.getValueType();
+ }
+
+ if (factorValueCellEditor == null) {
switch (valueType) {
- case INTEGER: return new IntegerFactorValueInlineEditor((Integer)value);
- case DECIMAL: return new DecimalFactorValueInlineEditor((Double)value);
- case BOOLEAN: return new BooleanFactorValueInlineEditor((Boolean)value);
+ case INTEGER: factorValueCellEditor = new IntegerFactorValueInlineEditor(); break;
+ case DECIMAL: factorValueCellEditor = new DecimalFactorValueInlineEditor(); break;
+ case BOOLEAN: factorValueCellEditor = new BooleanFactorValueInlineEditor(); break;
+ default: factorValueCellEditor = new DefaultFactorValueInlineEditor();
}
}
- return new DefaultFactorValueInlineEditor(value);
+
+ setFactorValueCellEditor(factor, factorValueCellEditor);
+
+ factorValueCellEditor.setValue(value);
+ return factorValueCellEditor;
}
/**
@@ -101,11 +124,13 @@
protected static interface FactorValueCellRenderer {
public abstract Component getComponent();
+ public abstract void setValue(Object value);
}
protected static interface FactorValueCellEditor<B> extends FactorValueCellRenderer {
public abstract B getValue();
+ public abstract void setValue(Object value);
public abstract Component getComponent();
}
@@ -113,12 +138,17 @@
protected JTextField component;
- public DefaultFactorValueInlineEditor(Object value) {
- this.component = new JTextField(getStringValue(value));
+ public DefaultFactorValueInlineEditor() {
+ this.component = new JTextField();
this.component.setBorder(null);
}
@Override
+ public void setValue(Object value) {
+ component.setText(getStringValue(value));
+ }
+
+ @Override
public String getValue() {
return component.getText();
}
@@ -133,11 +163,8 @@
protected JCheckBox checkBox;
- public BooleanFactorValueInlineEditor(Boolean value) {
+ public BooleanFactorValueInlineEditor() {
this.checkBox = new JCheckBox();
- if (value != null) {
- this.checkBox.setSelected(value);
- }
}
@Override
@@ -146,6 +173,13 @@
}
@Override
+ public void setValue(Object value) {
+ if (value != null) {
+ this.checkBox.setSelected((Boolean)value);
+ }
+ }
+
+ @Override
public Component getComponent() {
return checkBox;
}
@@ -155,12 +189,10 @@
protected NumberEditor numberEditor;
- public IntegerFactorValueInlineEditor(Integer value) {
+ public IntegerFactorValueInlineEditor() {
this.numberEditor = new NumberEditor();
- numberEditor.setModel(value);
+ numberEditor.getTextField().setBorder(null);
- // FIXME sletellier 20120105 : we dont need to set modelText
- numberEditor.setModelText(getStringValue(value));
numberEditor.setUseFloat(false);
numberEditor.setUseSign(true);
}
@@ -171,6 +203,13 @@
}
@Override
+ public void setValue(Object value) {
+ // FIXME sletellier 20120105 : we dont need to set modelText
+ numberEditor.setModel((Integer)value);
+ numberEditor.setModelText(getStringValue(value));
+ }
+
+ @Override
public Component getComponent() {
return numberEditor;
}
@@ -180,12 +219,10 @@
protected NumberEditor numberEditor;
- public DecimalFactorValueInlineEditor(Double value) {
+ public DecimalFactorValueInlineEditor() {
this.numberEditor = new NumberEditor();
- numberEditor.setModel(value);
+ numberEditor.getTextField().setBorder(null);
- // FIXME sletellier 20120105 : we dont need to set modelText
- numberEditor.setModelText(getStringValue(value));
numberEditor.setModelType(Double.class);
numberEditor.setUseFloat(true);
numberEditor.setUseSign(true);
@@ -197,6 +234,13 @@
}
@Override
+ public void setValue(Object value) {
+ numberEditor.setModel((Double)value);
+ // FIXME sletellier 20120105 : we dont need to set modelText
+ numberEditor.setModelText(getStringValue(value));
+ }
+
+ @Override
public Component getComponent() {
return numberEditor;
}
1
0