Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java diff -u topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java:1.5 topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java:1.6 --- topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java:1.5 Wed Jun 23 15:44:25 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityPanel.java Tue Jun 29 15:59:06 2004 @@ -23,23 +23,27 @@ * * @author Benjamin Poussin * Copyright Code Lutin -* @version $Revision: 1.5 $ +* @version $Revision: 1.6 $ * -* Mise a jour: $Date: 2004/06/23 15:44:25 $ +* Mise a jour: $Date: 2004/06/29 15:59:06 $ * par : $Author: mazelier $ */ package org.codelutin.topia.generators.ui; -import java.io.File; -import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.topia.generators.Util; +import org.codelutin.generator.ObjectModelGeneratorWithCapitalizeName; import org.codelutin.generator.models.object.ObjectModel; import org.codelutin.generator.models.object.ObjectModelClass; +import org.codelutin.generator.models.object.ObjectModelAttribute; + +import java.io.File; import java.io.Writer; import java.io.IOException; -import org.codelutin.topia.generators.Util; +import java.util.ArrayList; +import java.util.Iterator; -public class ObjectModelToEntityPanel extends ObjectModelGenerator { // ObjectModelToEntityPanel +public class ObjectModelToEntityPanel extends ObjectModelGeneratorWithCapitalizeName { // ObjectModelToEntityPanel public String getFilenameForClass(ObjectModelClass clazz) { return (clazz.getPackageName() + ".ui.") @@ -53,31 +57,45 @@ if (!"".equals(clazz.getPackageName())) { /*{ -package <%=clazz.getPackageName()%>.ui; +/** +* Generated: by ToPIA Framework +* Copyright Code Lutin +* http://www.codelutin.com +*) -import org.codelutin.topia.TopiaContext; -import org.codelutin.topia.TopiaException; +package <%=clazz.getPackageName()%>.ui; }*/ } /*{ - public class <%=clazz.getName()%>Panel extends <%=clazz.getName()%>PanelUI { +public class <%=clazz.getName()%>Panel extends <%=clazz.getName()%>PanelUI { + + public <%=clazz.getName()%>Panel(){ + init(); + } - public <%=clazz.getName()%>Panel(){ - init(); - } - - - public void on_save(){ - // TODO a implanter - System.out.println("on_save"); - } - - public void on_cancel(){ - // TODO a implanter - System.out.println("on_cancel"); - } + public void on_save(){ + // TODO a implanter + System.out.println("on_save"); } + + public void on_cancel(){ + // TODO a implanter + System.out.println("on_cancel"); + } +}*/ + +for(Iterator i=clazz.getAttributes().iterator(); i.hasNext();) { + ObjectModelAttribute att = (ObjectModelAttribute)i.next(); +/*{ + public void on_add<%=capitalizeName(att)%>Entities(){ + // TODO a implanter + System.out.println("on_add<%=capitalizeName(att)%>Entities"); + } +}*/ +} +/*{ +} }*/ } } Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java diff -u topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.15 topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.16 --- topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.15 Fri Jun 25 16:11:20 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java Tue Jun 29 15:59:06 2004 @@ -23,22 +23,25 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ * - * Mise a jour: $Date: 2004/06/25 16:11:20 $ + * Mise a jour: $Date: 2004/06/29 15:59:06 $ * par : $Author: mazelier $ */ package org.codelutin.topia.generators.ui; +import org.codelutin.topia.generators.Util; import org.codelutin.generator.ObjectModelGeneratorWithCapitalizeName; import org.codelutin.generator.models.object.ObjectModelClass; import org.codelutin.generator.models.object.ObjectModelAttribute; + import java.io.File; import java.io.Writer; import java.io.IOException; + import java.util.Iterator; -import org.codelutin.topia.generators.Util; + /** * Ce g�n�rateur permet de g�n�rer des interfaces par defaut de saisie et de @@ -50,9 +53,6 @@ public String getFilenameForClass(ObjectModelClass clazz) { // put .uimodel file in uimodel directory return ".." + File.separator + "uimodel" + File.separator + clazz.getName() + ".uimodel"; -// return (clazz.getPackageName() + ".ui.") -// .replace('.', File.separatorChar) -// + clazz.getName() + ".uimodel"; } public void generateFromClass(Writer output, ObjectModelClass clazz) @@ -154,7 +154,7 @@ 0.0 0.0 10 - 0 + 1 0 @@ -306,10 +306,10 @@ <%=counterArguments%> 1 1 - 0.0 - 0.0 + 1.0 + 1.0 10 - 0 + 1 0 @@ -332,16 +332,27 @@ * todo il faudra creer un model * Genere une combobox */ - public void generateEntityEditor(Writer output, ObjectModelAttribute att, int counterArguments) - throws IOException { - /*{ + public void generateEntityEditor(Writer output, ObjectModelAttribute att, + int counterArguments) throws IOException { + +/*{ +}*/ + if (att.getMaxMultiplicity()>1 || att.getMaxMultiplicity()==-1){ +/*{ + +}*/ + }else{ +/*{ +}*/ + } +/*{ - <%=att.getName()+"Editor"%> + <%=att.getName()%>Editor @@ -353,6 +364,61 @@ <%=counterArguments%> 1 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + + + + add<%=capitalizeName(att)%>Entities + + + + + Add + + +}*/ + ObjectModelAttribute attRev = att.getReverseAttribute(); + if (attRev != null && attRev.getMinMultiplicity()>=1){ +/*{ + + + false + + +}*/ + } +/*{ + + + + + + + + + 2 + <%= counterArguments %> + 1 + 1 0.0 0.0 10 @@ -369,7 +435,7 @@ 0 - + }*/ } @@ -379,7 +445,7 @@ */ public void generateBooleanEditor(Writer output, ObjectModelAttribute att, int counterArguments) throws IOException { - /*{ +/*{ @@ -401,7 +467,7 @@ 0.0 0.0 10 - 0 + 1 0 @@ -450,10 +516,10 @@ <%=counterArguments%> 1 1 - 0.0 - 0.0 + 1.0 + 1.0 10 - 0 + 1 0 Index: topia/src/java/org/codelutin/topia/generators/ui/UIModelToUICallbackSwingGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/ui/UIModelToUICallbackSwingGenerator.java:1.6 topia/src/java/org/codelutin/topia/generators/ui/UIModelToUICallbackSwingGenerator.java:1.7 --- topia/src/java/org/codelutin/topia/generators/ui/UIModelToUICallbackSwingGenerator.java:1.6 Fri Jun 25 16:11:20 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/UIModelToUICallbackSwingGenerator.java Tue Jun 29 15:59:06 2004 @@ -23,9 +23,9 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * - * Mise a jour: $Date: 2004/06/25 16:11:20 $ + * Mise a jour: $Date: 2004/06/29 15:59:06 $ * par : $Author: mazelier $ */ @@ -65,13 +65,13 @@ // ------------- File Header if (!model.getPackage().equals("")) { /*{ -// | Generated: by ToPIA Framework -// | Copyright Code Lutin -// | http://www.codelutin.com - - -package <%=Util.getParentPackageName(model.getPackage())%>.ui; +/** +* Generated: by ToPIA Framework +* Copyright Code Lutin +* http://www.codelutin.com + *) +package <%=model.getPackage()%>; }*/ } // ------------- Imports Index: topia/src/java/org/codelutin/topia/generators/ui/UIModelToUISwingGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/ui/UIModelToUISwingGenerator.java:1.8 topia/src/java/org/codelutin/topia/generators/ui/UIModelToUISwingGenerator.java:1.9 --- topia/src/java/org/codelutin/topia/generators/ui/UIModelToUISwingGenerator.java:1.8 Fri Jun 25 16:11:20 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/UIModelToUISwingGenerator.java Tue Jun 29 15:59:06 2004 @@ -23,9 +23,9 @@ * * @author Benjamin Poussin * Copyright Code Lutin -* @version $Revision: 1.8 $ +* @version $Revision: 1.9 $ * -* Mise a jour: $Date: 2004/06/25 16:11:20 $ +* Mise a jour: $Date: 2004/06/29 15:59:06 $ * par : $Author: mazelier $ */ @@ -89,14 +89,13 @@ // ------------- File Header if (!object.getModel().getPackage().equals("")) { /*{ +/** +* Generated: by ToPIA Framework +* Copyright Code Lutin +* http://www.codelutin.com + *) -/** Generated: by ToPIA Framework -* Copyright Code Lutin -* http://www.codelutin.com -*) - -package <%=Util.getParentPackageName(object.getModel().getPackage())%>.ui; -package <%=object.getModel().getPackage()%>.ui; +package <%=object.getModel().getPackage()%>; }*/ } @@ -104,7 +103,7 @@ /*{ import org.codelutin.topia.TopiaException; -//import org.codelutin.i18n.I18n; +import org.codelutin.i18n.I18n; import java.util.ArrayList; import java.util.Iterator; @@ -115,8 +114,6 @@ import javax.swing.RootPaneContainer; import java.beans.EventHandler; - - public abstract class <%=capitalizeName(object)%>UI extends <%=object.getType()%> implements <%=capitalizeName(object)%>UICallback { }*/ //creation des constructeurs selon le type de l'objet @@ -148,6 +145,7 @@ generateConstructorStatement(output, object); /*{ + public void init() { <%=capitalizeName(object)%>UI result = this; }*/ @@ -252,20 +250,24 @@ throws IOException { ArrayList args = (ArrayList)object.getArguments(); - if (args.size() == 0 ){ + if (args.size() == 0){ + if (!(object.getType().equals("javax.swing.JFrame")) + && !(object.getType().equals("javax.swing.JDialog"))){ + /*{ public <%=capitalizeName(object)%>UI(){ super(); } - }*/ + } }else{ + /*{ - public <%=capitalizeName(object)%>UI( }*/ + public <%=capitalizeName(object)%>UI(}*/ generateArgumentStatement(output, object); - /*{ ){ + /*{){ super(}*/generateArgumentStatement(output, object);/*{); } }*/