r1116 - in lutinjaxx/branches/storm_1/jaxx-example: . src/main src/main/java src/main/java/examples/Components src/main/resources src/main/resources/i18n src/site/fr/rst
Author: tchemit Date: 2009-01-02 11:01:42 +0000 (Fri, 02 Jan 2009) New Revision: 1116 Added: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/examples/ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/images/ lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst Removed: lutinjaxx/branches/storm_1/jaxx-example/Components/ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst Modified: lutinjaxx/branches/storm_1/jaxx-example/pom.xml Log: 1 seul module d'exemple :) Modified: lutinjaxx/branches/storm_1/jaxx-example/pom.xml =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/pom.xml 2009-01-02 08:27:33 UTC (rev 1115) +++ lutinjaxx/branches/storm_1/jaxx-example/pom.xml 2009-01-02 11:01:42 UTC (rev 1116) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -21,30 +22,31 @@ <artifactId>jaxx-runtime-swing</artifactId> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.codelutin</groupId> + <artifactId>jaxx-runtime-validator</artifactId> + <scope>compile</scope> + </dependency> </dependencies> - <modules> - <module>Components</module> - </modules> - <!-- ************************************************************* --> <!-- *** Project Information ************************************* --> <!-- ************************************************************* --> <name>jaxx-example</name> - <description>Jaxx Example super pom</description> + <description>Jaxx Examples</description> <!-- ************************************************************* --> <!-- *** Build Settings ****************************************** --> <!-- ************************************************************* --> - <packaging>pom</packaging> + <packaging>jar</packaging> <properties> <!-- this property must be defined here, since it can be override by a profile --> - <maven.jar.main.class>examples.${project.artifactId}.${project.artifactId}</maven.jar.main.class> + <maven.jar.main.class>examples.Components.Components</maven.jar.main.class> <!-- jnlp --> <keystorepath>${codelutin.keystorepath}</keystorepath> @@ -65,6 +67,22 @@ </scm> <build> + + <resources> + <resource> + <directory>src/main/java</directory> + <includes> + <include>**/*.jaxx</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + <pluginManagement> <plugins> @@ -86,6 +104,29 @@ </plugin> <plugin> + <groupId>org.codelutin</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <configuration> + <entries> + <entry> + <basedir>${maven.gen.dir}/java/</basedir> + <includes> + <param>**\/**.java</param> + </includes> + </entry> + </entries> + </configuration> + <executions> + <execution> + <goals> + <goal>parserJava</goal> + <goal>gen</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> <artifactId>maven-dependency-plugin</artifactId> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> @@ -144,21 +185,29 @@ <phase>compile</phase> <configuration> <tasks> - <mkdir dir="${jnlp.build.directory}" /> - <copy file="${project.basedir}/../src/main/jnlp/sun.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false"> + <mkdir dir="${jnlp.build.directory}"/> + <copy file="${project.basedir}/src/main/jnlp/sun.jnlp" + verbose="${maven.verbose}" todir="${jnlp.build.directory}" + failonerror="false"> <filterset> - <filter token="lib" value="javahelp-2.0.02.jar" /> - <filter token="url" value="${project.url}" /> + <filter token="lib" value="javahelp-2.0.02.jar"/> + <filter token="url" value="${project.url}"/> </filterset> </copy> - <copy file="${project.basedir}/../src/main/jnlp/jxlayer.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false"> + <copy file="${project.basedir}/src/main/jnlp/jxlayer.jnlp" + verbose="${maven.verbose}" todir="${jnlp.build.directory}" + failonerror="false"> <filterset> - <filter token="lib" value="jxlayer-3.0.1.jar" /> - <filter token="url" value="${project.url}" /> + <filter token="lib" value="jxlayer-3.0.1.jar"/> + <filter token="url" value="${project.url}"/> </filterset> </copy> - <copy file="${project.build.directory}/lib/javahelp-2.0.02.jar" verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" failonerror="false" /> - <copy file="${project.build.directory}/lib/jxlayer-3.0.1.jar" verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" failonerror="false" /> + <copy file="${project.build.directory}/lib/javahelp-2.0.02.jar" + verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" + failonerror="false"/> + <copy file="${project.build.directory}/lib/jxlayer-3.0.1.jar" + verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" + failonerror="false"/> </tasks> </configuration> <goals> @@ -171,10 +220,11 @@ <phase>pre-site</phase> <configuration> <tasks> - <mkdir dir="${maven.site.gen.dir}/resources" /> - <copy todir="${maven.site.gen.dir}/resources" verbose="${maven.verbose}" failonerror="false" overwrite="false"> + <mkdir dir="${maven.site.gen.dir}/resources"/> + <copy todir="${maven.site.gen.dir}/resources" verbose="${maven.verbose}" + failonerror="false" overwrite="false"> <fileset dir="${jnlp.build.directory}"> - <include name="**" /> + <include name="**"/> </fileset> </copy> </tasks> @@ -219,17 +269,17 @@ <sign> <keystore>${keystorepath}</keystore> - <keypass /> + <keypass/> <storepass>${keystorepass}</storepass> - <storetype /> + <storetype/> <alias>${keystorealias}</alias> - <validity /> - <dnameCn /> - <dnameOu /> - <dnameO /> - <dnameL /> - <dnameSt /> - <dnameC /> + <validity/> + <dnameCn/> + <dnameOu/> + <dnameO/> + <dnameL/> + <dnameSt/> + <dnameC/> <verify>true</verify> <keystoreConfig> <delete>false</delete> Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples) Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/Calculator.css) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Calculator.css 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,49 @@ + +#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 Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/CalculatorDemo.jaxx) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorDemo.jaxx 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,49 @@ +<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 --> + <examples.Components.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> +</DemoPanel> \ No newline at end of file Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/CalculatorEngine.java) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CalculatorEngine.java 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,165 @@ +package examples.Components; + +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 Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/Components.jaxx 2008-12-30 15:31:02 UTC (rev 1109) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx 2009-01-02 11:01:42 UTC (rev 1116) @@ -1,100 +0,0 @@ -<Application title="Component Demo" width='1024' height='800' defaultCloseOperation='exit_on_close'> - <script><![CDATA[ -protected void changePanel() { - Object value = list.getSelectionValue(); - if (value instanceof DemoPanel) { - cardLayout.show(preview, ((DemoPanel) value).getLabel()); - } -} - -// init i18n -org.codelutin.i18n.I18n.init(); - -]]></script> - <JSplitPane> - <!--JSplitPane dividerLocation='200'--> - <JScrollPane> - <JTree id='list' showsRootHandles='true' onValueChanged='changePanel()' - cellRenderer='{new javax.swing.tree.DefaultTreeCellRenderer() { - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { - if (value instanceof DemoPanel) - value = ((DemoPanel) value).getLabel(); - return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); - } - } - }'> - <item value='Buttons'> - <item value='{buttonDemo}'/> - <item value='{checkBoxDemo}'/> - <item value='{radioButtonDemo}'/> - <item value='{toggleButtonDemo}'/> - </item> - - <item value='Form elements'> - <item value='Text'> - <item value='{passwordFieldDemo}'/> - <item value='{textFieldDemo}'/> - <item value='{textAreaDemo}'/> - </item> - - <item value='{comboBoxDemo}'/> - <item value='{listDemo}'/> - <item value='{sliderDemo}'/> - <item value='{spinnerDemo}'/> - </item> - - <item value='Layout components'> - <item value='{splitPaneDemo}'/> - </item> - - <item value='Menus'> - <item value='{menuItemDemo}'/> - <item value='{checkBoxMenuItemDemo}'/> - <item value='{radioButtonMenuItemDemo}'/> - </item> - - <item value='Windows'> - <item value='{dialogDemo}'/> - </item> - - <item value='{progressBarDemo}'/> - - <item value='{labelStyleDemo}'/> - - <item value='New features'> - <item value='Validation'> - <item value='{validationDemo1}'/> - <item value='{validationDemo2}'/> - </item> - <item value='{dataBindingDemo}'/> - </item> - </JTree> - </JScrollPane> - - <java.awt.CardLayout id='cardLayout'/> - - <JPanel id='preview' layout='{cardLayout}'> - <JButtonDemo id='buttonDemo' constraints='buttonDemo.getLabel()'/> - <JCheckBoxDemo id='checkBoxDemo' constraints='checkBoxDemo.getLabel()'/> - <JCheckBoxMenuItemDemo id='checkBoxMenuItemDemo' constraints='checkBoxMenuItemDemo.getLabel()'/> - <JComboBoxDemo id='comboBoxDemo' constraints='comboBoxDemo.getLabel()'/> - <JDialogDemo id='dialogDemo' constraints='dialogDemo.getLabel()'/> - <JListDemo id='listDemo' constraints='listDemo.getLabel()'/> - <JMenuItemDemo id='menuItemDemo' constraints='menuItemDemo.getLabel()'/> - <JPasswordFieldDemo id='passwordFieldDemo' constraints='passwordFieldDemo.getLabel()'/> - <JProgressBarDemo id='progressBarDemo' constraints='progressBarDemo.getLabel()'/> - <JSliderDemo id='sliderDemo' constraints='sliderDemo.getLabel()'/> - <JSpinnerDemo id='spinnerDemo' constraints='spinnerDemo.getLabel()'/> - <JSplitPaneDemo id='splitPaneDemo' constraints='splitPaneDemo.getLabel()'/> - <JRadioButtonDemo id='radioButtonDemo' constraints='radioButtonDemo.getLabel()'/> - <JRadioButtonMenuItemDemo id='radioButtonMenuItemDemo' constraints='radioButtonMenuItemDemo.getLabel()'/> - <JToggleButtonDemo id='toggleButtonDemo' constraints='toggleButtonDemo.getLabel()'/> - <JTextFieldDemo id='textFieldDemo' constraints='textFieldDemo.getLabel()'/> - <JTextAreaDemo id='textAreaDemo' constraints='textAreaDemo.getLabel()'/> - <ValidationListDemo id='validationDemo1' constraints='validationDemo1.getLabel()'/> - <ValidationTableDemo id='validationDemo2' constraints='validationDemo2.getLabel()'/> - <BeanDataBindingDemo id='dataBindingDemo' constraints='dataBindingDemo.getLabel()'/> - <LabelStyleDemo id='labelStyleDemo' constraints='labelStyleDemo.getLabel()'/> - </JPanel> - </JSplitPane> -</Application> \ No newline at end of file Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/Components.jaxx) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/Components.jaxx 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,108 @@ +<Application title="Component Demo" width='1024' height='800' defaultCloseOperation='exit_on_close'> + <script><![CDATA[ +protected void changePanel() { + Object value = list.getSelectionValue(); + if (value instanceof DemoPanel) { + cardLayout.show(preview, ((DemoPanel) value).getLabel()); + } +} + +// init i18n +org.codelutin.i18n.I18n.init(); + +]]></script> + <JSplitPane> + <!--JSplitPane dividerLocation='200'--> + <JScrollPane> + <JTree id='list' showsRootHandles='true' onValueChanged='changePanel()' + cellRenderer='{new javax.swing.tree.DefaultTreeCellRenderer() { + public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { + if (value instanceof DemoPanel) + value = ((DemoPanel) value).getLabel(); + return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); + } + } + }'> + <item value="Components"> + <item value='Buttons'> + <item value='{buttonDemo}'/> + <item value='{checkBoxDemo}'/> + <item value='{radioButtonDemo}'/> + <item value='{toggleButtonDemo}'/> + </item> + + <item value='Form elements'> + <item value='Text'> + <item value='{passwordFieldDemo}'/> + <item value='{textFieldDemo}'/> + <item value='{textAreaDemo}'/> + </item> + + <item value='{comboBoxDemo}'/> + <item value='{listDemo}'/> + <item value='{sliderDemo}'/> + <item value='{spinnerDemo}'/> + </item> + + <item value='Layout components'> + <item value='{splitPaneDemo}'/> + </item> + + <item value='Menus'> + <item value='{menuItemDemo}'/> + <item value='{checkBoxMenuItemDemo}'/> + <item value='{radioButtonMenuItemDemo}'/> + </item> + + <item value='Windows'> + <item value='{dialogDemo}'/> + </item> + + <item value='{progressBarDemo}'/> + + </item> + + <item value='{labelStyleDemo}'/> + + <item value='{counterDemo}'/> + <item value='{calculatorDemo}'/> + + <item value='New features'> + <item value='Validation'> + <item value='{validationDemo1}'/> + <item value='{validationDemo2}'/> + </item> + <item value='{dataBindingDemo}'/> + </item> + </JTree> + </JScrollPane> + + <java.awt.CardLayout id='cardLayout'/> + + <JPanel id='preview' layout='{cardLayout}'> + <JButtonDemo id='buttonDemo' constraints='buttonDemo.getLabel()'/> + <JCheckBoxDemo id='checkBoxDemo' constraints='checkBoxDemo.getLabel()'/> + <JCheckBoxMenuItemDemo id='checkBoxMenuItemDemo' constraints='checkBoxMenuItemDemo.getLabel()'/> + <JComboBoxDemo id='comboBoxDemo' constraints='comboBoxDemo.getLabel()'/> + <JDialogDemo id='dialogDemo' constraints='dialogDemo.getLabel()'/> + <JListDemo id='listDemo' constraints='listDemo.getLabel()'/> + <JMenuItemDemo id='menuItemDemo' constraints='menuItemDemo.getLabel()'/> + <JPasswordFieldDemo id='passwordFieldDemo' constraints='passwordFieldDemo.getLabel()'/> + <JProgressBarDemo id='progressBarDemo' constraints='progressBarDemo.getLabel()'/> + <JSliderDemo id='sliderDemo' constraints='sliderDemo.getLabel()'/> + <JSpinnerDemo id='spinnerDemo' constraints='spinnerDemo.getLabel()'/> + <JSplitPaneDemo id='splitPaneDemo' constraints='splitPaneDemo.getLabel()'/> + <JRadioButtonDemo id='radioButtonDemo' constraints='radioButtonDemo.getLabel()'/> + <JRadioButtonMenuItemDemo id='radioButtonMenuItemDemo' constraints='radioButtonMenuItemDemo.getLabel()'/> + <JToggleButtonDemo id='toggleButtonDemo' constraints='toggleButtonDemo.getLabel()'/> + <JTextFieldDemo id='textFieldDemo' constraints='textFieldDemo.getLabel()'/> + <JTextAreaDemo id='textAreaDemo' constraints='textAreaDemo.getLabel()'/> + <ValidationListDemo id='validationDemo1' constraints='validationDemo1.getLabel()'/> + <ValidationTableDemo id='validationDemo2' constraints='validationDemo2.getLabel()'/> + <BeanDataBindingDemo id='dataBindingDemo' constraints='dataBindingDemo.getLabel()'/> + <LabelStyleDemo id='labelStyleDemo' constraints='labelStyleDemo.getLabel()'/> + <CounterDemo id='counterDemo' constraints='counterDemo.getLabel()'/> + <CalculatorDemo id='calculatorDemo' constraints='calculatorDemo.getLabel()'/> + </JPanel> + </JSplitPane> +</Application> \ No newline at end of file Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/java/examples/Components/CounterDemo.jaxx) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/java/examples/Components/CounterDemo.jaxx 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,12 @@ +<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> + +</DemoPanel> \ No newline at end of file Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/examples (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/examples) Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n) Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-en_GB.properties 2008-12-30 15:31:02 UTC (rev 1109) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties 2009-01-02 11:01:42 UTC (rev 1116) @@ -1,83 +0,0 @@ -1= -10= -12= -14= -18= -2= -24= -3= -Age\:= -Animal= -Blue= -Blue\:= -Bold= -Button\ label\:= -Cancel= -Comments\:= -Component\ Demo= -Config\ file\ \:= -Config\ file\:= -Cyan= -Demo= -Directory\ file\:= -Editable= -Email\ Address\:= -Email\:= -Enabled= -Fancy\ Button= -First\ Name\:= -FirstName\:= -Font\ size= -Green= -Green\:= -Greet= -Italic= -JMenu\ demo= -Last\ Name\:= -LastName\:= -Message\ Box= -Mineral= -Normal\ text\:= -OK= -Orange= -Password\:= -Purple= -Ratio\:= -Red= -Red\:= -Show\ Background= -Show\ password\ dialog= -Sign\ on= -Simple\ Button= -Size\:= -Source= -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\:= -adjust\ the\ spacing= -between\ these\ lines= -cancel= -close= -close2= -close3= -edit= -edit2= -edit3= -ttt= -valid= -validator.field=Champ -validator.message=Message -validator.scope=... Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-en_GB.properties) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-en_GB.properties 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,99 @@ +-= +.= +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\:= +Component\ Demo= +Config\ file\ \:= +Config\ file\:= +Cyan= +Dec\ (-)= +Demo= +Directory\ file\:= +Editable= +Email\ Address\:= +Email\:= +Enabled= +Fancy\ Button= +First\ Name\:= +FirstName\:= +Font\ size= +Green= +Green\:= +Greet= +Inc\ (+)= +Italic= +JMenu\ demo= +Last\ Name\:= +LastName\:= +Message\ Box= +Mineral= +Normal\ text\:= +OK= +Orange= +Password\:= +Purple= +Ratio\:= +Red= +Red\:= +Reset= +Show\ Background= +Show\ password\ dialog= +Sign\ on= +Simple\ Button= +Size\:= +Source= +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= +adjust\ the\ spacing= +between\ these\ lines= +cancel= +close= +close2= +close3= +edit= +edit2= +edit3= +ttt= +valid= +validator.field=Champ +validator.message=Message +validator.scope=... +x= Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-fr_FR.properties 2008-12-30 15:31:02 UTC (rev 1109) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties 2009-01-02 11:01:42 UTC (rev 1116) @@ -1,83 +0,0 @@ -1= -10= -12= -14= -18= -2= -24= -3= -Age\:= -Animal= -Blue= -Blue\:= -Bold= -Button\ label\:= -Cancel= -Comments\:= -Component\ Demo= -Config\ file\ \:= -Config\ file\:= -Cyan= -Demo= -Directory\ file\:= -Editable= -Email\ Address\:= -Email\:= -Enabled= -Fancy\ Button= -First\ Name\:= -FirstName\:= -Font\ size= -Green= -Green\:= -Greet= -Italic= -JMenu\ demo= -Last\ Name\:= -LastName\:= -Message\ Box= -Mineral= -Normal\ text\:= -OK= -Orange= -Password\:= -Purple= -Ratio\:= -Red= -Red\:= -Show\ Background= -Show\ password\ dialog= -Sign\ on= -Simple\ Button= -Size\:= -Source= -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\:= -adjust\ the\ spacing= -between\ these\ lines= -cancel= -close= -close2= -close3= -edit= -edit2= -edit3= -ttt= -valid= -validator.field=Champ -validator.message=Message -validator.scope=... Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/i18n/Components-fr_FR.properties) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/i18n/Components-fr_FR.properties 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,99 @@ +-= +.= +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\:= +Component\ Demo= +Config\ file\ \:= +Config\ file\:= +Cyan= +Dec\ (-)= +Demo= +Directory\ file\:= +Editable= +Email\ Address\:= +Email\:= +Enabled= +Fancy\ Button= +First\ Name\:= +FirstName\:= +Font\ size= +Green= +Green\:= +Greet= +Inc\ (+)= +Italic= +JMenu\ demo= +Last\ Name\:= +LastName\:= +Message\ Box= +Mineral= +Normal\ text\:= +OK= +Orange= +Password\:= +Purple= +Ratio\:= +Red= +Red\:= +Reset= +Show\ Background= +Show\ password\ dialog= +Sign\ on= +Simple\ Button= +Size\:= +Source= +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= +adjust\ the\ spacing= +between\ these\ lines= +cancel= +close= +close2= +close3= +edit= +edit2= +edit3= +ttt= +valid= +validator.field=Champ +validator.message=Message +validator.scope=... +x= Copied: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/main/resources/log4j.properties) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,9 @@ +# Global logging configuration +log4j.rootLogger=INFO, 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.org.codelutin.jaxx=DEBUG +log4j.logger.examples=DEBUG Property changes on: lutinjaxx/branches/storm_1/jaxx-example/src/main/resources/log4j.properties ___________________________________________________________________ Name: svn:mergeinfo + Copied: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/images (from rev 1109, lutinjaxx/branches/storm_1/jaxx-example/Components/src/site/fr/rst/images) Deleted: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst 2009-01-02 08:27:33 UTC (rev 1115) +++ lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst 2009-01-02 11:01:42 UTC (rev 1116) @@ -1,28 +0,0 @@ -======== -Exemples -======== - -Here are some simple example programs to give you an idea of what JAXX is all about: - - * JAXXEdit - A complete application written using JAXX for the GUI. - - * Components_ - Comprehensive demo which displays most of the Swing components. Demonstrates every major feature of JAXX, including data binding, scripting, and CSS stylesheets. - - * LabelStyles_ - Uses data binding to edit the appearance of a JLabel. Shows off the power and usefulness of data binding well. - - * Calculator_ - Four-function calculator. Based on the XUL Grand Coding Challenge. - - * Counter_ - simple data binding and scripting example. Based on the XUL Grand Coding Challenge. - - * Validation_ - simple data validation with xworks and jxlayer. - -.. _Components: Components/index.html - -.. _LabelStyles: LabelStyle/index.html - -.. _Calculator: Calculator/index.html - -.. _Counter: Counter/index.html - -.. _Validation: Validation/index.html \ No newline at end of file Copied: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst (from rev 1111, lutinjaxx/branches/storm_1/jaxx-example/Components/src/site/fr/rst/index.rst) =================================================================== --- lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst (rev 0) +++ lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst 2009-01-02 11:01:42 UTC (rev 1116) @@ -0,0 +1,40 @@ +=================== +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`_. + + +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-Components.jnlp Property changes on: lutinjaxx/branches/storm_1/jaxx-example/src/site/fr/rst/index.rst ___________________________________________________________________ Name: svn:mergeinfo +
participants (1)
-
tchemit@users.labs.libre-entreprise.org