Author: kmorin Date: 2009-08-25 12:51:11 +0200 (Tue, 25 Aug 2009) New Revision: 1578 Modified: trunk/guix-test-swing/pom.xml trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/Controller.java trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo.guix trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo5.guix Log: Upgrade with new features Modified: trunk/guix-test-swing/pom.xml =================================================================== --- trunk/guix-test-swing/pom.xml 2009-08-25 10:51:02 UTC (rev 1577) +++ trunk/guix-test-swing/pom.xml 2009-08-25 10:51:11 UTC (rev 1578) @@ -35,14 +35,6 @@ <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> - - <!-- sibiling dependencies --> - - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>guix-runtime-swing</artifactId> - <version>${project.version}</version> - </dependency> </dependencies> Modified: trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/Controller.java =================================================================== --- trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/Controller.java 2009-08-25 10:51:02 UTC (rev 1577) +++ trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/Controller.java 2009-08-25 10:51:11 UTC (rev 1578) @@ -17,12 +17,15 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ package org.nuiton.guix.demo; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; public class Controller { private java.lang.String text = "controller"; private int num = 0; private java.lang.String cssText = ""; + private java.beans.PropertyChangeSupport support = new java.beans.PropertyChangeSupport(this); public Controller() { System.out.println("Dude, it's bloody raining"); @@ -37,7 +40,9 @@ } public void setText(java.lang.String text) { + String oldValue = this.text; this.text = text; + support.firePropertyChange("text", oldValue, text); } public int getNum() { @@ -45,7 +50,9 @@ } public void setNum(int num) { + int oldValue = this.num; this.num = num; + support.firePropertyChange("num", oldValue, num); } public java.lang.String getCssText() { @@ -53,7 +60,16 @@ } public void setCssText(java.lang.String cssText) { + String oldValue = this.cssText; this.cssText = cssText; + support.firePropertyChange("cssText", oldValue, cssText); } + public void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { + support.addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String property, java.beans.PropertyChangeListener listener) { + support.addPropertyChangeListener(property, listener); + } } Modified: trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo.guix =================================================================== --- trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo.guix 2009-08-25 10:51:02 UTC (rev 1577) +++ trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo.guix 2009-08-25 10:51:11 UTC (rev 1578) @@ -9,7 +9,7 @@ import java.awt.BorderLayout; import javax.swing.JFrame; -private Button b = new Button("test"); +private JButton b = new JButton("test"); public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, @@ -39,7 +39,7 @@ System.out.println("before Creation"); } -public void beforeBinding() { +public void beforeSettings() { this.add(b, BorderLayout.SOUTH); } @@ -50,7 +50,7 @@ <MenuBar border="new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.RAISED)"> <Menu constructor='"menu 1"'> <MenuItem id="item1" text="item1" /> - <MenuItem text="item2" action='{System.out.println("Action [" + actionEvent.getActionCommand() + <MenuItem text="item2" action='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' /> </Menu> <Menu constructor='"menu 2"'> @@ -58,19 +58,19 @@ </Menu> </MenuBar> <swing:JToolBar> - <Button id="bouton1" onActionPerformed='{System.out.println("Action [" + actionEvent.getActionCommand() + <JButton id="bouton1" onActionPerformed='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' text="bouton1" /> - <Button onActionPerformed='{System.out.println("Action [" + actionEvent.getActionCommand() + <Button onActionPerformed='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' text="bouton2" /> - <Button onActionPerformed='{System.out.println("Action [" + actionEvent.getActionCommand() + <Button onActionPerformed='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' text="bouton3" /> </swing:JToolBar> <gwt:FlowPanel id="gwt"> - <Button id="bouton1" onActionPerformed='{System.out.println("Action [" + actionEvent.getActionCommand() + <Button id="bouton1" onClick='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' text="bouton1" /> - <Button onActionPerformed='{System.out.println("Action [" + actionEvent.getActionCommand() + <Button onClick='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' text="bouton2" /> - <Button onActionPerformed='{System.out.println("Action [" + actionEvent.getActionCommand() + <Button onClick='{System.out.println("Action [" + event.getActionCommand() + "] performed!");}' text="bouton3" /> </gwt:FlowPanel> <TabPanel id="tabPanel"> @@ -81,7 +81,7 @@ <TextField id="textfield" constructor='"test"' enabled="{getGd2().getButton().isSelected() && getGd22().getButton().isSelected()}" onFocus='{System.out.println("dude !")}'/> </Cell> <Cell> - <Label id="label" text="label : {textfield.getText()}" styleClass="bold" /> + <Label id="label" text="label : {textfield.getText()}" visible="{textfield.enabled}" styleClass="bold" /> </Cell> <Cell rows='3'> <Label id="label2" text="color" background="java.awt.Color.BLUE" /> Modified: trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo5.guix =================================================================== --- trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo5.guix 2009-08-25 10:51:02 UTC (rev 1577) +++ trunk/guix-test-swing/src/main/java/org/nuiton/guix/demo/GuixDemo5.guix 2009-08-25 10:51:11 UTC (rev 1578) @@ -4,5 +4,5 @@ <Panel id="panel2"> <Label text="GuixDemo5 inherits GuixDemo2" /> </Panel> - <javax.swing.JCheckBox id="button" text="Push Me again" /> + <CheckBox id="button" text="Push Me again" /> </org.nuiton.guix.demo.GuixDemo2> \ No newline at end of file