Author: tchemit Date: 2009-10-04 01:10:18 +0200 (Sun, 04 Oct 2009) New Revision: 1552 Added: trunk/jaxx-demo/ trunk/jaxx-demo/LICENSE.txt trunk/jaxx-demo/README.txt trunk/jaxx-demo/changelog.txt trunk/jaxx-demo/pom.xml trunk/jaxx-demo/src/ trunk/jaxx-demo/src/main/ trunk/jaxx-demo/src/main/filters/ trunk/jaxx-demo/src/main/filters/jaxx-demo.properties trunk/jaxx-demo/src/main/java/ trunk/jaxx-demo/src/main/java/jaxx/ trunk/jaxx-demo/src/main/java/jaxx/demo/ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/BaseContent.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeHelper.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/Movie.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/People.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ExempleItemTreeNavigationAdapter.java trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/Calculator.css trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyle.css trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx trunk/jaxx-demo/src/main/resources/ trunk/jaxx-demo/src/main/resources/i18n/ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties trunk/jaxx-demo/src/main/resources/icons/ trunk/jaxx-demo/src/main/resources/icons/action-about.png trunk/jaxx-demo/src/main/resources/icons/action-accept.png trunk/jaxx-demo/src/main/resources/icons/action-block.png trunk/jaxx-demo/src/main/resources/icons/action-close.png trunk/jaxx-demo/src/main/resources/icons/action-config.png trunk/jaxx-demo/src/main/resources/icons/action-exit.png trunk/jaxx-demo/src/main/resources/icons/action-fullscreen.png trunk/jaxx-demo/src/main/resources/icons/action-help.png trunk/jaxx-demo/src/main/resources/icons/action-i18n-fr.png trunk/jaxx-demo/src/main/resources/icons/action-i18n-uk.png trunk/jaxx-demo/src/main/resources/icons/action-leave-fullscreen.png trunk/jaxx-demo/src/main/resources/icons/action-show-help.png trunk/jaxx-demo/src/main/resources/icons/action-site.png trunk/jaxx-demo/src/main/resources/icons/action-translate.png trunk/jaxx-demo/src/main/resources/icons/jaxx.png trunk/jaxx-demo/src/main/resources/jaxx/ trunk/jaxx-demo/src/main/resources/jaxx/demo/ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-error-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-info-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-warning-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-error-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-info-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-warning-validation.xml trunk/jaxx-demo/src/main/resources/jaxx/demo/images/ trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Amethyst.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Lynx.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Tomato.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/ana.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/hector.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/jack.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/joe.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/nacho.jpg trunk/jaxx-demo/src/main/resources/jaxx/demo/images/nacho2.png trunk/jaxx-demo/src/main/resources/jaxx/demo/images/pencil_black.gif trunk/jaxx-demo/src/main/resources/log4j.properties trunk/jaxx-demo/src/site/ trunk/jaxx-demo/src/site/rst/ trunk/jaxx-demo/src/site/rst/images/ trunk/jaxx-demo/src/site/rst/images/Components-screenshot.gif trunk/jaxx-demo/src/site/rst/images/webstart.gif trunk/jaxx-demo/src/site/rst/index.rst trunk/jaxx-demo/src/site/site.xml trunk/jaxx-demo/src/test/ trunk/jaxx-demo/src/test/java/ trunk/jaxx-demo/src/test/java/jaxx/ trunk/jaxx-demo/src/test/java/jaxx/demo/ trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java trunk/jaxx-demo/src/test/resources/ Log: Evolution #72: am?\195?\169lioration de Jaxx demo (creation du module jaxx-demo) Property changes on: trunk/jaxx-demo ___________________________________________________________________ Added: svn:ignore + target Added: trunk/jaxx-demo/LICENSE.txt =================================================================== --- trunk/jaxx-demo/LICENSE.txt (rev 0) +++ trunk/jaxx-demo/LICENSE.txt 2009-10-03 23:10:18 UTC (rev 1552) @@ -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. + Added: trunk/jaxx-demo/README.txt =================================================================== --- trunk/jaxx-demo/README.txt (rev 0) +++ trunk/jaxx-demo/README.txt 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,2 @@ +To deploy new version of pom: mvn deploy +To install localy: mvn install Added: trunk/jaxx-demo/changelog.txt =================================================================== --- trunk/jaxx-demo/changelog.txt (rev 0) +++ trunk/jaxx-demo/changelog.txt 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,2 @@ +1.7.2 + * 20091003 [chemit] - initial release (insparated from obsolote jaxx-example module) Added: trunk/jaxx-demo/pom.xml =================================================================== --- trunk/jaxx-demo/pom.xml (rev 0) +++ trunk/jaxx-demo/pom.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,296 @@ + +<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>org.nuiton</groupId> + <artifactId>jaxx</artifactId> + <version>1.7.2-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-demo</artifactId> + + <dependencies> + + <!-- sibiling dependencies --> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jaxx-runtime-swing</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jaxx-runtime-swing-widget</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- test dependencies --> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jaxx-runtime-api</artifactId> + <version>${project.version}</version> + <scope>test</scope> + <classifier>tests</classifier> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + + <name>${project.artifactId}</name> + <description>Jaxx Demo module</description> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + + <packaging>jar</packaging> + + <properties> + + <maven.jar.main.class>jaxx.demo.RunDemo</maven.jar.main.class> + + <jaxx.addProjectClassPath>true</jaxx.addProjectClassPath> + <jaxx.addSourcesToClassPath>true</jaxx.addSourcesToClassPath> + </properties> + + <build> + + <resources> + <resource> + <directory>src/main/filters</directory> + <filtering>true</filtering> + <includes> + <include>jaxx-demo.properties</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + + <pluginManagement> + <plugins> + + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathPrefix>./lib/</classpathPrefix> + </manifest> + </archive> + </configuration> + </plugin> + + <plugin> + <groupId>org.nuiton.thirdparty</groupId> + <artifactId>webstart-maven-plugin</artifactId> + <configuration> + <jnlpExtensions> + <jnlpExtension> + <name>sun</name> + <title>Sun MicroSystems</title> + <vendor>Sun MicroSystems, Inc.</vendor> + <includes> + <include>javax.help:javahelp</include> + </includes> + </jnlpExtension> + <jnlpExtension> + <name>jxlayer</name> + <title>Swing labs JXLayer </title> + <vendor>Swing Labs</vendor> + <includes> + <include>org.swinglabs:jxlayer</include> + </includes> + </jnlpExtension> + </jnlpExtensions> + </configuration> + </plugin> + + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <configuration> + <copyToMETA_INF>true</copyToMETA_INF> + </configuration> + <executions> + <execution> + <id>attach-licenses</id> + <goals> + <goal>add-license</goal> + <goal>add-third-party</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + + </pluginManagement> + + <plugins> + + <plugin> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>maven-jaxx-plugin</artifactId> + <version>${project.version}</version> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <configuration> + <entries> + <entry> + <basedir>${maven.gen.dir}/java/</basedir> + </entry> + </entries> + </configuration> + <executions> + <execution> + <goals> + <goal>parserJava</goal> + <goal>bundle</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</groupId> + <artifactId>maven-helper-plugin</artifactId> + <executions> + <execution> + <id>attach-licenses</id> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.nuiton.thirdparty</groupId> + <artifactId>webstart-maven-plugin</artifactId> + <version>1.0-alpha-2-cl_20091001</version> + </plugin> + </plugins> + </reporting> + + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> + + <profiles> + <!-- by default jnlp is only perform on a release stage when using the maven-release-plugin --> + <profile> + <id>release-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <!-- key store secrets availables --> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <executions> + <execution> + <id>get-jnlp-keystore</id> + <goals> + <goal>share-server-secret</goal> + </goals> + <phase>package</phase> + <configuration> + <serverId>codelutin-keystore</serverId> + <usernameOut>keystorepath</usernameOut> + <passwordOut>keystorepass</passwordOut> + </configuration> + </execution> + <execution> + <id>get-jnlp-key</id> + <goals> + <goal>share-server-secret</goal> + </goals> + <phase>package</phase> + <configuration> + <serverId>codelutin-keystore-nuiton-key</serverId> + <usernameOut>keyalias</usernameOut> + <passwordOut>keypass</passwordOut> + </configuration> + </execution> + </executions> + </plugin> + + <!-- make webstart --> + <plugin> + <groupId>org.nuiton.thirdparty</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> + + </profiles> + +</project> Added: trunk/jaxx-demo/src/main/filters/jaxx-demo.properties =================================================================== --- trunk/jaxx-demo/src/main/filters/jaxx-demo.properties (rev 0) +++ trunk/jaxx-demo/src/main/filters/jaxx-demo.properties 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,7 @@ +application.name=${project.name} +application.version=${project.version} +application.site.url=http://maven-site.nuiton.org/jaxx/jaxx-example +#licence.name=${project.licenses[0].license.name} +#licence.url=${project.licenses.0.url} +application.organisation.name=${project.organization.name} +application.organisation.url=${project.organization.url} Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,189 @@ +package jaxx.demo; + +import java.io.IOException; +import java.io.InputStream; +import java.beans.PropertyChangeListener; +import java.util.Locale; +import java.util.Properties; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.nuiton.util.Version; +import org.nuiton.util.VersionUtil; +import static org.nuiton.i18n.I18n._; + +/** + * La configuration de l'application. + * + * Il s'agit de l'objet partagé par toutes les démos. + * + * @author chemit + * @since 1.7.2 + */ +public class DemoConfig extends org.nuiton.util.ApplicationConfig { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(DemoConfig.class); + /** + * le fichier de configuration de l'application avec les informations sur + * le projet (version, license,...) et la configuration des ui (icons, ...) + */ + public static final String APPLICATION_PROPERTIES = "/jaxx-demo.properties"; + /** + * un drapeau pour savoir si on est en mode pleine écran + */ + protected boolean fullscreen; + + public DemoConfig() { + + setConfigFileName(Option.CONFIG_FILE.defaultValue); + + // chargement de la configuration interne + + InputStream stream = getClass().getResourceAsStream(APPLICATION_PROPERTIES); + + Properties p = new Properties(); + try { + p.load(stream); + for (Object k : p.keySet()) { + String key = k + ""; + Object value = p.get(k); + if (log.isDebugEnabled()) { + log.debug("install properties " + k + " : " + value); + } + setDefaultOption(key, "" + value); + } + } catch (IOException ex) { + throw new RuntimeException(ex); + } + + for (Option o : Option.values()) { + setDefaultOption(o.key, o.defaultValue); + } + + // on supprime le stamp de snapshot s'il existe + String sVersion = VersionUtil.removeSnapshot(getOption("application.version")); + Version version = VersionUtil.valueOf(sVersion); + setDefaultOption("version", version.getVersion()); + } + + public String getCopyrightText() { + return "Version " + getVersion() + " Codelutin @ 2008-2009"; + } + + /** + * @return la version de l'application. + */ + public Version getVersion() { + Version option = getOption(Version.class, "version"); + return option; + } + + public boolean isFullScreen() { + Boolean result = getOptionAsBoolean(Option.FULL_SCREEN.key); + return result != null && result; + } + + public Locale getLocale() { + Locale result = getOption(Locale.class, Option.LOCALE.key); + return result; + } + + public void setFullscreen(boolean fullscreen) { + Object oldValue = null; + setOption(Option.FULL_SCREEN.key, fullscreen + ""); + saveForUser(); + firePropertyChange("fullscreen", oldValue, fullscreen); + } + + public void setLocale(Locale newLocale) { + setOption(Option.LOCALE.key, newLocale.toString()); + saveForUser(); + firePropertyChange("locale", null, newLocale); + } + + /** + * Save configuration, in user home directory using the + * {@link #getConfigFileName}. Default, env and commande line note saved + */ + public void saveForUser() { + // shoudl we never save any conf ? + super.saveForUser(); + } + public static final String[] DEFAULT_JAXX_PCS = { + "fullScreen", "locale" + }; + + public void removeJaxxPropertyChangeListener() { + PropertyChangeListener[] toRemove = jaxx.runtime.Util.findJaxxPropertyChangeListener(DEFAULT_JAXX_PCS, getPropertyChangeListeners()); + if (toRemove == null || toRemove.length == 0) { + return; + } + if (log.isDebugEnabled()) { + log.debug("before remove : " + getPropertyChangeListeners().length); + log.debug("toRemove : " + toRemove.length); + } + for (PropertyChangeListener listener : toRemove) { + removePropertyChangeListener(listener); + } + if (log.isDebugEnabled()) { + log.debug("after remove : " + getPropertyChangeListeners().length); + } + } + + ////////////////////////////////////////////////// + // Toutes les options disponibles + ////////////////////////////////////////////////// + public static enum Option implements OptionDef { + + CONFIG_FILE(CONFIG_FILE_NAME, _("jaxxdemo.config.configFileName.description"), "jaxxdemo", String.class, true, true), + FULL_SCREEN("ui.fullscreen", _("jaxxdemo.config.ui.fullscreen"), "false", Boolean.class, false, false), + LOCALE("ui.locale", _("jaxxdemo.config.ui.locale"), Locale.FRANCE.toString(), Locale.class, false, false); + public final String key; + public final String description; + public final String defaultValue; + public final Class<?> type; + public final boolean _transient; + public final boolean _final; + + private Option(String key, String description, String defaultValue, Class<?> type, boolean _transient, boolean _final) { + this.key = key; + this.description = description; + this.defaultValue = defaultValue; + this.type = type; + this._final = _final; + this._transient = _transient; + } + + @Override + public boolean isFinal() { + return _final; + } + + @Override + public boolean isTransient() { + return _transient; + } + + @Override + public String getDefaultValue() { + return defaultValue; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public String getKey() { + return key; + } + + @Override + public Class<?> getType() { + return type; + } + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoPanel.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,73 @@ +<JTabbedPane id='top'> + + <script><![CDATA[ + import java.io.*; + + public DemoPanel(String... extraSources) { + super(); + + for (String extra : extraSources) { + // creation du contenu du fichier + JTextArea content = new JTextArea(); + content.setEditable(false); + content.setText(loadSource(extra)); + // ajout de l'onglet + top.addTab(extra,null,content,null); + } + } + + public String getLabel() { + String name = getClass().getName(); + name = name.substring(name.lastIndexOf(".") + 1); + if (name.endsWith("Demo")) + name = name.substring(0, name.length() - "Demo".length()); + return name; + } + + + public String getDemoTabTitle() { + return getLabel() + " Demo"; + } + + public String loadSource(String filename) { + try { + Reader in = new InputStreamReader(getClass().getResourceAsStream(filename)); + StringWriter out = new StringWriter(); + char[] buffer = new char[2048]; + int c; + while ((c = in.read(buffer)) > 0) + out.write(buffer, 0, c); + return out.toString(); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + + public String loadSource() { + try { + String className = getClass().getName(); + Reader in = new InputStreamReader(getClass().getResourceAsStream(className.substring(className.lastIndexOf(".") + 1) + ".jaxx")); + StringWriter out = new StringWriter(); + char[] buffer = new char[2048]; + int c; + while ((c = in.read(buffer)) > 0) + out.write(buffer, 0, c); + return out.toString(); + } + catch (IOException e) { + throw new RuntimeException(e); + } + } + ]]></script> + + <tab title='{getDemoTabTitle()}'> + <JPanel id='demoPanel'/> + </tab> + + <!--tab title='Source'> + <JScrollPane height='100'> + <JTextArea text='{loadSource()}' editable='false'/> + </JScrollPane> + </tab--> +</JTabbedPane> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,205 @@ +package jaxx.demo; + +import java.util.Stack; +import javax.swing.JPanel; +import jaxx.demo.component.swing.*; +import jaxx.demo.component.jaxx.*; +import jaxx.demo.component.jaxx.editor.*; +import jaxx.demo.component.jaxx.navigation.full.FullNavigationTreeDemo; +import jaxx.demo.component.jaxx.navigation.item.ItemTreeNavigationDemo; +import jaxx.demo.feature.databinding.BeanDataBindingDemo; +import jaxx.demo.feature.validation.*; +import jaxx.demo.fun.*; + +import static org.nuiton.i18n.I18n.n_; + +import jaxx.runtime.JAXXContext; +import jaxx.runtime.JAXXContextEntryDef; +import jaxx.runtime.JAXXObject; +import jaxx.runtime.swing.CardLayout2; +import jaxx.runtime.swing.ErrorDialogUI; +import jaxx.runtime.swing.navigation.NavigationTreeModel; +import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode; +import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder; +import jaxx.runtime.swing.navigation.NavigationTreeHandler; +import jaxx.runtime.swing.navigation.NavigationTreeHandler.Strategy; +import jaxx.runtime.swing.navigation.NavigationTreeHandlerWithCardLayout; +import jaxx.runtime.swing.navigation.NavigationTreeHelper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author chemit + */ +public class DemoTreeHelper extends NavigationTreeHelper { + + static private final Log log = LogFactory.getLog(DemoTreeHelper.class); + + public DemoTreeHelper() { + super("demo"); + } + + @Override + public NavigationTreeModel createTreeModel(JAXXContext context) { + + if (log.isDebugEnabled()) { + log.debug("start creating demo model"); + } + + TreeModelBuilder builder = new TreeModelBuilder(); + + builder.addText(n_("jaxxdemo.tree.component.swing")). + addText(n_("jaxxdemo.tree.component.swing.buttons")). + addDemo(JButtonDemo.class). + addDemo(JCheckBoxDemo.class). + addDemo(JRadioButtonDemo.class). + addDemo(JToggleButtonDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.component.swing.form")). + addText(n_("jaxxdemo.tree.component.swing.form.text")). + addDemo(JPasswordFieldDemo.class). + addDemo(JTextFieldDemo.class). + addDemo(JTextAreaDemo.class). + goUp(). + addDemo(JComboBoxDemo.class). + addDemo(JListDemo.class). + addDemo(JSliderDemo.class). + addDemo(JSpinnerDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.component.swing.layout")). + addDemo(JSplitPaneDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.component.swing.menu")). + addDemo(JMenuItemDemo.class). + addDemo(JCheckBoxMenuItemDemo.class). + addDemo(JRadioButtonMenuItemDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.component.swing.window")). + addDemo(JDialogDemo.class). + goUp(). + addDemo(JProgressBarDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.component.jaxx")). + addText(n_("jaxxdemo.tree.component.jaxx.editor")). + addDemo(NumberEditorDemo.class). + addDemo(ComboEditorDemo.class). + addDemo(I18nEditorDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.component.jaxx.tree.navigation")). + addDemo(ItemTreeNavigationDemo.class). + addDemo(FullNavigationTreeDemo.class). + goUp(). + addDemo(BoxedDecoratorDemo.class). + addDemo(StatusMessagePanelDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.feature")). + addText(n_("jaxxdemo.tree.features.databinding")). + addDemo(BeanDataBindingDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.features.validation")). + addDemo(ValidationListDemo.class). + addDemo(ValidationTableDemo.class). + goUp(). + addText(n_("jaxxdemo.tree.fun")). + addDemo(LabelStyleDemo.class). + addDemo(CounterDemo.class). + addDemo(CalculatorDemo.class); + + NavigationTreeModel model = builder.getModel(); + + if (log.isDebugEnabled()) { + builder.printModel(context, model.getRoot()); + } + // save tree model in context + setTreeModel(context, model); + return model; + } + + @Override + public NavigationTreeHandler createTreeHandler(JAXXObject context) { + + NavigationTreeHandler handler = new NavigationTreeHandlerWithCardLayout( + getPrefix(), + DemoPanel.class, + null, + context, + Strategy.PER_UI_TYPE) { + + private static final long serialVersionUID = 1L; + + @Override + protected NavigationTreeModel getNavigationTreeModel() { + return getTreeModel(getContext()); + } + + @Override + protected JPanel getContentContainer() { + return getContext().getContent(); + } + + @Override + protected CardLayout2 getContentLayout() { + return getContext().getContentLayout(); + } + + @Override + protected void treateError(Exception e) { + ErrorDialogUI.showError(e); + } + + protected DemoUI getContext() { + return (DemoUI) context; + } + }; + // on ne peut selectionner qu'un seul noeud a la fois + handler.setSelectionMode(NavigationTreeHandler.SINGLE_TREE_SELECTION); + + // save handler in ui context + setTreeHandler(context, handler); + return handler; + } + + static class TreeModelBuilder extends NavigationTreeModelBuilder { + + /** + * la definition de l'unqiue object a partage + */ + static private final JAXXContextEntryDef<DemoConfig> def = JAXXContextEntryDef.newDef(DemoConfig.class); + /** + * la pile des noeuds parent + */ + protected Stack<NavigationTreeNode> parentNodes; + + protected TreeModelBuilder() { + super("/"); + parentNodes = new Stack<NavigationTreeNode>(); + parentNodes.add(buildEmptyRoot(def, "$root")); + } + + protected TreeModelBuilder goUp() { + parentNodes.pop(); + return this; + } + + protected TreeModelBuilder addText(String label) { + NavigationTreeNode parentNode = parentNodes.peek(); + parentNode = build(parentNode, label, def, label, null, null); + if (log.isDebugEnabled()) { + log.debug(label + " [" + parentNode.getContextPath() + "]"); + } + parentNodes.push(parentNode); + return this; + } + + protected TreeModelBuilder addDemo(Class<? extends DemoPanel> demoClass) { + NavigationTreeNode parentNode = parentNodes.peek(); + String label = demoClass.getSimpleName(); + if (log.isDebugEnabled()) { + log.debug(label + " [" + parentNode.getContextPath() + "]"); + } + build(parentNode, label, def, label, demoClass, null); + return this; + } + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoTreeHelper.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.css 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,164 @@ +/** + * *##% observe-swing + * Copyright (C) 2008 - 2009 IRD + * + * 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 Lesser 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>. ##%* + */ +JToolBar { + borderPainted:false; + floatable:false; + opaque:false; +} + +JSplitPane { + oneTouchExpandable:true; + continuousLayout:true; + dividerSize:6; +} + +#menu { + _help:{"ui.main.menu"}; +} + +#menuFile { + text:"jaxxdemo.menu.file"; + mnemonic:F; + _help:{"ui.main.menu.file"}; +} + +#menuFileConfiguration { + text:"jaxxdemo.action.configuration"; + toolTipText:"jaxxdemo.action.configuration.tip"; + actionIcon:"config"; + mnemonic:C; + enabled:false; + _help:{"ui.main.menu.file.configuration"}; +} + +#menuFileLanguage { + text:"jaxxdemo.menu.file.locale"; + toolTipText:"jaxxdemo.menu.file.locale"; + actionIcon:"translate"; + mnemonic:C; + _help:{"ui.main.menu.file.locale"}; +} + + +#menuFileLanguageFR { + text:"jaxxdemo.action.locale.fr"; + toolTipText:"jaxxdemo.action.locale.fr.tip"; + actionIcon:"i18n-fr"; + enabled:{!acceptLocale(getConfig().getLocale(), "fr_FR")}; + mnemonic:F; + _help:{"ui.main.menu.file.locale.fr"}; +} + +#menuFileLanguageUK { + text:"jaxxdemo.action.locale.uk"; + toolTipText:"jaxxdemo.action.locale.uk.tip"; + actionIcon:"i18n-uk"; + enabled:{!acceptLocale(getConfig().getLocale(), "en_GB")}; + mnemonic:U; + _help:{"ui.main.menu.file.locale.uk"}; +} + +#menuFileFullscreen { + text:"jaxxdemo.action.fullscreen"; + toolTipText:"jaxxdemo.action.fullscreen.tip"; + actionIcon:"fullscreen"; + mnemonic:P; + visible:{!isUndecorated()}; + _help:{"ui.main.menu.file.fullscreen"}; +} + +#menuFileNormalscreen { + text:"jaxxdemo.action.normalscreen"; + toolTipText:"jaxxdemo.action.normalscreen.tip"; + actionIcon:"leave-fullscreen"; + mnemonic:N; + visible:{isUndecorated()}; + _help:{"ui.main.menu.file.leave-fullscreen"}; +} + +#menuFileExit{ + text:"jaxxdemo.action.exit"; + toolTipText:"jaxxdemo.action.exit.tip"; + actionIcon:"exit"; + mnemonic:X; + _help:{"ui.main.menu.file.exit"}; +} + +#menuHelp{ + text:"jaxxdemo.menu.help"; + mnemonic:e; + _help:{"ui.main.menu.help"}; +} + +#menuHelpHelp{ + text:"jaxxdemo.action.help"; + toolTipText:"jaxxdemo.action.help.tip"; + actionIcon:"help"; + mnemonic:e; + _help:{"ui.main.menu.help.help"}; +} + +#menuHelpSite{ + text:"jaxxdemo.action.site"; + toolTipText:"jaxxdemo.action.site.tip"; + actionIcon:"site"; + mnemonic:s; + _help:{"ui.main.menu.help.site"}; +} + +#menuHelpAbout{ + text:"jaxxdemo.action.about"; + toolTipText:"jaxxdemo.action.about.tip"; + actionIcon:"about"; + mnemonic:A; + _help:{"ui.main.menu.help.about"}; +} + +#showHelp{ + toolTipText:"jaxxdemo.action.showHelp.tip"; + actionIcon:"show-help"; + borderPainted:false; + visible:true; +} + +#navigation{ + rootVisible:false; + largeModel:true; + font-size:11; +} +/* +#splitpane{ + orientation:{JSplitPane.HORIZONTAL_SPLIT}; + _help:{"ui.main.body.db"}; + resizeWeight:1.0; +}*/ + +#contentLayout{ + useOnlyVisibleComponentDimension:true; +} + +#content{ + layout:{contentLayout}; + _help:{"ui.main.body.db.view.content"}; +} +/* +#toolbar { + layout:{new BoxLayout(toolbar, 0)}; + _help:{"ui.main.toolbar"}; +}*/ Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUI.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,82 @@ + +<JFrame id='mainFrame' + title="JAXX Demo" + width='1024' + height='800' + decorator='help' + undecorated='{getConfig().isFullScreen()}' + onWindowClosing='getHandler().close(mainFrame)'> + + <style source='DemoUI.css'/> + + <jaxx.runtime.swing.CardLayout2 id='contentLayout'/> + + <script><![CDATA[ +import jaxx.runtime.swing.navigation.*; +import java.util.Locale; + +public DemoConfig getConfig() { + return getContextValue(DemoConfig.class); +} + +protected DemoUIHandler getHandler() { + return getContextValue(DemoUIHandler.class); +} + +protected DemoTreeHelper getTreeHelper() { + return getContextValue(DemoTreeHelper.class); +} + +public boolean acceptLocale(Locale l, String expected) { + return l !=null && l.toString().equals(expected); +} + +]]> + </script> + + <JMenuBar id='menu'> + + <JMenu id='menuFile'> + <JMenuItem id='menuFileConfiguration' + onActionPerformed="getHandler().showConfig(this)"/> + <JMenu id='menuFileLanguage'> + <JMenuItem id='menuFileLanguageFR' + onActionPerformed="getHandler().changeLanguage(this, Locale.FRANCE)"/> + <JMenuItem id='menuFileLanguageUK' + onActionPerformed="getHandler().changeLanguage(this, Locale.UK)"/> + </JMenu> + <JSeparator/> + <JMenuItem id='menuFileFullscreen' + onActionPerformed="getHandler().changeScreen(this, true)"/> + <JMenuItem id='menuFileNormalscreen' + onActionPerformed="getHandler().changeScreen(this, false)"/> + <JSeparator/> + <JMenuItem id='menuFileExit' + onActionPerformed="getHandler().close(this)"/> + </JMenu> + + <JMenu id='menuHelp'> + <JMenuItem id='menuHelpHelp' + onActionPerformed="getHandler().showHelp(this, null)"/> + <JMenuItem id='menuHelpSite' + onActionPerformed="getHandler().gotoSite(this)"/> + <JMenuItem id='menuHelpAbout' + onActionPerformed="getHandler().showAbout(this)"/> + </JMenu> + + </JMenuBar> + + <JSplitPane id='splitPane'> + <JScrollPane border='{null}'> + <JTree id='navigation' + model='{getTreeHelper().createTreeModel(this)}' + selectionModel="{getTreeHelper().createTreeHandler(this)}" + cellRenderer='{new NavigationTreeCellRenderer(this, 200)}'> + </JTree> + <!--model='{DemoTreeHelper.TREE_MODEL.getContextValue(this)}'--> + </JScrollPane> + + <JPanel id='content'/> + + </JSplitPane> +</JFrame> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,292 @@ +/** + * *##% observe-swing + * Copyright (C) 2008 - 2009 IRD + * + * 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 Lesser 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>. ##%* + */ +package jaxx.demo; + +import jaxx.runtime.swing.ErrorDialogUI; +import jaxx.runtime.JAXXContext; +import jaxx.runtime.JAXXInitialContext; +import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; + +import java.awt.Desktop; +import java.net.URL; +import java.util.Locale; +import javax.swing.SwingUtilities; +import jaxx.runtime.DefaultApplicationContext; +import jaxx.runtime.JAXXContextEntryDef; +import jaxx.runtime.swing.AboutPanel; +import jaxx.runtime.swing.editor.config.ConfigUI; +import jaxx.runtime.swing.editor.config.ConfigUIBuilder; +import jaxx.runtime.swing.editor.config.model.ConfigUIModel; +import org.nuiton.i18n.I18n; + +/** + * Le handler de l'ui principale. + * + * @author chemit + * @see DemoUI + */ +public class DemoUIHandler { //implements JAXXHelp { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(DemoUIHandler.class); + static final JAXXContextEntryDef<DemoUI> MAIN_UI_ENTRY_DEF = JAXXContextEntryDef.newDef("mainui", DemoUI.class); + + /** + * Methode pour initialiser l'ui principale sans l'afficher. + * + * @param rootContext le context applicatif + * @param fullscreen flag pour indiquer si on doit ouvrir l'ui en model console (pleine ecran). + * @return l'ui instancie et initialisee mais non visible encore + */ + public DemoUI initUI(DefaultApplicationContext rootContext, boolean fullscreen) { + + if (log.isDebugEnabled()) { + log.debug("fullscreen ? " + fullscreen); + } + + // create restrict context for ui + JAXXInitialContext context = new JAXXInitialContext(); + + // share handler + context.add(this); + + // share tree helper + context.add(rootContext.getContextValue(DemoTreeHelper.class)); + + // share config + context.add(rootContext.getContextValue(DemoConfig.class)); + + // instanciate ui + DemoUI ui = new DemoUI(context); + + // keep it in root context + MAIN_UI_ENTRY_DEF.setContextValue(rootContext, ui); + + // synch to error dialog + ErrorDialogUI.init(ui); + + // set fullscreen propery on main ui + ui.getGraphicsConfiguration().getDevice().setFullScreenWindow(fullscreen ? ui : null); + + return ui; + } + + public void displayUI(final DemoUI ui, final NavigationTreeNode node) { + + // expend all nodes of the demo tree + jaxx.runtime.SwingUtil.expandTree(ui.getNavigation()); + + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + // use best dimensions + ui.getSplitPane().resetToPreferredSizes(); + + String path; + if (node == null) { + // take first node + path = "$root/jaxxdemo.tree.component.swing"; + } else { + // take selected node + path = node.getContextPath(); + } + // select node + ui.getTreeHelper().selectNode(ui, ui.getNavigation(), path); + + // show ui + ui.setVisible(true); + } + }); + } + + /** + * Permet de recharger l'ui principale et de changer de le mode d'affichage. + * + * @param rootContext le contexte applicatif + * @param fullscreen le type de fenetre à reouvrir + */ + public void reloadUI(DefaultApplicationContext rootContext, boolean fullscreen) { + + // scan main ui + DemoUI ui = getUI(rootContext); + + NavigationTreeNode node = null; + + if (ui != null) { + + ui.getConfig().removeJaxxPropertyChangeListener(); + + node = ui.getTreeHelper().getSelectedNode(ui); + + if (node != null) { + log.info("selected node " + node.getContextPath()); + } + + ErrorDialogUI.init(null); + + ui.dispose(); + + ui.setVisible(false); + + MAIN_UI_ENTRY_DEF.removeContextValue(rootContext); + + } + + ui = initUI(rootContext, fullscreen); + + displayUI(ui, node); + } + + /** + * Méthode pour changer de mode d'affichage. + * <p/> + * Si <code>fullscreen</code> est à <code>true</code> alors on passe en + * mode console (c'est à dire en mode plein écran exclusif), sinon on + * passe en mode fenetré normal. + * + * @param context l'ui principale de l'application + * @param fullscreen le nouvel état requis. + */ + public void changeScreen(JAXXContext context, final boolean fullscreen) { + + DemoUI ui = getUI(context); + + // sauvegarde de l'état dans la configuration + ui.getConfig().setFullscreen(fullscreen); + + // rechargement de l'ui + reloadUI(RunDemo.get(), fullscreen); + } + + public void changeLanguage(JAXXContext context, Locale newLocale) { + + DemoUI ui = getUI(context); + + DemoConfig config = ui.getConfig(); + + // sauvegarde de la nouvelle locale + config.setLocale(newLocale); + + // chargement de la nouvelle locale dans le système i18n + I18n.init(newLocale); + + // rechargement de l'ui + reloadUI(RunDemo.get(), config.isFullScreen()); + } + + /** + * Ferme l'application. + * + * @param context l'ui principale de l'application + */ + public void close(JAXXContext context) { + log.info("JAXX Demo quitting..."); + try { + + DemoUI ui = getUI(context); + ui.dispose(); + } finally { + System.exit(0); + } + } + + public void showConfig(JAXXContext context) { + DemoUI ui = getUI(context); + DemoConfig config = ui.getConfig(); + ConfigUIModel model = new ConfigUIModel(config); + + // categorie repertoires + model.addCategory( + n_("jaxxdemo.config.category.directories"), + n_("jaxxdemo.config.category.directories.description"), + DemoConfig.Option.CONFIG_FILE); + + // others + model.addCategory( + n_("jaxxdemo.config.category.other"), + n_("jaxxdemo.config.category.other.description"), + DemoConfig.Option.FULL_SCREEN, + DemoConfig.Option.LOCALE); + + ConfigUI configUI = ConfigUIBuilder.newConfigUI(context, model, "jaxxdemo.config.category.directories"); + + ConfigUIBuilder.showConfigUI(configUI, ui, false); + } + +// @Override + public void showHelp(JAXXContext context, String helpId) { +// DemoUI mainUI = getUI(context); +// ObserveHelpBroker helpBroker = context.getContextValue(ObserveHelpBroker.class); +// +// if (helpId == null) { +// helpId = helpBroker.getDefaultID(); +// } +// log.debug("show help " + helpId); +// mainUI.getHelp().setCurrentID(helpId); + } + + public void gotoSite(JAXXContext context) { + + DemoUI ui = getUI(context); + DemoConfig config = ui.getConfig(); + + URL siteURL = config.getOptionAsURL("application.site.url"); + + log.info(_("jaxxdemo.message.goto.site", siteURL)); + + if (log.isDebugEnabled()) { + log.debug("goto " + siteURL); + } + if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { + try { + Desktop.getDesktop().browse(siteURL.toURI()); + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + ErrorDialogUI.showError(ex); + } + } + } + + public void showAbout(DemoUI ui) { + + AboutPanel about = new AboutPanel(); + + about.setTitle(_("jaxxdemo.title.about")); + about.setIconPath("/icons/jaxx.png"); + about.setAboutText(_("jaxxdemo.about.message")); + about.setBottomText(ui.getConfig().getCopyrightText()); + about.setLicenseFile("META-INF/jaxx-example-LICENSE.txt"); + about.setThirdpartyFile("META-INF/jaxx-example-THIRD-PARTY.txt"); + about.init(); + about.showInDialog(ui, true); + } + + DemoUI getUI(JAXXContext context) { + if (context instanceof DemoUI) { + return (DemoUI) context; + } + DemoUI ui = MAIN_UI_ENTRY_DEF.getContextValue(context); + return ui; + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,171 @@ +package jaxx.demo; + +import jaxx.runtime.DefaultApplicationContext; +import jaxx.runtime.swing.ErrorDialogUI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.i18n.I18n; +import static org.nuiton.i18n.I18n._; +import org.nuiton.util.StringUtil; + +import jaxx.runtime.SwingUtil; + +/** + * + * @author chemit + */ +public class RunDemo { + + /** + * Logger + */ + private static Log log = LogFactory.getLog(RunDemo.class); + /** + * When application was started + */ + private static long startingTime = System.nanoTime(); + /** + * The singleton instance of the main context + */ + protected static DefaultApplicationContext context; + + public static void main(String[] args) { + + startingTime = System.nanoTime(); + log.info("Observe start at " + new java.util.Date() + " args: " + java.util.Arrays.toString(args)); + + try { + + // init root context + // to enable javassist on webstart, must remove any securityManager, + // see if this can be dangerous (should not be since jnlp is signed ?) + // moreover it speeds up the loading :) + System.setSecurityManager(null); + + long t0 = System.nanoTime(); + + I18n.setUniqueBundleName("jaxx-demo-i18n"); + + Runtime.getRuntime().addShutdownHook(new ShutdownHook()); + + // init root context + DefaultApplicationContext rootContext = init(); + + // share a tree helper + rootContext.setContextValue(new DemoTreeHelper()); + + // init config + DemoConfig config = new DemoConfig(); + config.parse(args); + + // share the config + rootContext.setContextValue(config); + + long t00 = System.nanoTime(); + + // init i18n + I18n.init(config.getLocale()); + + log.info("language : " + config.getLocale()); + + if (log.isDebugEnabled()) { + log.debug("i18n loading time : " + (StringUtil.convertTime(t00, System.nanoTime()))); + } + + log.info(_("jaxxdemo.message.config.loaded", config.getVersion())); + + // prepare ui look&feel and load ui properties + + try { + SwingUtil.initNimbusLoookAndFeel(); + } catch (Exception e) { + // could not find nimbus look-and-feel + log.warn(_("jaxxdemo.warning.nimbus.landf")); + } catch (Throwable e) { + log.warn(_("jaxxdemo.warning.no.ui")); + + } + + if (log.isDebugEnabled()) { + log.debug("init done in " + (StringUtil.convertTime(t0, System.nanoTime()))); + } + + log.info(_("jaxxdemo.init.context.done", StringUtil.convertTime(startingTime, System.nanoTime()))); + + // on affiche l'ui principale + DemoUIHandler handler = new DemoUIHandler(); + + DemoUI ui = handler.initUI(rootContext, config.isFullScreen()); + + log.info(_("jaxxdemo.init.ui.done")); + + handler.displayUI(ui, null); + + } catch (Exception e) { + ErrorDialogUI.showError(e); + log.error(e.getMessage(), e); + System.exit(1); + } + } + + /** + * @return <code>true</code> si le context a été initialisé via la méthode + * {@link #init()}, <ocde>false</code> autrement. + */ + protected static boolean isInit() { + return context != null; + } + + /** + * Permet l'initialisation du contexte applicatif et positionne + * l'context partagée. + * <p/> + * Note : Cette méthode ne peut être appelée qu'une seule fois. + * @return l'context partagée + * @throws IllegalStateException si un contexte applicatif a déja été positionné. + */ + protected static synchronized DefaultApplicationContext init() throws IllegalStateException { + if (isInit()) { + throw new IllegalStateException("there is an already application context registred."); + } + context = new DefaultApplicationContext(); + return context; + } + + /** + * Récupération du contexte applicatif. + * + * @return l'context partagé du contexte. + * @throws IllegalStateException si le contexte n'a pas été initialisé via + * la méthode {@link #init()} + */ + protected static DefaultApplicationContext get() throws IllegalStateException { + if (!isInit()) { + throw new IllegalStateException("no application context registred."); + } + return context; + } + + protected static class ShutdownHook extends Thread { + + public ShutdownHook() { + super("shutdown JAXXDemo"); + } + + @Override + public void run() { + try { + super.run(); + + //JAXXContext.get().close(); + // force to kill main thread + + log.info(_("jaxxdemo.init.closed", new java.util.Date())); + Runtime.getRuntime().halt(0); + } catch (Exception ex) { + log.error("error while closing " + ex.getMessage(), ex); + Runtime.getRuntime().halt(1); + } + } + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/BoxedDecoratorDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,91 @@ + +<jaxx.demo.DemoPanel> + <jaxx.runtime.swing.BlockingLayerUI id='layerUI' + blockIcon='{SwingUtil.createImageIcon("action-block.png")}' + acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' + useIcon='true' + blockingColor='{new Color(50,50,50)}' + acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; + @Override + public void actionPerformed(ActionEvent e) { + accept(e, "from icon of layer"); + } + }}' /> + <jaxx.runtime.swing.BlockingLayerUI2 id='layerUI2' + blockIcon='{SwingUtil.createImageIcon("action-block.png")}' + acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' + acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; + @Override + public void actionPerformed(ActionEvent e) { + accept(e, "from icon of layer"); + } + }}' /> + <script><![CDATA[ +import jaxx.runtime.SwingUtil; + +void $afterCompleteSetup() { + for (JComponent boxed : SwingUtil.getLayeredComponents(this)) { + if (boxed == d) { + SwingUtil.getLayer(boxed).setUI(layerUI2); + continue; + } + + jaxx.runtime.swing.BlockingLayerUI ui = layerUI.clone(); + if ( boxed == c) { + ui.setBlock(true); + } + SwingUtil.getLayer(boxed).setUI(ui); + } +} + +public void setLayer(boolean active) { + for (JComponent boxed : SwingUtil.getLayeredComponents(this)) { + if (boxed == d) { + continue; + } + jaxx.runtime.swing.BlockingLayerUI ui = (jaxx.runtime.swing.BlockingLayerUI)SwingUtil.getLayer(boxed).getUI(); + if ( boxed == c) { + ui.setBlock(active); + } + ui.setUseIcon(active); + } +} + +protected void accept(ActionEvent e, String suffix) { + JButton source = (JButton) e.getSource(); + String clickedMessage = (String) source.getClientProperty("clickedText"); + String msg = "'" + source.getText() + "' clicked - " + suffix + " : " + clickedMessage; + ((DefaultListModel)messages.getModel()).addElement(msg); +}]]> + </script> + <Table id='demoPanel' fill='both' weightx='1'> + <row> + <cell> + <JCheckBox id='toggle' selected='true' + text='{toggle.isSelected() ? "Active layer" : "No layer"}' + onActionPerformed='setLayer(toggle.isSelected());'/> + </cell> + </row> + <row> + <cell weighty='0.5'> + <JPanel layout='{new GridLayout(1,3,3,3)}'> + <JButton text='button A' decorator='boxed' _clickedText='"button A was clicked"' + onActionPerformed='accept(event, "from button (no layer)")'/> + <JButton text='button B' decorator='boxed' _clickedText='"button B was clicked"' + onActionPerformed='accept(event, "from button (no layer)")'/> + <JButton id='c' text='button C (full block)' decorator='boxed' _clickedText='"button C was clicked"' + onActionPerformed='accept(event, "from button (no layer)");'/> + <JButton id='d' text='button D (full block 2)' decorator='boxed' _clickedText='"button D was clicked"' + onActionPerformed='accept(event, "from button (no layer)");'/> + </JPanel> + </cell> + </row> + <row> + <cell weighty='0.5'> + <JScrollPane> + <JList id='messages' model='{new DefaultListModel()}'/> + </JScrollPane> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/StatusMessagePanelDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,11 @@ +<jaxx.demo.DemoPanel> + <JPanel id='demoPanel' layout='{new BorderLayout()}'> + <JPanel layout='{new GridLayout(0,1)}' constraints='BorderLayout.CENTER'> + <JButton text='Fool me once' + onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on you!")'/> + <JButton text='Fool me twice' + onActionPerformed='p.setStatus(((JButton)event.getSource()).getText() + " ? shame on ...")'/> + </JPanel> + <jaxx.runtime.swing.StatusMessagePanel id='p' constraints='BorderLayout.SOUTH'/> + </JPanel> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ComboEditorDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,35 @@ + +<jaxx.demo.DemoPanel> + <Table id='demoPanel' fill='both'> + <row> + <cell> + <JLabel text='Locale editor:' labelFor='{localeEditor}'/> + </cell> + + <cell> + <LocaleEditor id='localeEditor'/> + </cell> + </row> + <row> + <cell> + <JLabel text='EnumEditor (language) :' labelFor='{languageEditor}'/> + </cell> + <cell> + <EnumEditor id='languageEditor' constructorParams='org.nuiton.i18n.LanguageEnum.class'/> + </cell> + </row> + <row> + <cell> + <JLabel text='EnumEditor (country) :' labelFor='{countryEditor}'/> + </cell> + <cell> + <EnumEditor id='countryEditor' constructorParams='org.nuiton.i18n.CountryEnum.class'/> + </cell> + </row> + <row> + <cell columns="2"> + <JTextArea text='{"locale : "+ localeEditor.getSelectedItem() + "\nlanguage : "+ languageEditor.getSelectedItem() + "\ncountry : " + countryEditor.getSelectedItem()}'/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,46 @@ + +<jaxx.demo.DemoPanel> + <script><![CDATA[ +//localeEditor.loadI18nBundles(); +]]> + </script> + <Table id='demoPanel' fill='both'> + <row> + <cell> + <JLabel text='Empty I18n editor:' labelFor='{localeEmptyEditor}'/> + </cell> + <cell> + <jaxx.runtime.swing.editor.I18nEditor id='localeEmptyEditor' /> + </cell> + </row> + <row> + <cell> + <JLabel text='I18n editor:' labelFor='{localeEditor}'/> + </cell> + <cell> + <jaxx.runtime.swing.editor.I18nEditor id='localeEditor' + locales='{java.util.Arrays.asList(org.nuiton.i18n.I18n.getLoader().getLocales())}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='I18n editor with no text :' labelFor='{localeWithNoTextEditor}'/> + </cell> + <cell> + <jaxx.runtime.swing.editor.I18nEditor id='localeWithNoTextEditor' + locales='{java.util.Arrays.asList(org.nuiton.i18n.I18n.getLoader().getLocales())}' + showText='false'/> + </cell> + </row> + <row> + <cell> + <JLabel text='I18n editor with no icon :' labelFor='{localeWithNoIconEditor}'/> + </cell> + <cell> + <jaxx.runtime.swing.editor.I18nEditor id='localeWithNoIconEditor' + locales='{java.util.Arrays.asList(org.nuiton.i18n.I18n.getLoader().getLocales())}' + showIcon='false'/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,132 @@ + +<jaxx.demo.DemoPanel> + <script><![CDATA[ +import jaxx.runtime.swing.editor.NumberEditor; + +void $afterCompleteSetup() { + positifIntegerEditor.init(); + positifIntegerEditor2.init(); + normalIntegerEditor.init(); + normalIntegerEditor2.init(); + positifFloatEditor.init(); + positifFloatEditor2.init(); + normalFloatEditor.init(); + normalFloatEditor2.init(); +} +]]> + </script> + + <!-- model --> + <NumberEditorDemoModel id='demoModel'/> + + <Table id='demoPanel' insets='0' fill='both'> + <row> + <cell weightx='0.5'> + <JLabel horizontalAlignment='center' text='numbereditor.type'/> + </cell> + <cell weightx='0.25'> + <JLabel horizontalAlignment='center' text='numbereditor.without.auto.popup'/> + </cell> + <cell weightx='0.25'> + <JLabel horizontalAlignment='center' text='numbereditor.with.auto.popup'/> + </cell> + </row> + <row> + <cell> + <JLabel text='{_("numbereditor.positive.int", demoModel.getPositifInteger())}'/> + </cell> + <cell> + <NumberEditor id='positifIntegerEditor' + property='positifInteger' + constructorParams='this' + bean='{demoModel}' + autoPopup='false' + showPopupButton='true' + showReset='true'/> + </cell> + <cell> + <NumberEditor id='positifIntegerEditor2' + property='positifInteger' + constructorParams='this' + bean='{demoModel}' + autoPopup='true' + showPopupButton='true' + showReset='true'/> + </cell> + </row> + <row> + <cell> + <JLabel text='{_("numbereditor.normal.int", demoModel.getNormalInteger())}'/> + </cell> + <cell> + <NumberEditor id='normalIntegerEditor' + property='normalInteger' + constructorParams='this' + bean='{demoModel}' + autoPopup='false' + showPopupButton='true' + showReset='true' + useSign='true'/> + </cell> + <cell> + <NumberEditor id='normalIntegerEditor2' + property='normalInteger' + constructorParams='this' + bean='{demoModel}' + autoPopup='true' + showPopupButton='true' + showReset='true' + useSign='true'/> + </cell> + </row> + <row> + <cell> + <JLabel text='{_("numbereditor.positive.float", demoModel.getPositifFloat())}'/> + </cell> + <cell> + <NumberEditor id='positifFloatEditor' + property='positifFloat' + constructorParams='this' + bean='{demoModel}' + autoPopup='false' + showPopupButton='true' + showReset='true'/> + </cell> + <cell> + <NumberEditor id='positifFloatEditor2' + property='positifFloat' + constructorParams='this' + bean='{demoModel}' + autoPopup='true' + showPopupButton='true' + showReset='true'/> + </cell> + </row> + <row> + <cell> + <JLabel text='{_("numbereditor.normal.float", demoModel.getNormalFloat())}'/> + </cell> + <cell> + <NumberEditor id='normalFloatEditor' + property='normalFloat' + constructorParams='this' + bean='{demoModel}' + autoPopup='false' + showPopupButton='true' + showReset='true' + useSign='true'/> + </cell> + <cell> + <NumberEditor id='normalFloatEditor2' + property='normalFloat' + constructorParams='this' + bean='{demoModel}' + autoPopup='true' + showPopupButton='true' + showReset='true' + useSign='true'/> + </cell> + </row> + </Table> + +</jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,78 @@ +package jaxx.demo.component.jaxx.editor; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; + +/** + * + * @author chemit + * @since 1.5 + */ +public class NumberEditorDemoModel { + + protected PropertyChangeSupport p; + protected int positifInteger; + protected int normalInteger; + protected float positifFloat; + protected float normalFloat; + + public NumberEditorDemoModel() { + p = new PropertyChangeSupport(this); + } + + public float getNormalFloat() { + return normalFloat; + } + + public int getNormalInteger() { + return normalInteger; + } + + public float getPositifFloat() { + return positifFloat; + } + + public int getPositifInteger() { + return positifInteger; + } + + public void setNormalFloat(float normalFloat) { + float old = this.normalFloat; + this.normalFloat = normalFloat; + p.firePropertyChange("normalFloat", old, normalFloat); + } + + public void setNormalInteger(int normalInteger) { + int old = this.normalInteger; + this.normalInteger = normalInteger; + p.firePropertyChange("normalInteger", old, normalInteger); + } + + public void setPositifFloat(float positifFloat) { + float old = this.positifFloat; + this.positifFloat = positifFloat; + p.firePropertyChange("positifFloat", old, positifFloat); + } + + public void setPositifInteger(int positifInteger) { + int old = this.positifInteger; + this.positifInteger = positifInteger; + p.firePropertyChange("positifInteger", old, positifInteger); + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + p.addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.addPropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + p.removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.removePropertyChangeListener(propertyName, listener); + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemoModel.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/BaseContent.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/BaseContent.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/BaseContent.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,81 @@ + +<JPanel layout='{new BorderLayout()}'> + + <Object id='data' javaBean='helper.getSelectedBean(this)'/> + + <script><![CDATA[ +import jaxx.runtime.SwingUtil; +import jaxx.demo.component.jaxx.navigation.full.model.*; + +private final FullNavigationTreeHelper helper = new FullNavigationTreeHelper(); + +String getType(Object data) { + if (data == null) { + return "no type"; + } + if (data instanceof java.util.List<?>) { + java.util.List<?> l = (java.util.List<?>) data; + if (l.isEmpty()) { + return "Empty collection"; + } + return "Collection of " + l.size() + " " + l.get(0).getClass().getSimpleName() + "(s)"; + } + return data.getClass().getSimpleName(); +} + +String getContent(Object data) { + if (data == null) { + return "no content"; + } + StringBuilder buffer = new StringBuilder(); + if (data instanceof java.util.List) { + for (Object o : ((java.util.List)data)) { + buffer.append(o).append("\n"); + } + } else { + buffer.append(data); + } + return buffer.toString(); +} + +ImageIcon getImage(Object data) { + if (data == null) { + return null; + } + if (data instanceof Movie) { + return SwingUtil.createIcon(((Movie)data).getImage()); + } + if (data instanceof People) { + return SwingUtil.createIcon(((People)data).getImage()); + } + return null; +} + ]]> + </script> + + <JSplitPane id='splitPane' + orientation='{JSplitPane.VERTICAL_SPLIT}' + resizeWeight='0.5' + constraints='BorderLayout.CENTER' + oneTouchExpandable='true'> + + <JScrollPane border='{null}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'> + <JTextPane border='{new TitledBorder("Content Type : " + getType(getData()))}' + editable='false' + font-size='11' + text='{getContent(getData())}'/> + </JScrollPane> + + <JScrollPane border='{new TitledBorder("Picture")}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}' + minimumSize='{SwingUtil.newMinDimension()}'> + + <JLabel icon='{getImage(getData())}'/> + + </JScrollPane> + + </JSplitPane> +</JPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,54 @@ + +<jaxx.demo.DemoPanel> + + <jaxx.runtime.swing.CardLayout2 id='contentLayout' + useOnlyVisibleComponentDimension='true'/> + + <script><![CDATA[ +import jaxx.runtime.swing.navigation.NavigationTreeCellRenderer; + +private final FullNavigationTreeHelper helper = new FullNavigationTreeHelper(); + +setContextValue(helper.createMovies(this), " movies"); + +void $afterCompleteSetup() { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + navigation.setSelectionInterval(0, 0); + splitPane.resetToPreferredSizes(); + } + }); + jaxx.runtime.SwingUtil.expandTree(navigation); +} + ]]> + </script> + + <JPanel id='demoPanel' layout='{new BorderLayout()}'> + + <JSplitPane id='splitPane' + constraints='BorderLayout.CENTER' + oneTouchExpandable='true'> + + <JScrollPane border='{null}' + horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}' + verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_NEVER}'> + + <JTree id="navigation" + font-size='11' + rootVisible='false' + model='{helper.createTreeModel(this)}' + selectionModel="{helper.createTreeHandler(this)}" + cellRenderer='{new NavigationTreeCellRenderer(this, 150)}' /> + <!--model='{helper.createTreeModel(this, helper.createMovies())}'--> + + </JScrollPane> + + <JPanel id="content" layout="{contentLayout}" /> + + </JSplitPane> + + </JPanel> + +</jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeHelper.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeHelper.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeHelper.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,209 @@ +package jaxx.demo.component.jaxx.navigation.full; + +import java.util.ArrayList; +import java.util.HashSet; +import jaxx.demo.component.jaxx.navigation.full.model.Movie; +import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode; +import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder; + +import static jaxx.runtime.JAXXContextEntryDef.newListDef; +import static org.nuiton.i18n.I18n._; + +import java.util.List; +import java.util.Set; +import jaxx.demo.component.jaxx.navigation.full.model.People; +import jaxx.runtime.Decorator; +import jaxx.runtime.JAXXContext; +import jaxx.runtime.MultiJXPathDecorator; + + +import javax.swing.JPanel; +import jaxx.runtime.JAXXObject; +import jaxx.runtime.swing.CardLayout2; +import jaxx.runtime.swing.ErrorDialogUI; +import jaxx.runtime.swing.navigation.NavigationTreeHandler; +import jaxx.runtime.swing.navigation.NavigationTreeHandler.Strategy; +import jaxx.runtime.swing.navigation.NavigationTreeHandlerWithCardLayout; +import jaxx.runtime.swing.navigation.NavigationTreeHelper; +import jaxx.runtime.swing.navigation.NavigationTreeModel; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author chemit + */ +public class FullNavigationTreeHelper extends NavigationTreeHelper { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private final Log log = LogFactory.getLog(FullNavigationTreeHelper.class); + + public FullNavigationTreeHelper() { + super("full"); + } + + public java.util.List<Movie> createMovies(JAXXContext context) { + java.util.List<Movie> result = new java.util.ArrayList<Movie>(); + People a = new People("0", "Jack", "Black", 0, "/jaxx/demo/images/jack.jpg"); + People a2 = new People("1", "Héctor", "Jiménez", 0, "/jaxx/demo/images/hector.jpg"); + People a3 = new People("2", "Ana", "de la Reguera", 0, "/jaxx/demo/images/ana.jpg"); + + Movie m = new Movie("0", "Nacho libre", 1996, "/jaxx/demo/images/nacho.jpg"); + m.addActor(a); + m.addActor(a2); + m.addActor(a3); + result.add(m); + + m = new Movie("1", "Nacho 2", 2009, "/jaxx/demo/images/nacho2.png"); + m.addActor(a); + m.addActor(a2); + result.add(m); + + context.setContextValue(result, "movies"); + + return result; + } + + @Override + public NavigationTreeModel createTreeModel(JAXXContext context) { + + List<Movie> movies = context.getContextValue(List.class, "movies"); + + log.info("for " + movies.size() + " movie(s)"); + + NavigationTreeNode rootNode, moviesNode, movieNode, actorsNode; + + log.info("start creating demo model"); + + NavigationTreeModelBuilder builder = new NavigationTreeModelBuilder("/"); + + Decorator<Movie> movieDecorator = MultiJXPathDecorator.newDecorator(Movie.class, "${title}$s##${year}$s", "##", " - "); + Decorator<People> peopleDecorator = MultiJXPathDecorator.newDecorator(People.class, "${firstName}$s##${lastName}$s", "##", " "); + + Set<People> actors = new HashSet<People>(); + // construction du noeud root + // il ne contient pas de context et ne sera pas visible + rootNode = builder.buildEmptyRoot(null, "$root"); + + // construction du noeud avec les films recupere la liste des films + // dans le context avec la clef movies + // navigation path = $root/movies + moviesNode = builder.build( + rootNode, + _("movies"), + newListDef("movies"), + "movies", + null, + null); + + for (Movie m : movies) { + + // navigation path = $root/movies/m.id + movieNode = builder.build( + moviesNode, + movieDecorator, + "..[@id=\"" + m.getId() + "\"]", + m.getId(), + null, + null); + + // navigation path = $root/movies/m.id/actors + actorsNode = builder.build( + movieNode, + _("actors"), + "../actors", + "actors", + null, + null); + + for (People p : m.getActors()) { + // navigation path = $root/movies/m.id/actors/p.id + + builder.build( + actorsNode, + peopleDecorator, + "..[@id=\"" + p.getId() + "\"]", + p.getId(), + null, + null); + actors.add(p); + } + } + + // construction du noeud avec les acteurs + actorsNode = builder.build(rootNode, _("actors"), + newListDef("actors"), + "actors", null, null); + + for (People p : actors) { + // navigation path = $root/actors/p.id + + builder.build( + actorsNode, + peopleDecorator, + "..[@id=\"" + p.getId() + "\"]", + p.getId(), + null, + null); + } + NavigationTreeModel model = builder.getModel(); + + context.setContextValue(movies, "movies"); + context.setContextValue(new ArrayList<People>(actors), "actors"); + + if (log.isDebugEnabled()) { + builder.printModel(context, model.getRoot()); + } + + // save tree model in context + setTreeModel(context, model); + + return model; + } + + public NavigationTreeHandler createTreeHandler(JAXXObject context) { + + + log.info("create handler"); + + NavigationTreeHandler handler = new NavigationTreeHandlerWithCardLayout( + getPrefix(), + BaseContent.class, + null, + context, + Strategy.PER_NODE) { + + private static final long serialVersionUID = 1L; + + @Override + protected NavigationTreeModel getNavigationTreeModel() { + return getSafeTreeModel(getContext()); + } + + @Override + protected JPanel getContentContainer() { + return getContext().getContent(); + } + + @Override + protected CardLayout2 getContentLayout() { + return getContext().getContentLayout(); + } + + @Override + protected void treateError(Exception e) { + ErrorDialogUI.showError(e); + } + + FullNavigationTreeDemo getContext() { + return (FullNavigationTreeDemo) this.context; + } + }; + // on ne peut selectionner qu'un seul noeud a la fois + handler.setSelectionMode(NavigationTreeHandler.SINGLE_TREE_SELECTION); + + // save handler in ui context + setTreeHandler(context, handler); + return handler; + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/FullNavigationTreeHelper.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/Movie.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/Movie.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/Movie.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,107 @@ +package jaxx.demo.component.jaxx.navigation.full.model; + +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; + +/** + * + * @author chemit + */ +public class Movie { + + protected String id; + protected String title; + protected String image; + protected int year; + protected List<People> actors; + + public Movie(String id, String title, int year,String image) { + this(); + this.id = id; + this.title = title; + this.year = year; + this.image=image; + } + + public Movie() { + actors = new ArrayList<People>(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public List<People> getActors() { + return actors; + } + + public void setActors(List<People> actors) { + this.actors = actors; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public void addActor(People actor) { + actors.add(actor); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Movie other = (Movie) obj; + if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE); + b.append("id", id); + b.append("title", title); + b.append("year", year); + b.append("actors", actors); + return b.toString(); + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/Movie.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/People.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/People.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/People.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,97 @@ +package jaxx.demo.component.jaxx.navigation.full.model; + +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; + +/** + * + * @author chemit + */ +public class People { + + protected String id; + protected String image; + protected String firstName; + protected String lastName; + protected int age; + + public People(String id, String firstName, String lastName, int age, String image) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.age = age; + this.image = image; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final People other = (People) obj; + if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE); + b.append("id", id); + b.append("firstName", firstName); + b.append("lastName", lastName); + b.append("age", age); + return b.toString(); + } +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/full/model/People.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ExempleItemTreeNavigationAdapter.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ExempleItemTreeNavigationAdapter.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ExempleItemTreeNavigationAdapter.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,60 @@ +package jaxx.demo.component.jaxx.navigation.item; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.Date; +import jaxx.runtime.JAXXObject; +import jaxx.runtime.swing.Item; +import jaxx.runtime.swing.JAXXTree; +import jaxx.runtime.swing.JAXXTree.JAXXTreeModel; +import jaxx.runtime.swing.navigation.ItemNavigationCardPanel; +import jaxx.runtime.swing.navigation.ItemTreeNavigationAdapter; + +/** + * + * @author letellier + */ +public class ExempleItemTreeNavigationAdapter extends ItemTreeNavigationAdapter{ + + Item currentItem = null; + + public ExempleItemTreeNavigationAdapter(JAXXObject context, JAXXTree tree, ItemNavigationCardPanel cardPanel){ + super(context, tree, cardPanel); + + ItemTreeNavigationDemo demo = (ItemTreeNavigationDemo)context; + demo.addPropertyChangeListener("date", new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (currentItem != null && !(currentItem.getValue() instanceof Class)){ + currentItem.setValue((Date)evt.getNewValue()); + } + } + }); + + demo.addPropertyChangeListener("string", new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (currentItem != null && !(currentItem.getValue() instanceof Class)){ + currentItem.setValue((String)evt.getNewValue()); + } + } + }); + } + + @Override + protected void valueChanged(Object data) { + ItemTreeNavigationDemo demo = (ItemTreeNavigationDemo)context; + currentItem = ((JAXXTreeModel)tree.getModel()).findItem(data); + if (data instanceof String){ + demo.setString((String)data); + } else if (data instanceof Date){ + demo.setDate((Date)data); + } else { + demo.setString(""); + demo.setDate(null); + } + } + +} Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ExempleItemTreeNavigationAdapter.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/navigation/item/ItemTreeNavigationDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,41 @@ +<jaxx.demo.DemoPanel> + + <String id='string' javaBean='null'/> + <Date id='date' javaBean='null'/> + + <script> +import jaxx.runtime.swing.navigation.*; +import org.jdesktop.swingx.JXDatePicker; + +void $afterCompleteSetup() { + new ExempleItemTreeNavigationAdapter(this, nav, content); +} + </script> + + <JPanel id='demoPanel' layout='{new BorderLayout()}'> + <JSplitPane constraints='BorderLayout.CENTER'> + <JScrollPane> + <JTree id='nav' rootVisible='{false}'> + <!-- Allow to diplay associated pane without value --> + <item id='stringItemParent' label='String' value='{String.class}'> + <item id='string1Item' label='String1' value='{new String("Ceci est un String")}' selected='true'/> + <item id='string2Item' label='String2' value='{new String("Celui-ci un autre")}'/> + </item> + <item id='dateItemParent' label='Date' value='{Date.class}'> + <item id='dateItem' label='CurrentDate' value='{new Date()}'/> + </item> + </JTree> + </JScrollPane> + <!-- Card panel, only ItemNavigationPanel children is alowed --> + <ItemNavigationCardPanel id="content"> + <!-- The associated type is passed by the constructor --> + <ItemNavigationPanel id='stringPanel' constructorParams='String.class' layout='{new FlowLayout()}'> + <JTextField id='stringTextField' text='{getString()}' onKeyReleased='setString(stringTextField.getText())'/> + </ItemNavigationPanel> + <ItemNavigationPanel id='datePanel' constructorParams='Date.class' layout='{new FlowLayout()}'> + <JXDatePicker id='datePicker' date='{getDate()}' onActionPerformed='setDate(datePicker.getDate())'/> + </ItemNavigationPanel> + </ItemNavigationCardPanel> + </JSplitPane> + </JPanel> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,29 @@ +<jaxx.demo.DemoPanel> + <style> + JButton.fancy { + foreground: blue; + font-face: Arial; + font-size: 18; + } + + JButton.fancy:mouseover { + foreground: red; + font-style: italic; + } + </style> + + <script> + public void buttonClicked(JButton button) { + JOptionPane.showMessageDialog(this, button.getText() + " clicked!", "onActionPerformed", + JOptionPane.INFORMATION_MESSAGE); + } + </script> + + <javax.swing.ImageIcon id='pencil' constructorParams='getClass().getResource("/jaxx/demo/images/pencil_black.gif")'/> + + <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <JButton text='Simple Button' onActionPerformed='buttonClicked((JButton) event.getSource())'/> + <JButton text='Fancy Button' styleClass='fancy' icon='{pencil}' + onActionPerformed='buttonClicked((JButton) event.getSource())'/> + </VBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,38 @@ +<jaxx.demo.DemoPanel> + <script><![CDATA[ + public String getText(boolean bold, boolean italic, boolean underline) { + String text ="Sample Text"; + if (bold) + text = "<b>" + text + "</b>"; + if (italic) + text = "<i>" + text + "</i>"; + if (underline) + text = "<u>" + text + "</u>"; + return "<html>" + text; + } + ]]></script> + + <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <Table anchor='west'> + <row> + <cell> + <JCheckBox id='bold' text='Bold' mnemonic='B'/> + </cell> + <cell rows='3'> + <JLabel font='{new Font("Arial", 0, 18)}' + text='{getText(bold.isSelected(), italic.isSelected(), underline.isSelected())}'/> + </cell> + </row> + <row> + <cell> + <JCheckBox id='italic' text='Italic' mnemonic='I'/> + </cell> + </row> + <row> + <cell> + <JCheckBox id='underline' text='Underline' mnemonic='U'/> + </cell> + </row> + </Table> + </VBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JCheckBoxMenuItemDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,59 @@ +<JMenuItemDemo> + <style> + .form { + enabled: { enabledCheckBox.isSelected() }; + editable: { editableCheckBox.isSelected() }; + } + </style> + + <JMenuBar id='menuBar'> + <JMenu text='View'> + <JCheckBoxMenuItem id='enabledCheckBox' text='Enabled' selected='true'/> + <JCheckBoxMenuItem id='editableCheckBox' text='Editable' selected='true'/> + </JMenu> + </JMenuBar> + + <Table id='framePanel' anchor='northwest'> + <row> + <cell> + <JLabel text='First Name:' displayedMnemonic='F' labelFor='{firstName}'/> + </cell> + + <cell weightx='1' fill='horizontal'> + <JTextField id='firstName' styleClass="form"/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Last Name:' displayedMnemonic='L' labelFor='{lastName}'/> + </cell> + + <cell fill='horizontal'> + <JTextField id='lastName' styleClass="form"/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Email Address:' displayedMnemonic='E' labelFor='{email}'/> + </cell> + + <cell fill='horizontal'> + <JTextField id='email' styleClass="form"/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Comments:' displayedMnemonic='C' labelFor='{comments}'/> + </cell> + + <cell weightx='1' weighty='1' fill='both'> + <JScrollPane width='150' height='75'> + <JTextArea id='comments' styleClass="form"/> + </JScrollPane> + </cell> + </row> + </Table> +</JMenuItemDemo> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,22 @@ + +<jaxx.demo.DemoPanel> + <Table id='demoPanel'> + <row> + <cell> + <JLabel text='Button label:'/> + </cell> + + <cell> + <JComboBox id='comboBox' editable='true'> + <item value='OK' selected='true'/> + <item value='Cancel'/> + <item value='Help'/> + </JComboBox> + </cell> + + <cell> + <JButton text='{comboBox.getSelectedItem()}'/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JDialogDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,79 @@ +<jaxx.demo.DemoPanel> + <script> + String username; + String password; + + private class OKAction extends javax.swing.AbstractAction { + public OKAction() { + putValue(NAME, "OK"); + } + + + public void actionPerformed(ActionEvent e) { + username = usernameField.getText(); + password = new String(passwordField.getPassword()); + dialog.dispose(); + } + } + + + private class CancelAction extends javax.swing.AbstractAction { + public CancelAction() { + putValue(NAME, "Cancel"); + } + + + public void actionPerformed(ActionEvent e) { + dialog.dispose(); + } + } + { + JRootPane rootPane = dialog.getRootPane(); + rootPane.setDefaultButton(ok); + rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "cancel"); + rootPane.getActionMap().put("cancel", new CancelAction()); + } + </script> + + <JDialog title='Sign on' id='dialog' modal='true' onWindowOpened='dialog.setLocationRelativeTo(demoPanel); + passwordField.setText("");'> + <Table> + <row> + <cell> + <JLabel text='Username:' displayedMnemonic='U' labelFor='{usernameField}'/> + </cell> + + <cell> + <JTextField id='usernameField'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Password:' displayedMnemonic='P' labelFor='{passwordField}'/> + </cell> + + <cell> + <JPasswordField id='passwordField'/> + </cell> + </row> + + <row> + <cell columns='2'> + <JPanel layout='{new GridLayout(1, 0, 6, 6)}'> + <JButton id='ok' text='OK' action='{new OKAction()}'/> + <JButton text='Cancel' action='{new CancelAction()}'/> + </JPanel> + </cell> + </row> + </Table> + </JDialog> + + <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <JButton text='Show password dialog' onActionPerformed='dialog.setVisible(true)'/> + <VBox> + <JLabel text='{username != null ? "Username: " + username : ""}'/> + <JLabel text='{password != null ? "Password: " + password : ""}'/> + </VBox> + </VBox> +</jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JListDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,59 @@ +<jaxx.demo.DemoPanel> + <Table id='demoPanel'> + <row> + <cell> + <JLabel text='Supported Swing components:'/> + </cell> + </row> + + <row> + <cell> + <JScrollPane> + <JList> + <item value='JApplet'/> + <item value='JButton'/> + <item value='JCheckBox'/> + <item value='JCheckBoxMenuItem'/> + <item value='JColorChooser'/> + <item value='JComboBox'/> + <item value='JDesktopPane'/> + <item value='JDialog'/> + <item value='JEditorPane'/> + <item value='JFileChooser'/> + <item value='JFormattedTextField'/> + <item value='JFrame'/> + <item value='JInternalFrame'/> + <item value='JLabel'/> + <item value='JLayeredPane'/> + <item value='JList'/> + <item value='JMenu'/> + <item value='JMenuBar'/> + <item value='JMenuItem'/> + <item value='JOptionPane'/> + <item value='JPanel'/> + <item value='JPasswordField'/> + <item value='JPopupMenu'/> + <item value='JProgressBar'/> + <item value='JRadioButton'/> + <item value='JRadioButtonMenuItem'/> + <item value='JScrollBar'/> + <item value='JScrollPane'/> + <item value='JSeparator'/> + <item value='JSlider'/> + <item value='JSpinner'/> + <item value='JSplitPane'/> + <item value='JTabbedPane'/> + <item value='JTable'/> + <item value='JTextArea'/> + <item value='JTextField'/> + <item value='JTextPane'/> + <item value='JToggleButton'/> + <item value='JToolBar'/> + <item value='JTree'/> + <item value='JWindow'/> + </JList> + </JScrollPane> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JMenuItemDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,23 @@ +<jaxx.demo.DemoPanel> + <script> + private void displayMessage() { + JOptionPane.showMessageDialog(demoPanel, "Menu item clicked"); + } + </script> + + <JPanel id='demoPanel'> + <JDesktopPane width='350' height='400' background='{null}'> + <JInternalFrame title='JMenu demo' width='300' height='250' resizable='true'> + <JMenuBar id='menuBar'> + <JMenu text='Demo'> + <JMenuItem text='Message Box' onActionPerformed='displayMessage()'/> + </JMenu> + </JMenuBar> + + <JPanel id='framePanel'> + <JLabel text='JMenu demo' id='demoMessage' horizontalAlignment='center'/> + </JPanel> + </JInternalFrame> + </JDesktopPane> + </JPanel> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JPasswordFieldDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,10 @@ +<jaxx.demo.DemoPanel> + <VBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <HBox> + <JLabel text='Password:' displayedMnemonic='P' labelFor='{password}'/> + <JPasswordField id='password'/> + </HBox> + + <JLabel text='You entered: {new String(password.getPassword())}'/> + </VBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JProgressBarDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,77 @@ +<jaxx.demo.DemoPanel> + <script><![CDATA[ + import javax.swing.Timer; + + int red = 0; + int green = 0; + int blue = 0; + int speed = 2; + int redDirection = 1; + int greenDirection = 1; + int blueDirection = 1; + + Timer redTimer = new Timer(5, new ActionListener() { + public void actionPerformed(ActionEvent e) { + red = Math.max(0, Math.min(255, red + speed * redDirection)); + if (red == 0 || red == 255) + redDirection = -redDirection; + } + }); + + Timer greenTimer = new Timer(50, new ActionListener() { + public void actionPerformed(ActionEvent e) { + green = Math.max(0, Math.min(255, green + speed * greenDirection)); + if (green == 0 || green == 255) + greenDirection = -greenDirection; + } + }); + + Timer blueTimer = new Timer(500, new ActionListener() { + public void actionPerformed(ActionEvent e) { + blue = Math.max(0, Math.min(255, blue + speed * blueDirection)); + if (blue == 0 || blue == 255) + blueDirection = -blueDirection; + } + }); + + redTimer.start(); + greenTimer.start(); + blueTimer.start(); + ]]></script> + + <Table insets='6' id='demoPanel'> + <row> + <cell columns='3'> + <JLabel text='Welcome to the JAXX framework!' font='{UIManager.getFont("Label.font").deriveFont(18f)}' + foreground='{new Color(red, green, blue)}'/> + </cell> + </row> + + <row> + <cell columns='3' fill='horizontal'> + <JProgressBar foreground='{new Color(red, 0, 0)}' value='{red}' maximum='255'/> + </cell> + </row> + + <row> + <cell columns='3' fill='horizontal'> + <JProgressBar foreground='{new Color(0, green, 0)}' value='{green}' maximum='255'/> + </cell> + </row> + + <row> + <cell columns='3' fill='horizontal'> + <JProgressBar foreground='{new Color(0, 0, blue)}' value='{blue}' maximum='255'/> + </cell> + </row> + + <row> + <cell weightx='1' anchor='east'> + <JButton text='Start' onActionPerformed='redTimer.start(); greenTimer.start(); blueTimer.start()'/> + </cell> + <cell> + <JButton text='Stop' onActionPerformed='redTimer.stop(); greenTimer.stop(); blueTimer.stop()'/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,11 @@ +<jaxx.demo.DemoPanel> + <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <VBox> + <JRadioButton text='Animal' value='Lynx.jpg' buttonGroup='radioButtons' selected='true'/> + <JRadioButton text='Vegetable' buttonGroup='radioButtons' value='Tomato.jpg'/> + <JRadioButton text='Mineral' buttonGroup='radioButtons' value='Amethyst.jpg'/> + </VBox> + + <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/" + radioButtons.getSelectedValue()))}'/> + </HBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JRadioButtonMenuItemDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,14 @@ +<JMenuItemDemo> + <JMenuBar id='menuBar'> + <JMenu text='Font size'> + <JRadioButtonMenuItem text='10' value='{new Integer(10)}' buttonGroup='fontSize'/> + <JRadioButtonMenuItem text='12' value='{new Integer(12)}' buttonGroup='fontSize' selected='true'/> + <JRadioButtonMenuItem text='14' value='{new Integer(14)}' buttonGroup='fontSize'/> + <JRadioButtonMenuItem text='18' value='{new Integer(18)}' buttonGroup='fontSize'/> + <JRadioButtonMenuItem text='24' value='{new Integer(24)}' buttonGroup='fontSize'/> + </JMenu> + </JMenuBar> + + <JLabel id='demoMessage' text='Font size: {fontSize.getSelectedValue()}' horizontalAlignment='center' + font='{UIManager.getFont("Label.font").deriveFont(fontSize.getSelectedValue() != null ? (float) ((Integer) fontSize.getSelectedValue()).intValue() : 12)}'/> +</JMenuItemDemo> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSliderDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,12 @@ +<jaxx.demo.DemoPanel> + <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <VBox> + <JSlider id='red' maximum='255' value='200'/> + <JSlider id='green' maximum='255' value='180'/> + <JSlider id='blue' maximum='255' value='240'/> + </VBox> + + <JPanel border='{BorderFactory.createEtchedBorder()}' width='64' height='64' + background='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/> + </HBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSpinnerDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,13 @@ +<jaxx.demo.DemoPanel> + <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <JLabel text='Spacing:' displayedMnemonic='S' labelFor='{spinner}'/> + + <JSpinner minimum='0' maximum='50' id='spinner'/> + + <VBox spacing='{((Integer) spinner.getValue()).intValue()}'> + <JLabel text='Use the spinner to'/> + <JLabel text='adjust the spacing'/> + <JLabel text='between these lines'/> + </VBox> + </HBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JSplitPaneDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,13 @@ +<jaxx.demo.DemoPanel> + <JPanel id='demoPanel' layout='{new BorderLayout()}'> + <JSplitPane> + <JScrollPane> + <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Amethyst.jpg"))}'/> + </JScrollPane> + + <JScrollPane> + <JLabel icon='{new ImageIcon(getClass().getResource("/jaxx/demo/images/Lynx.jpg"))}'/> + </JScrollPane> + </JSplitPane> + </JPanel> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextAreaDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,33 @@ +<jaxx.demo.DemoPanel> + <Table id='demoPanel' anchor='northwest'> + <row> + <cell> + <JLabel text='Normal text:' displayedMnemonic='N' labelFor='{textArea}'/> + </cell> + + <cell weightx='1' fill='both'> + <JScrollPane height='120'> + <JTextArea id='textArea' text='Try typing some text here.'/> + </JScrollPane> + </cell> + </row> + + <row> + <cell> + <JLabel text='Upper case text:'/> + </cell> + + <cell weightx='1' fill='both'> + <JScrollPane height='120'> + <JTextArea editable='false' background='{null}' text='{textArea.getText().toUpperCase()}'/> + </JScrollPane> + </cell> + </row> + + <row> + <cell weighty='1'> + <JPanel/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JTextFieldDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,22 @@ +<jaxx.demo.DemoPanel> + <JPanel id='demoPanel'> + <Table> + <row> + <cell> + <JLabel text='Your name:' displayedMnemonic='n' labelFor='{textField}'/> + </cell> + + <cell> + <JTextField id='textField'/> + </cell> + </row> + + <row> + <cell columns='2'> + <JButton text='Greet' + onActionPerformed='JOptionPane.showMessageDialog(demoPanel, "Hello, " + textField.getText() + "!")'/> + </cell> + </row> + </Table> + </JPanel> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JToggleButtonDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,9 @@ +<jaxx.demo.DemoPanel> + <HBox id='demoPanel' horizontalAlignment='center' verticalAlignment='middle'> + <JToggleButton text='1' id='one'/> + <JToggleButton text='2' id='two'/> + <JToggleButton text='3' id='three'/> + + <JLabel text='Total: {(one.isSelected() ? 1 : 0) + (two.isSelected() ? 2 : 0) + (three.isSelected() ? 3 : 0)}'/> + </HBox> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BaseBeanDataBinding.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,21 @@ +<jaxx.demo.DemoPanel> + + <!-- a full java bean property of the class --> + <Boolean id='editing' javaBean='false'/> + + <!-- not full java bean property (must add script...) --> + <Boolean id='editing2' constructorParams='false'/> + + <String id='contentMessage' javaBean='"message..."'/> + + <script> + public Boolean isEditing2() { return editing2; } + + public void setEditing2(Boolean newValue) { + Boolean oldValue = this.editing2; + this.editing2 = newValue; + firePropertyChange("editing2", oldValue, newValue) ; + } + </script> + +</jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/databinding/BeanDataBindingDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,47 @@ +<BaseBeanDataBinding> + + <Boolean id='editing3' javaBean='true'/> + + <Table id='demoPanel'> + <row> + <cell columns='2'> + <JLabel text='{getContentMessage()}'/> + </cell> + </row> + <row> + <cell> + <JPanel> + <JButton visible='{!isEditing()}' text='edit' onActionPerformed='setEditing(true);'/> + <JButton visible='{isEditing()}' text='close' onActionPerformed='setEditing(false);'/> + </JPanel> + </cell> + <cell weightx='1' fill='both'> + <JTextField enabled='{isEditing()}' text='to edit'/> + </cell> + </row> + <row> + <cell> + <JPanel> + <JButton visible='{!isEditing2()}' text='edit2' onActionPerformed='setEditing2(true);'/> + <JButton visible='{isEditing2()}' text='close2' onActionPerformed='setEditing2(false);'/> + </JPanel> + </cell> + <cell weightx='1' fill='both'> + <JTextField enabled='{isEditing2()}' text="to edit 2"/> + </cell> + </row> + <row> + <cell> + <JPanel> + <JButton visible='{!isEditing3()}' text='edit3' onActionPerformed='setEditing3(true);'/> + <JButton visible='{isEditing3()}' text='close3' onActionPerformed='setEditing3(false);'/> + </JPanel> + </cell> + <cell weightx='1' fill='both'> + <JTextField id='edit3' enabled='{isEditing3()}' text="{getContentMessage()}" + onKeyReleased='setContentMessage(edit3.getText())'/> + </cell> + </row> + </Table> + +</BaseBeanDataBinding> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,103 @@ +package jaxx.demo.feature.validation; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.io.File; + +public class Identity { + + protected String firstName = ""; + + protected String lastName = ""; + + protected String email = "dummy@codelutin.com"; + + protected int age = 51; + + protected File config = new File("/tmp"); + + protected File dir = new File("/tmp"); + + PropertyChangeSupport p; + + public Identity() { + p = new PropertyChangeSupport(this); + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + p.addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.addPropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + p.removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.removePropertyChangeListener(propertyName, listener); + } + + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getEmail() { + return email; + } + + public int getAge() { + return age; + } + + public File getConfig() { + return config; + } + + public File getDir() { + return dir; + } + + public void setFirstName(String firstName) { + String oldFirstName = this.firstName; + this.firstName = firstName; + p.firePropertyChange("firstName", oldFirstName, firstName); + } + + public void setLastName(String lastName) { + String oldLastName = this.lastName; + this.lastName = lastName; + p.firePropertyChange("lastName", oldLastName, lastName); + } + + public void setEmail(String email) { + String oldEmail = this.email; + this.email = email; + p.firePropertyChange("email", oldEmail, email); + } + + public void setAge(int age) { + int oldAge = this.age; + this.age = age; + p.firePropertyChange("age", oldAge, age); + } + + public void setConfig(File config) { + File oldConfig = this.config; + this.config = config; + p.firePropertyChange("config", oldConfig, config); + } + + public void setDir(File dir) { + File oldDir = this.dir; + this.dir = dir; + p.firePropertyChange("dir", oldDir, dir); + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Identity.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,66 @@ +package jaxx.demo.feature.validation; + +import java.beans.*; + +public class Model { + + protected String text = "text"; + + protected String text2 = "text2"; + + protected int ratio = 51; + + + PropertyChangeSupport p; + + public Model() { + p = new PropertyChangeSupport(this); + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + p.addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.addPropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + p.removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + p.removePropertyChangeListener(propertyName, listener); + } + + + public String getText() { + return text; + } + + public String getText2() { + return text2; + } + + public int getRatio() { + return ratio; + } + + public void setText(String text) { + String oldText = this.text; + this.text = text; + p.firePropertyChange("text", oldText, text); + } + + public void setText2(String text2) { + String oldText2 = this.text2; + this.text2 = text2; + p.firePropertyChange("text2", oldText2, text2); + } + + public void setRatio(int ratio) { + int oldRatio = this.ratio; + this.ratio = ratio; + p.firePropertyChange("ratio", oldRatio, ratio); + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Model.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/Validation.css 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,5 @@ +JSlider { + paintTicks: true; + minorTickSpacing: 5; + majorTickSpacing: 10; +} Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationListDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,325 @@ +<jaxx.demo.DemoPanel> + <style source="Validation.css"/> + +<script><![CDATA[ +import static org.nuiton.i18n.I18n.n_; +void $afterCompleteSetup() { +}]]> +</script> + <!-- models --> + <Model id='model1'/> + <Model id='model2'/> + <Identity id='identity'/> + + <!-- errors model --> + <!-- Not existing :) --> + <!--jaxx.runtime.validator.gwt.GWTValidatorMessageListModel id='errors'--> + <jaxx.runtime.validator.swing.SwingValidatorMessageListModel id='errors' + onContentsChanged='ok.setEnabled(errors.isEmpty())'/> + + <!-- validators --> + <BeanValidator id='validator' bean='model1' uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"> + <field name="text"/> + <field name="text2"/> + <field name="ratio"/> + </BeanValidator> + <BeanValidator id='validator2' bean='model2' uiClass="jaxx.runtime.validator.swing.ui.IconValidationUI"> + <field name="text" component="_text"/> + <field name="text2" component="_text2"/> + <field name="ratio" component="_ratio"/> + </BeanValidator> + <BeanValidator id='validator3' autoField='true' bean='identity' + uiClass="jaxx.runtime.validator.swing.ui.TranslucentValidationUI"> + <field name="email" component="email2"/> + </BeanValidator> + + <Table fill='both' id='demoPanel'> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='text' text='{model1.getText()}' + _validatorLabel='{n_("form.text")}' + onKeyReleased='model1.setText(text.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='text2' text='{model1.getText2()}' + _validatorLabel='{n_("form.text2")}' + onKeyReleased='model1.setText2(text2.getText())'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='ratio' minimum='0' maximum='100' + value='{model1.getRatio()}' + _validatorLabel='{n_("form.ratio")}' + onStateChanged='model1.setRatio(ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText2()}'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model1.getRatio()}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text' text='{model2.getText()}' + _validatorLabel='{n_("form2.text")}' + onKeyReleased='model2.setText(_text.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text2' text='{model2.getText2()}' + _validatorLabel='{n_("form2.text2")}' + onKeyReleased='model2.setText2(_text2.getText())'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='_ratio' minimum='0' maximum='100' + value='{model2.getRatio()}' + _validatorLabel='{n_("form2.ratio")}' + onStateChanged='model2.setRatio(_ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText2()}'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model2.getRatio()}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identify Form")}' + layout='{new GridLayout()}' width='250' height='180'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JTextField id='firstName' text='{identity.getFirstName()}' + onKeyReleased='identity.setFirstName(firstName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JTextField id='lastName' text='{identity.getLastName()}' + onKeyReleased='identity.setLastName(lastName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JTextField id='email2' text='{identity.getEmail()}' + onKeyReleased='identity.setEmail(email2.getText())'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JSlider id='age' minimum='0' maximum='100' value='{identity.getAge()}' + onStateChanged='identity.setAge(age.getValue())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file :'/> + </cell> + <cell> + <JTextField id='config' text='{identity.getConfig()}' + onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Working directory:'/> + </cell> + <cell> + <JTextField id='dir' text='{identity.getDir()}' + onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identity Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getFirstName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getLastName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getEmail()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JLabel text='{identity.getAge()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file:'/> + </cell> + <cell> + <JLabel text='{identity.getConfig()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Directory file:'/> + </cell> + <cell> + <JLabel text='{identity.getDir()}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel border='{BorderFactory.createTitledBorder("Messages")}' layout='{new GridLayout()}' height='200' + width='500'> + <JScrollPane> + <JList id='errorList' model='{errors}' + cellRenderer='{new jaxx.runtime.validator.swing.SwingValidatorMessageListRenderer()}'/> + </JScrollPane> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel layout='{new GridLayout(1,2,0,0)}'> + <JButton id='cancel' text='cancel' + onActionPerformed='JOptionPane.showMessageDialog(this, cancel.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + <JButton id='ok' text='valid' + onActionPerformed='JOptionPane.showMessageDialog(this, ok.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + </JPanel> + </cell> + </row> + </Table> + +</jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/ValidationTableDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,331 @@ +<jaxx.demo.DemoPanel> + <style source="Validation.css"/> + + <!-- models --> + <Model id='model1'/> + <Model id='model2'/> + <Identity id='identity'/> + + <!-- errors model --> + <!-- Not existing :) --> + <!--jaxx.runtime.validator.gwt.GWTValidatorMessageTableModel id='errors2'/--> + <jaxx.runtime.validator.swing.SwingValidatorMessageTableModel id='errors2' + onTableChanged='ok.setEnabled(errors2.getRowCount()==0)'/> + + <!-- validators --> + <BeanValidator id='validator' bean='model1' uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"> + <field name="text"/> + <field name="text2"/> + <field name="ratio"/> + </BeanValidator> + <BeanValidator id='validator2' bean='model2' uiClass="jaxx.runtime.validator.swing.ui.IconValidationUI"> + <field name="text" component="_text"/> + <field name="text2" component="_text2"/> + <field name="ratio" component="_ratio"/> + </BeanValidator> + <BeanValidator id='validator3' autoField='true' bean='identity' + uiClass="jaxx.runtime.validator.swing.ui.TranslucentValidationUI"> + <field name="email" component="email2"/> + </BeanValidator> + + <script><![CDATA[ +import static org.nuiton.i18n.I18n.n_; +import jaxx.runtime.SwingUtil; + +void $afterCompleteSetup() { + jaxx.runtime.SwingValidatorUtil.installUI(errorTable, new jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer()); +} +]]></script> + + <Table fill='both' id='demoPanel'> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='text' text='{model1.getText()}' + onKeyReleased='model1.setText(text.getText())' + _validatorLabel='{n_("form.text")}' + /> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='text2' text='{model1.getText2()}' + onKeyReleased='model1.setText2(text2.getText())' + _validatorLabel='{n_("form.text2")}' + /> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='ratio' minimum='0' maximum='100' + value='{model1.getRatio()}' + _validatorLabel='{n_("form.ratio")}' + onStateChanged='model1.setRatio(ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model1.getText2()}'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model1.getRatio()}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Form2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text' text='{model2.getText()}' + _validatorLabel='{n_("form2.text")}' + onKeyReleased='model2.setText(_text.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JTextField id='_text2' text='{model2.getText2()}' + _validatorLabel='{n_("form2.text2")}' + onKeyReleased='model2.setText2(_text2.getText())'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JSlider id='_ratio' minimum='0' maximum='100' + value='{model2.getRatio()}' + _validatorLabel='{n_("form2.ratio")}' + onStateChanged='model2.setRatio(_ratio.getValue())'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Model2")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Text2:'/> + </cell> + <cell weightx='1'> + <JLabel text='{model2.getText2()}'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Ratio:'/> + </cell> + <cell> + <JLabel text='{model2.getRatio()}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identify Form")}' + layout='{new GridLayout()}' width='250' height='180'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JTextField id='firstName' text='{identity.getFirstName()}' + onKeyReleased='identity.setFirstName(firstName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JTextField id='lastName' text='{identity.getLastName()}' + onKeyReleased='identity.setLastName(lastName.getText())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JTextField id='email2' text='{identity.getEmail()}' + onKeyReleased='identity.setEmail(email2.getText())'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JSlider id='age' minimum='0' maximum='100' value='{identity.getAge()}' + onStateChanged='identity.setAge(age.getValue())'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file :'/> + </cell> + <cell> + <JTextField id='config' text='{identity.getConfig()}' + onKeyReleased='identity.setConfig(new java.io.File(config.getText()))'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Working directory:'/> + </cell> + <cell> + <JTextField id='dir' text='{identity.getDir()}' + onKeyReleased='identity.setDir(new java.io.File(dir.getText()))'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <JPanel border='{BorderFactory.createTitledBorder("Identity Model")}' + layout='{new GridLayout()}' width='250' height='120'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='FirstName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getFirstName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='LastName:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getLastName()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Email:'/> + </cell> + <cell weightx='1'> + <JLabel text='{identity.getEmail()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Age:'/> + </cell> + <cell> + <JLabel text='{identity.getAge()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Config file:'/> + </cell> + <cell> + <JLabel text='{identity.getConfig()}'/> + </cell> + </row> + <row> + <cell> + <JLabel text='Directory file:'/> + </cell> + <cell> + <JLabel text='{identity.getDir()}'/> + </cell> + </row> + </Table> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel border='{BorderFactory.createTitledBorder("Messages")}' layout='{new GridLayout()}' height='200' + width='500'> + <JScrollPane columnHeaderView='{errorTable.getTableHeader()}'> + <JTable id='errorTable' model='{errors2}' rowSelectionAllowed='true' autoCreateRowSorter='true' + autoResizeMode='2' cellSelectionEnabled='false' selectionMode='0'/> + </JScrollPane> + </JPanel> + </cell> + </row> + <row> + <cell columns='2' fill="both"> + <JPanel layout='{new GridLayout(1,2,0,0)}'> + <JButton id='cancel' text='cancel' + onActionPerformed='JOptionPane.showMessageDialog(this, cancel.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + <JButton id='ok' text='valid' + onActionPerformed='JOptionPane.showMessageDialog(this, ok.getText() + " clicked!", "onActionPerformed", JOptionPane.INFORMATION_MESSAGE);'/> + </JPanel> + </cell> + </row> + </Table> + +</jaxx.demo.DemoPanel> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/Calculator.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/Calculator.css (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/Calculator.css 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,68 @@ +#table { + border: { BorderFactory . createEmptyBorder( 4, 4, 4, 4 ) +} + +; +font-face: + +"Trebuchet MS" +; +} + +#display { + background: #BCE5AD; + opaque: true; + horizontalAlignment: right; + border: { BorderFactory . createBevelBorder( BevelBorder . LOWERED ) +} + +; +font-size: + +22 +; +font-weight: bold + +; +} + +#display:{ + object . getText( ) . startsWith( "-" ) +} + +{ +foreground: red + +; +} + +JButton { + font-size: 18; + width: 80; + height: 35; +} + +JButton.digit { + foreground: blue; +} + +JButton#dot { + font-size: 20; +} + +JButton.operator { + font-size: 16; + foreground: #009900; +} + +JButton.clear { + foreground: red; +} + +JButton:mouseover { + font-weight: bold; +} + +JButton.operator:mouseover { + font-weight: normal; +} \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,89 @@ +<jaxx.demo.DemoPanel> + <style source='Calculator.css'/> + <script><![CDATA[ + plus.setText("+"); + sign.setText("+/-"); +]]></script> + <!-- use fully-qualified name just in case this is compiled into a different package --> + <CalculatorEngine id='engine'/> + + <Table id='demoPanel' fill='both'> + <row> + <cell columns='4'> + <JLabel id='display' text='{engine.getDisplayText()}'/> + </cell> + </row> + + <row> + <cell columns='2'> + <JButton id='c' text='C' onActionPerformed='engine.clear()' styleClass='clear'/> + </cell> + <cell> + <JButton id='ce' text='CE' onActionPerformed='engine.clearEntry()' styleClass='clear'/> + </cell> + <cell> + <JButton id='equals' text='=' onActionPerformed='engine.equal()' styleClass='operator'/> + </cell> + </row> + + <row> + <cell> + <JButton id='d7' text='7' onActionPerformed='engine.digit(7)' styleClass='digit'/> + </cell> + <cell> + <JButton id='d8' text='8' onActionPerformed='engine.digit(8)' styleClass='digit'/> + </cell> + <cell> + <JButton id='d9' text='9' onActionPerformed='engine.digit(9)' styleClass='digit'/> + </cell> + <cell> + <JButton id='plus' onActionPerformed='engine.add()' styleClass='operator'/> + </cell> + </row> + + <row> + <cell> + <JButton id='d4' text='4' onActionPerformed='engine.digit(4)' styleClass='digit'/> + </cell> + <cell> + <JButton id='d5' text='5' onActionPerformed='engine.digit(5)' styleClass='digit'/> + </cell> + <cell> + <JButton id='d6' text='6' onActionPerformed='engine.digit(6)' styleClass='digit'/> + </cell> + <cell> + <JButton id='subtract' text='-' onActionPerformed='engine.subtract()' styleClass='operator'/> + </cell> + </row> + + <row> + <cell> + <JButton id='d1' text='1' onActionPerformed='engine.digit(1)' styleClass='digit'/> + </cell> + <cell> + <JButton id='d2' text='2' onActionPerformed='engine.digit(2)' styleClass='digit'/> + </cell> + <cell> + <JButton id='d3' text='3' onActionPerformed='engine.digit(3)' styleClass='digit'/> + </cell> + <cell> + <JButton id='multiply' text='x' onActionPerformed='engine.multiply()' styleClass='operator'/> + </cell> + </row> + + <row> + <cell> + <JButton id='d0' text='0' onActionPerformed='engine.digit(0)' styleClass='digit'/> + </cell> + <cell> + <JButton id='sign' onActionPerformed='engine.toggleSign()' styleClass='operator'/> + </cell> + <cell> + <JButton id='dot' text='.' onActionPerformed='engine.dot()' styleClass='digit'/> + </cell> + <cell> + <JButton id='divide' text='÷' onActionPerformed='engine.divide()' styleClass='operator'/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,177 @@ +package jaxx.demo.fun; + +import java.beans.*; +import java.math.*; + +public class CalculatorEngine { + public static final String DISPLAY_TEXT_PROPERTY = "displayText"; + + public static final int ADD = 0; + public static final int SUBTRACT = 1; + public static final int MULTIPLY = 2; + public static final int DIVIDE = 3; + public static final int RESULT = 4; + + private int operation = -1; + private boolean clear = true; // true to clear on next key + private String displayText = "0"; + private BigDecimal value; + private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); + + + public String getDisplayText() { + return displayText; + } + + + public void setDisplayText(String displayText) { + String oldDisplayText = this.displayText; + this.displayText = displayText; + firePropertyChange(DISPLAY_TEXT_PROPERTY, oldDisplayText, displayText); + } + + + public void clear() { + clearEntry(); + value = new BigDecimal(0); + operation = -1; + } + + + public void clearEntry() { + setDisplayText("0"); + clear = true; + } + + + private void checkClear() { + if (clear) { + setDisplayText(""); + clear = false; + } + } + + + public void digit(int digit) { + checkClear(); + setDisplayText(getDisplayText() + String.valueOf(digit)); + } + + + public void dot() { + checkClear(); + if (getDisplayText().indexOf('.') == -1) { + if (getDisplayText().length() == 0) { + setDisplayText("0."); + } else { + setDisplayText(getDisplayText() + '.'); + } + } + } + + + public void toggleSign() { + String text = getDisplayText(); + if (text.startsWith("-")) { + text = text.substring(1); + } else if (!text.equals("0")) { + text = '-' + text; + } + setDisplayText(text); + } + + + public void equal() { + BigDecimal displayValue = new BigDecimal(getDisplayText()); + BigDecimal newValue = displayValue; + switch (operation) { + case ADD: + newValue = value.add(displayValue); + break; + case SUBTRACT: + newValue = value.subtract(displayValue); + break; + case MULTIPLY: + newValue = value.multiply(displayValue); + break; + case DIVIDE: + newValue = value.divide(displayValue, 8, BigDecimal.ROUND_HALF_UP); + break; + } + value = newValue; + setDisplayText(toString(newValue)); + clear = true; + operation = -1; + } + + + public static String toString(BigDecimal decimal) { + // can't use stripTrailingZeros, as it wasn't introduced until 1.5 + String result = decimal.toString(); + if (result.indexOf(".") != -1) { + while (result.endsWith("0")) { + result = result.substring(0, result.length() - 1); + } + if (result.endsWith(".")) { + result = result.substring(0, result.length() - 1); + } + } + return result; + } + + + public void operation(int operation) { + if (this.operation != -1) { + equal(); + } else { + value = new BigDecimal(getDisplayText()); + clear = true; + } + this.operation = operation; + } + + + public void add() { + operation(ADD); + } + + + public void subtract() { + operation(SUBTRACT); + } + + + public void multiply() { + operation(MULTIPLY); + } + + + public void divide() { + operation(DIVIDE); + } + + + public void addPropertyChangeListener(PropertyChangeListener listener) { + propertyChangeSupport.addPropertyChangeListener(listener); + } + + + public void addPropertyChangeListener(String property, PropertyChangeListener listener) { + propertyChangeSupport.addPropertyChangeListener(property, listener); + } + + + public void removePropertyChangeListener(PropertyChangeListener listener) { + propertyChangeSupport.removePropertyChangeListener(listener); + } + + + public void removePropertyChangeListener(String property, PropertyChangeListener listener) { + propertyChangeSupport.removePropertyChangeListener(property, listener); + } + + + protected void firePropertyChange(String property, Object oldValue, Object newValue) { + propertyChangeSupport.firePropertyChange(property, oldValue, newValue); + } +} \ No newline at end of file Property changes on: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CalculatorEngine.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/CounterDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,12 @@ +<jaxx.demo.DemoPanel> + <script>int count;</script> + <JPanel id='demoPanel'> + <JTextField text='{count}' constraints='BorderLayout.NORTH'/> + <HBox constraints='BorderLayout.SOUTH'> + <JButton text='Dec (-)' onActionPerformed='count--'/> + <JButton text='Reset' onActionPerformed='count = 0'/> + <JButton text='Inc (+)' onActionPerformed='count++'/> + </HBox> + </JPanel> + +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyle.css =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyle.css (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyle.css 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,43 @@ +JSlider { + paintTicks: true; +} + +JSlider.color { + minorTickSpacing: 10; + majorTickSpacing: 50; + border: { BorderFactory . createEmptyBorder( 1, 1, 1, 1 ) +} + +; +} + +JSlider.color:focused { + border: { BorderFactory . createLineBorder( Color . BLACK, 1 ) +} + +; +} + +JSlider#red:focused { + background: #E7ADAD; +} + +JSlider#green:focused { + background: #B2E7AD; +} + +JSlider#blue:focused { + background: #ADB2E7; +} + +JSlider#dummySize { + minorTickSpacing: 2; + majorTickSpacing: 6; +} + +JRadioButton { + enabled: { backgroundCheckbox . isSelected( ) +} + +; +} \ No newline at end of file Added: trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/fun/LabelStyleDemo.jaxx 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,85 @@ +<jaxx.demo.DemoPanel> + <style source="LabelStyle.css"/> + + <Table id='demoPanel' anchor='north' fill='both'> + <row> + <cell weightx='1' weighty='1' insets='6, 3, 0, 0'> + <Table anchor='west' fill='both'> + <row> + <cell> + <JLabel text='Text:'/> + </cell> + <cell weightx='1'> + <JTextField id='text' text='Data Binding'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Red:'/> + </cell> + <cell> + <JSlider id='red' value='128' maximum='255' styleClass='color'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Green:'/> + </cell> + <cell> + <JSlider id='green' value='0' maximum='255' styleClass='color'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Blue:'/> + </cell> + <cell> + <JSlider id='blue' value='255' maximum='255' styleClass='color'/> + </cell> + </row> + + <row> + <cell> + <JLabel text='Size:'/> + </cell> + <cell> + <JSlider id='dummySize' value='36' minimum='6' maximum='60'/> + </cell> + </row> + + <row> + <cell columns='2' fill='both' weighty='1'> + <JPanel border='{BorderFactory.createTitledBorder("Preview")}' + height='90' + layout='{new BorderLayout()}'> + <VBox background='{(Color)( backgroundCheckbox.isSelected() ? backgroundColor.getSelectedValue() : null)}' + margin='0' + horizontalAlignment='center' + verticalAlignment='middle'> + <JLabel text='{text.getText()}' font-size='{dummySize.getValue()}' + foreground='{new Color(red.getValue(), green.getValue(), blue.getValue())}'/> + </VBox> + </JPanel> + </cell> + </row> + </Table> + </cell> + + <cell> + <VBox spacing='0' border='{BorderFactory.createTitledBorder("Background")}'> + <JCheckBox id='backgroundCheckbox' text='Show Background'/> + <JRadioButton text='Red' buttonGroup='backgroundColor' value='{Color.RED}' selected='true'/> + <JRadioButton text='Orange' buttonGroup='backgroundColor' value='{Color.ORANGE}'/> + <JRadioButton text='Yellow' buttonGroup='backgroundColor' value='{Color.YELLOW}'/> + <JRadioButton text='Green' buttonGroup='backgroundColor' value='{Color.GREEN}'/> + <JRadioButton text='Cyan' buttonGroup='backgroundColor' value='{Color.CYAN}'/> + <JRadioButton text='Blue' buttonGroup='backgroundColor' value='{Color.BLUE}'/> + <JRadioButton text='Purple' buttonGroup='backgroundColor' value='{new Color(160, 30, 255)}'/> + </VBox> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties (rev 0) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-en_GB.properties 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,173 @@ +-= +.= +0= +1= +10= +12= +14= +18= +2= +24= +3= +4= +5= +6= +7= +8= +9= +Age\:= +Animal= +Blue= +Blue\:= +Bold= +Button\ label\:= +C= +CE= +Cancel= +Comments\:= +Config\ file\ \:= +Config\ file\:= +Cyan= +Dec\ (-)= +Demo= +Directory\ file\:= +Editable= +Email\ Address\:= +Email\:= +Empty\ I18n\ editor\:= +Enabled= +EnumEditor\ (country)\ \:= +EnumEditor\ (language)\ \:= +Fancy\ Button= +First\ Name\:= +FirstName\:= +Font\ size= +Fool\ me\ once= +Fool\ me\ twice= +Green= +Green\:= +Greet= +I18n\ editor\ with\ no\ icon\ \:= +I18n\ editor\ with\ no\ text\ \:= +I18n\ editor\:= +Inc\ (+)= +Italic= +JAXX\ Demo= +JMenu\ demo= +Last\ Name\:= +LastName\:= +Locale\ editor\:= +Message\ Box= +Mineral= +Normal\ text\:= +OK= +Orange= +Password\:= +Purple= +Ratio\:= +Red= +Red\:= +Reset= +Show\ Background= +Show\ password\ dialog= +Sign\ on= +Simple\ Button= +Size\:= +Spacing\:= +Start= +Stop= +Supported\ Swing\ components\:= +Text2\:= +Text\:= +Underline= +Upper\ case\ text\:= +Use\ the\ spinner\ to= +Username\:= +Vegetable= +View= +Welcome\ to\ the\ JAXX\ framework\!= +Working\ directory\:= +Yellow= +Your\ name\:= +\\u00f7= +actors= +adjust\ the\ spacing= +between\ these\ lines= +button\ A= +button\ B= +button\ C\ (full\ block)= +button\ D\ (full\ block\ 2)= +cancel= +close=Disable +close2=Disable 2 +close3=Disable 3 +edit=Edit +edit2=Edit 2 +edit3=Edit 3 +form.ratio=Ratio +form.text=Text +form.text2=Text 2 +form2.ratio=Form 2 Ratio +form2.text=Form 2 Text +form2.text2=Form 2 Text 2 +jaxxdemo.about.message=<h3>JAXX Demo</h3>Demo du framework JAXX <hr/><p>Ce projet a \u00E9t\u00E9 r\u00E9alis\u00E9 par la soci\u00E9t\u00E9 <a href\="http\://codelutin.com">Codelutin</a> en 2009.</p><br/><hr/>Pour plus d'informations, vous pouvez visiter le <a href\="http\://maven-site.nuiton.org/jaxx/jaxx-example">site du projet</a>. +jaxxdemo.action.about=About... +jaxxdemo.action.about.tip=About JAXXDemo... +jaxxdemo.action.configuration=Preferences +jaxxdemo.action.configuration.tip=Change the preferences of the application +jaxxdemo.action.exit=Quit +jaxxdemo.action.exit.tip=Quit JAXXDemo +jaxxdemo.action.fullscreen=Full screen +jaxxdemo.action.fullscreen.tip=Change to full screen mode +jaxxdemo.action.help=Help +jaxxdemo.action.help.tip=Display help +jaxxdemo.action.locale.fr=French +jaxxdemo.action.locale.fr.tip=Change to french language +jaxxdemo.action.locale.uk=English +jaxxdemo.action.locale.uk.tip=Change to english language +jaxxdemo.action.normalscreen=Normal screen +jaxxdemo.action.normalscreen.tip=Change to normal screen mode +jaxxdemo.action.site=Web site +jaxxdemo.action.site.tip=Go to the web site +jaxxdemo.config.category.directories=Files +jaxxdemo.config.category.directories.description=Files used by application +jaxxdemo.config.category.other=Others +jaxxdemo.config.category.other.description=Others preferences +jaxxdemo.config.configFileName.description=Configuration file name +jaxxdemo.config.ui.fullscreen=To change the screen mode (true for full screen) +jaxxdemo.config.ui.locale=Locale of the application +jaxxdemo.init.closed=JAXXDemo was closed at %1$s +jaxxdemo.init.context.done=Context initialized in %1$s +jaxxdemo.init.ui.done=UI initialized. +jaxxdemo.menu.file=File +jaxxdemo.menu.file.locale=Languages +jaxxdemo.menu.help=Help +jaxxdemo.message.config.loaded=Configuration of JAXXDemo v. %1$s loaded. +jaxxdemo.message.goto.site=Go to JAXXDemo Web site +jaxxdemo.title.about=About JAXXDemo... +jaxxdemo.tree.component.jaxx=JAXX Components +jaxxdemo.tree.component.jaxx.editor=Editors +jaxxdemo.tree.component.jaxx.tree.navigation=Navigation trees +jaxxdemo.tree.component.swing=Swing Components +jaxxdemo.tree.component.swing.buttons=Buttons +jaxxdemo.tree.component.swing.form=Form elements +jaxxdemo.tree.component.swing.form.text=Text +jaxxdemo.tree.component.swing.layout=Layouts +jaxxdemo.tree.component.swing.menu=Menus +jaxxdemo.tree.component.swing.window=windows +jaxxdemo.tree.feature=Features +jaxxdemo.tree.features.databinding=Data Binding +jaxxdemo.tree.features.validation=Validation +jaxxdemo.tree.fun=Fun +jaxxdemo.warning.nimbus.landf=Could not init nymbus look and feel, you need at leasr version 1.6u10 of java. +jaxxdemo.warning.no.ui=No ui environnement detected +movies=Movies +numbereditor.normal.float=Signed float +numbereditor.normal.int=Signed integer +numbereditor.positive.float=Positive float +numbereditor.positive.int=Positive integer +numbereditor.type=Type +numbereditor.with.auto.popup=With auto popup +numbereditor.without.auto.popup=Without auto popup +valid= +x= Added: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties (rev 0) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo-fr_FR.properties 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,173 @@ +-=- +.=. +0=0 +1=1 +10=10 +12=12 +14=14 +18=18 +2=2 +24=24 +3=3 +4=4 +5=5 +6=6 +7=7 +8=8 +9=9 +Age\:=Age \: +Animal=Animal +Blue=Bleu +Blue\:=bleu \: +Bold=En gras +Button\ label\:=Libell\u00E9 du label +C=C +CE=CE +Cancel=Annuler +Comments\:=Commentaire +Config\ file\ \:=Fichier de configuration +Config\ file\:=Fichier de configuration \: +Cyan=Bleu cyan +Dec\ (-)= +Demo=Demonstration +Directory\ file\:= +Editable=Editable +Email\ Address\:=Courriel +Email\:=Courriel +Empty\ I18n\ editor\:=Editeur I18n vide +Enabled=Activ\u00E9 +EnumEditor\ (country)\ \:=Editeur de pays +EnumEditor\ (language)\ \:=Editeur de langue +Fancy\ Button=Bouton 'Fancy' +First\ Name\:=Pr\u00E9nom +FirstName\:=Pr\u00E9nom \: +Font\ size=Taille de la police +Fool\ me\ once= +Fool\ me\ twice= +Green=Vert +Green\:=Vert \: +Greet= +I18n\ editor\ with\ no\ icon\ \:=Editeur I18n sans icone \: +I18n\ editor\ with\ no\ text\ \:=Editeur I18n sans texte \: +I18n\ editor\:=Editeur I18n +Inc\ (+)=Incr\u00E9menter (+) +Italic=Italique +JAXX\ Demo= +JMenu\ demo= +Last\ Name\:=Nom \: +LastName\:=Nom +Locale\ editor\:=Editeur de locale +Message\ Box= +Mineral= +Normal\ text\:= +OK= +Orange= +Password\:=Mot de passe +Purple=Pourpre +Ratio\:= +Red=Rouge +Red\:=rouge \: +Reset=Reinitialiser +Show\ Background=Voir le fond +Show\ password\ dialog=Voir l'\u00E9diteur de mot de passe +Sign\ on=Signer +Simple\ Button=Bouton simple +Size\:=Taille \: +Spacing\:=Espacement \: +Start=D\u00E9marrer +Stop=Arr\u00EAter +Supported\ Swing\ components\:=Composants Swing support\u00E9s +Text2\:=Text 2 +Text\:=Texte \: +Underline=soulign\u00E9 +Upper\ case\ text\:=Texte en majuscule +Use\ the\ spinner\ to=Utiliser la jauge pour +Username\:=Utilisateur \: +Vegetable=L\u00E9gumes +View=Vue +Welcome\ to\ the\ JAXX\ framework\!=Bienvenu dans le framework JAXX +Working\ directory\:=R\u00E9pertoire de travail +Yellow=Jaune +Your\ name\:=Votre nom \: +\\u00f7= +actors=Acteurs +adjust\ the\ spacing= +between\ these\ lines= +button\ A=Bouton A +button\ B=Bouton B +button\ C\ (full\ block)=Bouton C (blocage compl\u00EAt) +button\ D\ (full\ block\ 2)=Bouton D (blocage compl\u00EAt) +cancel=Annuler +close=Fermer +close2=Fermer 2 +close3=Fermer 3 +edit=Editer +edit2=Editer 2 +edit3=Editer 3 +form.ratio=Form \: ratio +form.text=Form \: text +form.text2=Form \: text2 +form2.ratio=Form2 \: ratio +form2.text=Form2 \: text +form2.text2=Form2 \: text2 +jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>Pour plus d'informations, vous pouvez visiter le <a href\="http\://maven-site.nuiton.org/kaxx/jaxx-demo">site du projet</a>. +jaxxdemo.action.about=A propos +jaxxdemo.action.about.tip=A propos de JAXX Demo... +jaxxdemo.action.configuration=Configuration +jaxxdemo.action.configuration.tip=Modifier la configuration +jaxxdemo.action.exit=Quitter +jaxxdemo.action.exit.tip=Quitter JAXX Demo +jaxxdemo.action.fullscreen=Plein \u00E9cran +jaxxdemo.action.fullscreen.tip=Passer en mode pleine \u00E9cran +jaxxdemo.action.help=Aide +jaxxdemo.action.help.tip=Affichier l'aide +jaxxdemo.action.locale.fr=Fran\u00E7ais +jaxxdemo.action.locale.fr.tip=Changer la langue en fran\u00E7ais +jaxxdemo.action.locale.uk=Anglais +jaxxdemo.action.locale.uk.tip=Changer la langue en anglais +jaxxdemo.action.normalscreen=Ecran normal +jaxxdemo.action.normalscreen.tip=Revenir en mode normal +jaxxdemo.action.site=Site internet +jaxxdemo.action.site.tip=Acc\u00E9der au site de l'application sur internet +jaxxdemo.config.category.directories=R\u00E9pertoires +jaxxdemo.config.category.directories.description=R\u00E9pertoires de l'application +jaxxdemo.config.category.other=Autre +jaxxdemo.config.category.other.description=Autres options +jaxxdemo.config.configFileName.description=Le nom du fichier de configuration +jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine \u00E9cran +jaxxdemo.config.ui.locale=Langue utilis\u00E9e par l'application (fr_FR, en_GB ou es_ES) +jaxxdemo.init.closed=JAXX Demo a \u00E9t\u00E9 ferm\u00E9 \u00E0 %1$s +jaxxdemo.init.context.done=Initialisation du contexte termin\u00E9e en %1$s. +jaxxdemo.init.ui.done=Initialisation de l'interface graphique termin\u00E9e. +jaxxdemo.menu.file=Fichier +jaxxdemo.menu.file.locale=Langues +jaxxdemo.menu.help=Aide +jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s charg\u00E9e. +jaxxdemo.message.goto.site=Acc\u00E9der au site de JAXX Demo (%1$s) +jaxxdemo.title.about=A propos de JAXX Demo... +jaxxdemo.tree.component.jaxx=Composants JAXX +jaxxdemo.tree.component.jaxx.editor=Editeurs +jaxxdemo.tree.component.jaxx.tree.navigation=Arbre de navigation +jaxxdemo.tree.component.swing=Composants Swing +jaxxdemo.tree.component.swing.buttons=Boutons +jaxxdemo.tree.component.swing.form=Elements de formulaire +jaxxdemo.tree.component.swing.form.text=Texte +jaxxdemo.tree.component.swing.layout=Layouts +jaxxdemo.tree.component.swing.menu=Menus +jaxxdemo.tree.component.swing.window=Fen\u00EAtres +jaxxdemo.tree.feature=Fonctionnalit\u00E9s +jaxxdemo.tree.features.databinding=Data binding +jaxxdemo.tree.features.validation=Validation +jaxxdemo.tree.fun=Contestes +jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas \u00E9t\u00E9 trouv\u00E9, il faut au moins la version 1.6u10 de java. +jaxxdemo.warning.no.ui=Aucun environnement graphique d\u00E9tect\u00E9 +movies=Films +numbereditor.normal.float=D\u00E9cimal primitif \: [%1$s] +numbereditor.normal.int=Entier primitif \: [%1$s] +numbereditor.positive.float=D\u00E9cimal primitif positif \: [%1$s] +numbereditor.positive.int=Entier primitif positif \: [%1$s] +numbereditor.type=Type d'\u00E9diteur +numbereditor.with.auto.popup=Avec popup auto +numbereditor.without.auto.popup=Sans popup auto +valid=valide +x=x Added: trunk/jaxx-demo/src/main/resources/icons/action-about.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-about.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-accept.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-accept.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-block.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-block.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-close.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-close.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-config.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-config.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-exit.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-exit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-fullscreen.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-fullscreen.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-help.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-help.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-i18n-fr.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-i18n-fr.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-i18n-uk.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-i18n-uk.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-leave-fullscreen.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-leave-fullscreen.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-show-help.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-show-help.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-site.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-site.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/action-translate.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/action-translate.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/icons/jaxx.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/icons/jaxx.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-error-validation.xml =================================================================== --- trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-error-validation.xml (rev 0) +++ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-error-validation.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,49 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + <field name="firstName"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a firstName.</message> + </field-validator> + </field> + <field name="lastName"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a lastName.</message> + </field-validator> + </field> + + <field name="email"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a value for email.</message> + </field-validator> + <field-validator type="email" short-circuit="true"> + <message>Not a valid e-mail.</message> + </field-validator> + </field> + + <field name="config"> + <field-validator type="requiredFile" short-circuit="true"> + <message>You must enter a value for config.</message> + </field-validator> + <field-validator type="existingFile" short-circuit="true"> + <message>The configuration file ${config} does not exist.</message> + </field-validator> + </field> + + <field name="dir"> + <field-validator type="requiredFile" short-circuit="true"> + <message>You must enter a value for dir.</message> + </field-validator> + <field-validator type="existingDirectory" short-circuit="true"> + <message>The directory ${dir} does not exist.</message> + </field-validator> + </field> + + <field name="age"> + <field-validator type="int"> + <param name="min">18</param> + <message>Your are too young (min ${min} )</message> + </field-validator> + </field> +</validators> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-info-validation.xml =================================================================== --- trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-info-validation.xml (rev 0) +++ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-info-validation.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,49 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + <!--field name="firstName"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a firstName.</message> + </field-validator> + </field> + <field name="lastName"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a lastName.</message> + </field-validator> + </field> + + <field name="email"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a value for email.</message> + </field-validator> + <field-validator type="email" short-circuit="true"> + <message>Not a valid e-mail.</message> + </field-validator> + </field> + + <field name="config"> + <field-validator type="requiredFile" short-circuit="true"> + <message>You must enter a value for config.</message> + </field-validator> + <field-validator type="existingFile" short-circuit="true"> + <message>The configuration file ${config} does not exist.</message> + </field-validator> + </field> + + <field name="dir"> + <field-validator type="requiredFile" short-circuit="true"> + <message>You must enter a value for dir.</message> + </field-validator> + <field-validator type="existingDirectory" short-circuit="true"> + <message>The directory ${dir} does not exist.</message> + </field-validator> + </field--> + + <field name="age"> + <field-validator type="int"> + <param name="min">25</param> + <message>You are still young ( old ${min} ) </message> + </field-validator> + </field> +</validators> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-warning-validation.xml =================================================================== --- trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-warning-validation.xml (rev 0) +++ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Identity-warning-validation.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,49 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + <!--field name="firstName"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a firstName.</message> + </field-validator> + </field> + <field name="lastName"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a lastName.</message> + </field-validator> + </field> + + <field name="email"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a value for email.</message> + </field-validator> + <field-validator type="email" short-circuit="true"> + <message>Not a valid e-mail.</message> + </field-validator> + </field> + + <field name="config"> + <field-validator type="requiredFile" short-circuit="true"> + <message>You must enter a value for config.</message> + </field-validator> + <field-validator type="existingFile" short-circuit="true"> + <message>The configuration file ${config} does not exist.</message> + </field-validator> + </field> + + <field name="dir"> + <field-validator type="requiredFile" short-circuit="true"> + <message>You must enter a value for dir.</message> + </field-validator> + <field-validator type="existingDirectory" short-circuit="true"> + <message>The directory ${dir} does not exist.</message> + </field-validator> + </field--> + + <field name="age"> + <field-validator type="int"> + <param name="max">88</param> + <message>Info : Your are older than ${max} !</message> + </field-validator> + </field> +</validators> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-error-validation.xml =================================================================== --- trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-error-validation.xml (rev 0) +++ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-error-validation.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,35 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + <!-- Field Validators for email field --> + <field name="text"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a value for text.</message> + </field-validator> + </field> + + <field name="text2"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a value for text2.</message> + </field-validator> + </field> + + <field name="ratio"> + <field-validator type="int"> + <param name="min">20</param> + <param name="max">50</param> + <message>Ratio needs to be between ${min} and ${max}</message> + </field-validator> + </field> + + <!-- Plain Validator 1 --> + <validator type="expression"> + <param name="expression">text.startsWith("poussin")</param> + <message>Email not starts with poussin</message> + </validator> + <validator type="expression"> + <param name="expression">text2.startsWith("chemit")</param> + <message>Email not starts with chemit</message> + </validator> +</validators> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-info-validation.xml =================================================================== --- trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-info-validation.xml (rev 0) +++ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-info-validation.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,13 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + <!-- Field Validators for email field --> + <field name="text"> + <field-validator type="fieldexpression"> + <param name="expression"><![CDATA[ text != null && text.length() > 10]]></param> + <message>Text should have more than 10 caracters</message> + </field-validator> + </field> + +</validators> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-warning-validation.xml =================================================================== --- trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-warning-validation.xml (rev 0) +++ trunk/jaxx-demo/src/main/resources/jaxx/demo/feature/validation/Model-warning-validation.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,18 @@ +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + <!-- Field Validators for email field --> + <field name="text"> + <field-validator type="email" short-circuit="true"> + <message>Not a valid e-mail for text.</message> + </field-validator> + </field> + + <field name="text2"> + <field-validator type="requiredstring" short-circuit="true"> + <message>You must enter a value for text2.</message> + </field-validator> + </field> + +</validators> \ No newline at end of file Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Amethyst.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Amethyst.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Lynx.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Lynx.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Tomato.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/Tomato.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/ana.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/ana.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/hector.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/hector.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/jack.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/jack.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/joe.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/joe.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/nacho.jpg =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/nacho.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/nacho2.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/nacho2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/pencil_black.gif =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/main/resources/jaxx/demo/images/pencil_black.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/main/resources/log4j.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/log4j.properties (rev 0) +++ trunk/jaxx-demo/src/main/resources/log4j.properties 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,10 @@ +# 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=%5p [%t] (%F:%L) %M - %m%n + +log4j.logger.jaxx.demo=INFO +#log4j.logger.jaxx.runtime.swing.navigation.NavigationTreeHandler=DEBUG +log4j.logger.org.nuiton=WARN Added: trunk/jaxx-demo/src/site/rst/images/Components-screenshot.gif =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/site/rst/images/Components-screenshot.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/site/rst/images/webstart.gif =================================================================== (Binary files differ) Property changes on: trunk/jaxx-demo/src/site/rst/images/webstart.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-demo/src/site/rst/index.rst =================================================================== --- trunk/jaxx-demo/src/site/rst/index.rst (rev 0) +++ trunk/jaxx-demo/src/site/rst/index.rst 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,43 @@ +=================== +Examples/Components +=================== + +The Components demo displays many different Swing components being used in a variety of ways; it is JAXX's equivalent +of the SwingSet demo. Various pages use advanced features such as data binding, scripting, event handling, and +CSS stylesheets. + +Examples/Calculator +=================== + +This is an implementation of Challenge #2 from the `XUL Grand Coding Challenge 2004`_ . Because this example program +has been implemented in so many different languages, you can easily compare JAXX's +syntax against the competition and decide for yourself which you prefer. + +Screen shot +----------- + +.. image:: images/Components-screenshot.gif + +Set it in action +---------------- + +|webstart| + +To run this example in `Java Web Start`_, click the `following link`_. + +For more details about the `Jaxx Demo webstart`_. + +Source code +----------- + +Unlike the other examples, the source code for Components is too big to display here. You can view it yourself by +downloading JAXX, and you can also view the source code for the individual demos by clicking the "Source" tabs. + + +.. _Java Web Start: http://java.sun.com/products/javawebstart/ + +.. |webstart| image:: images/webstart.gif + +.. _following link: ./launch.jnlp + +.. _Jaxx Demo webstart: jnlp-report.html Added: trunk/jaxx-demo/src/site/site.xml =================================================================== --- trunk/jaxx-demo/src/site/site.xml (rev 0) +++ trunk/jaxx-demo/src/site/site.xml 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="${project.name}"> + + <bannerLeft> + <name>${project.name}</name> + <src>${site.home.url}/jaxx.png</src> + <href>index.html</href> + </bannerLeft> + + <body> + + <breadcrumbs> + <item name="${project.name}" href="${project.url}" /> + </breadcrumbs> + + <menu ref="parent"/> + + <menu name="Utilisateur" inherited="top"> + <item name="Accueil" href="index.html"/> + <item name="Lancer la démo" href="jnlp/launch.jnlp"/> + </menu> + + <menu ref="reports"/> + + <menu ref="modules"/> + + </body> +</project> Added: trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java =================================================================== --- trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java (rev 0) +++ trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java 2009-10-03 23:10:18 UTC (rev 1552) @@ -0,0 +1,37 @@ +package jaxx.demo; + +import jaxx.demo.feature.validation.Model; +import jaxx.demo.feature.validation.Identity; +import java.io.File; +import java.util.Iterator; +import java.util.SortedSet; +import jaxx.runtime.validator.AbstractBeanValidatorDetectorTest; +import jaxx.runtime.validator.BeanValidator; +import org.junit.BeforeClass; +import static org.junit.Assert.*; + +/** + * + * @author chemit + */ +public class BeanValidatorDetectorTest extends AbstractBeanValidatorDetectorTest { + + @BeforeClass + public static void setUpClass() throws Exception { + AbstractBeanValidatorDetectorTest.setUpClass(); + } + + public BeanValidatorDetectorTest() { + // prefer do tests on target copy instead of original files + super(new File(basedir, "target" + File.separator + "classes"), Identity.class, Model.class); + } + + @Override + protected void assertDetect(SortedSet<BeanValidator<?>> validators) { + assertFalse(validators.isEmpty()); + assertEquals(2, validators.size()); + Iterator<BeanValidator<?>> itrV = validators.iterator(); + assertValidator(Identity.class, null, itrV.next()); + assertValidator(Model.class, null, itrV.next()); + } +} Property changes on: trunk/jaxx-demo/src/test/java/jaxx/demo/BeanValidatorDetectorTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL