Author: sletellier Date: 2011-12-16 16:54:27 +0100 (Fri, 16 Dec 2011) New Revision: 7 Url: http://forge.codelutin.com/repositories/revision/jmexico/7 Log: Init jaxx ui Added: trunk/jmexico-swing-editor/src/main/java/fr/ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java trunk/jmexico-swing-editor/src/main/resources/log4j.properties Modified: 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-swing-editor/pom.xml 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 2011-12-16 15:24:26 UTC (rev 6) +++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/ExperimentDesignParser.java 2011-12-16 15:54:27 UTC (rev 7) @@ -76,8 +76,8 @@ import static fr.reseaumexico.model.MexicoXmlConstant.LEVEL_WEIGHT; /** -* @author sletellier <letellier@codelutin.com> -*/ + * @author sletellier <letellier@codelutin.com> + */ public class ExperimentDesignParser extends MexicoXmlParser<ExperimentDesign> { protected Map<String, Factor> factors; 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 2011-12-16 15:24:26 UTC (rev 6) +++ trunk/jmexico-model/src/main/java/fr/reseaumexico/model/parser/InputDesignParser.java 2011-12-16 15:54:27 UTC (rev 7) @@ -52,8 +52,8 @@ import static fr.reseaumexico.model.MexicoXmlConstant.SCENARIO_ORDER_NUMBER; /** -* @author sletellier <letellier@codelutin.com> -*/ + * @author sletellier <letellier@codelutin.com> + */ public class InputDesignParser extends MexicoXmlParser<InputDesign> { protected ExperimentDesignParser experimentDesignParser; Modified: trunk/jmexico-swing-editor/pom.xml =================================================================== --- trunk/jmexico-swing-editor/pom.xml 2011-12-16 15:24:26 UTC (rev 6) +++ trunk/jmexico-swing-editor/pom.xml 2011-12-16 15:54:27 UTC (rev 7) @@ -46,6 +46,12 @@ <artifactId>commons-logging</artifactId> </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> <!-- ************************************************************* --> Added: trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java =================================================================== --- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java (rev 0) +++ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/RunMexico.java 2011-12-16 15:54:27 UTC (rev 7) @@ -0,0 +1,55 @@ +/* + * #%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.MexicoMainUIHandler; +import fr.reseaumexico.editor.ui.MexicoMainUI; +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@codelutin.com> + */ +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); + } + } +} Added: trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx =================================================================== --- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx (rev 0) +++ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUI.jaxx 2011-12-16 15:54:27 UTC (rev 7) @@ -0,0 +1,31 @@ +<!-- + #%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' + onWindowClosing='getHandler().closeApplication(this)'> + + <MexicoMainUIHandler id="handler" + initializer='getContextValue(MexicoMainUIHandler.class)'/> +</JFrame> Added: trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java =================================================================== --- trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java (rev 0) +++ trunk/jmexico-swing-editor/src/main/java/fr/reseaumexico/editor/ui/MexicoMainUIHandler.java 2011-12-16 15:54:27 UTC (rev 7) @@ -0,0 +1,58 @@ +/* + * #%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 jaxx.runtime.context.JAXXInitialContext; +import jaxx.runtime.swing.ErrorDialogUI; + +/** + * Handler of main UI + * + * @author sletellier <letellier@codelutin.com> + * @since 0.1 + */ +public class MexicoMainUIHandler { + + 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; + } +} Added: trunk/jmexico-swing-editor/src/main/resources/log4j.properties =================================================================== --- trunk/jmexico-swing-editor/src/main/resources/log4j.properties (rev 0) +++ trunk/jmexico-swing-editor/src/main/resources/log4j.properties 2011-12-16 15:54:27 UTC (rev 7) @@ -0,0 +1,34 @@ +### +# #%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% +### +# 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