Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityAttributesUIModel.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityAttributesUIModel.java:1.3 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityAttributesUIModel.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,469 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * 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 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectModelToEntityAttributesUIModel.java + * + * Created: Jul 2, 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.3 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.ui; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; + +import org.codelutin.generator.AbstractObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModelAttribute; +import org.codelutin.generator.models.object.ObjectModelClass; + +import java.util.ArrayList; + +//,org.codelutin.topia.generators.ui.ObjectModelToEntityTableUIModel,org.codelutin.topia.generators.ObjectModelToTJDOGenerator,org.codelutin.topia.generators.ObjectModelToUIModelGenerator +/** +* Ce generateur permet de generer un panel de saisie +* avec l'ensemble des attributs de la classe +*/ +public class ObjectModelToEntityAttributesUIModel extends AbstractObjectModelGenerator{ // ObjectModelToEntityAttributesUIModel + + public String getFilenameForClass(ObjectModelClass clazz) { + // put .uimodel file in uimodel directory + return ".." + File.separator + "uimodel" + File.separator + capitalizeName(clazz) + "AttributesPanel.uimodel"; + } + + /** + * Genere un panel appele AttributesPanel + */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + + if(Util.isEntity(clazz)){ +/*{ + + + package="<%=clazz.getPackageName()%>.ui"<% } %>> + + + + + <%=clazz.getName()%>AttributesPanel + + + + + + + + + + }*/ + int counterArguments = 1; + for(Iterator i=clazz.getSuperclasses().iterator(); i.hasNext();) { + ObjectModelClass parent = (ObjectModelClass)i.next(); +/*{ + + + + + + + <%=capitalizeName(parent)%>Attributes + + + + + + + + 0 + <%=counterArguments%> + 3 + 1 + 0.0 + 0.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + +}*/ + counterArguments++; + } + for(Iterator i=clazz.getAttributes().iterator(); i.hasNext();) { + ObjectModelAttribute att = (ObjectModelAttribute)i.next(); + /*{ + + + + + + + <%=att.getName()+"Label"%> + + + + + <%=capitalizeName(att)%> + + + + + + + + 0 + <%=counterArguments%> + 1 + 1 + 0.0 + 0.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + }*/ + if(att.referenceClassifier()){ + generateEntityEditor(output, att, counterArguments); + }else if(att.getType().equalsIgnoreCase("boolean")){ + generateBooleanEditor(output, att, counterArguments); + }else if(att.getType().equalsIgnoreCase("char")){ + generateCharEditor(output, att, counterArguments); + }else{ + generateDefaultEditor(output, att, counterArguments); + } + counterArguments++; + } +/*{ + + + + +}*/ + } + } + + + /** + * Genere un JTextField : element par defaut + */ + public void generateDefaultEditor(Writer output, ObjectModelAttribute att, int counterArguments) + throws IOException { + /*{ + + + + + + + 6 + + + + + <%=att.getName()+"Editor"%> + + + + + + + + 1 + <%=counterArguments%> + 1 + 1 + 1.0 + 1.0 + 10 + 2 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + }*/ + } + + + /** + * todo il faudra creer un model + * Genere une combobox ou une Jlist tout depend la multiplicite de l'attribut + * de l'association + */ + public void generateEntityEditor(Writer output, ObjectModelAttribute att, + int counterArguments) throws IOException { + +/*{ + + +}*/ + if (att.getMaxMultiplicity()>1 || att.getMaxMultiplicity()==-1){ +/*{ + + + + +}*/ + }else{ +/*{ + + + + +}*/ + } +/*{ + + + + <%=att.getName()%>Editor + + + + + + + + 1 + <%=counterArguments%> + 1 + 1 + 1.0 + 0.0 + 10 + 2 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + +}*/ + if (att.getMaxMultiplicity()>1 || att.getMaxMultiplicity()==-1){ +/*{ + + + + + + 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 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + }*/ + } + } + + /** + * Genere une checkbox + */ + public void generateBooleanEditor(Writer output, ObjectModelAttribute att, int counterArguments) + throws IOException { +/*{ + + + + + + + <%=att.getName()%>Editor + + + + + + + + 1 + <%=counterArguments%> + 1 + 1 + 0.0 + 0.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + }*/ + } + + /** + * todo faudra peut etre creer un editor + * Genere un JTextField (normalement avec 1 char) + */ + public void generateCharEditor(Writer output, ObjectModelAttribute att, + int counterArguments) throws IOException { + /*{ + + + + + + + 1 + + + + + <%=att.getName()%>Editor + + + + + + + + 1 + <%=counterArguments%> + 1 + 1 + 1.0 + 1.0 + 10 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + }*/ + } + + +} // ObjectModelToEntityAttributesUIModel + Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityTableUIModel.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityTableUIModel.java:1.3 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityTableUIModel.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,134 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * 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 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectModelToEntityTableUIModel.java + * + * Created: Jul 2, 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.3 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.ui; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; + +import org.codelutin.generator.AbstractObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModelAttribute; +import org.codelutin.generator.models.object.ObjectModelClass; + +/** +* Ce generateur permet de generer un panel compose d'une table pour permettre la +* recherche, selection d'element +*/ +public class ObjectModelToEntityTableUIModel extends AbstractObjectModelGenerator{ // ObjectModelToEntityTableUIModel + + public String getFilenameForClass(ObjectModelClass clazz) { + // put .uimodel file in uimodel directory + return ".." + File.separator + "uimodel" + File.separator + capitalizeName(clazz) + "TablePanel.uimodel"; + } + + /** + * Genere un panel de recherche appele searchPanel + */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + + if(Util.isEntity(clazz)){ +/*{ + + + package="<%=clazz.getPackageName()%>.ui"<% } %>> + + + + + <%=clazz.getName()%>TablePanel + + + + + + + + + + + + + + + + + + + + + + <%=clazz.getName()%>ScrollPane + + + + + + + + 0 + 0 + 1 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + +}*/ + } + } + +} // ObjectModelToEntityTableUIModel + Index: topia/src/java/org/codelutin/topia/generators/ui/package.html diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/package.html:1.3 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/package.html Fri Jul 30 14:38:59 2004 @@ -0,0 +1,47 @@ + + +

Générateur d'interface

+

+Ce package contient les générateurs d'interface à partir du modèle objet et à +partir du modèle ui. +

+ +

Génération à partir du modèle ui

+

+Cette génération est composé de deux générateur. +

+

+Le premier génère une interface contenant toutes les méthodes de callback dont +l'interface graphique a besoin. Par exemple le clique sur un bouton, l'appuie +sur une touche, la sélection dans une liste, .... Tout ces évènements appellent +une méthode lorsqu'ils ont lieu. Le nom du fichier généré prend le nom du +fichier .uimodel en lui ajoutant UICallback. +

+

+Le second générateur implante l'interface UICallback, mais celle-ci est +abstraite car elle n'implante pas les méthodes de l'interface. Son nom est +celui du fichier .uimodel suivi de UI. On retrouve dans cette classe tous les +widgets graphiques de l'interface. Il sont tous disponible par une méthode +d'accès, cette méthode porte le nom du widget précédé de get. Donc pour un +widget JButton de nom saveButton nous aurons la méthode +getSaveButton():JButton +

+ +

Génération à partir du modèle objet

+

+Cette génération est composée de deux générateur +{@link ObjectModelToEntityUIModel} et {@link ObjectModelToEntityPanel}. +

+

+Le premier permet de générer l'interface graphique de saisie modification sous +le format du modèle ui qui sera alors utilisé par la génération à partir de +ce modèle. +

+

+Le second générateur permet de générer une classe concrète elle étendra la +classe UI. Elle finira d'initialiser l'interface graphique, de mettre en place +des modèles de composant graphique pour ce connecter aux données, ... Cette +classe étant la classe générée à partir du modèle ui. +

+ + Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToWidgetsXML.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToWidgetsXML.java:1.8 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToWidgetsXML.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,86 @@ +/* *##% +* Copyright (C) 2002, 2003 Code Lutin +* +* 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 2 +* 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 Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* ObjectModelToWidgetsXML.java +* +* Created: Jun 16, 2004 +* +* @author Benjamin Poussin +* Copyright Code Lutin +* @version $Revision: 1.8 $ +* +* Mise a jour: $Date: 2004/07/30 14:38:59 $ +* par : $Author: pineau $ +*/ + +package org.codelutin.topia.generators.ui; + +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; + +import org.codelutin.generator.AbstractObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; +import org.codelutin.generator.models.object.ObjectModelClass; + +/** +* Cette classe permet de generer un fichier xml de type Buix, ainsi ce fichier +* pourra etre charge et le panel genere dans Topia pourra apparaitre dans la palette +* de Buix +*/ +public class ObjectModelToWidgetsXML extends AbstractObjectModelGenerator{ // ObjectModelToWidgetsXML + + public String getFilenameForModel(ObjectModel model) { + return model.getName()+"-widgets.xml"; + } + + public void generateFromModel(Writer output, ObjectModel model) throws IOException { + +/*{ + +}*/ + Iterator classes = model.getClasses().iterator(); + while (classes.hasNext()) { + ObjectModelClass clazz = (ObjectModelClass) classes.next(); + generate(output, clazz, model); + } +/*{ + +}*/ + + } + + /** + * Creation d'un tag pour chaque class du model + */ + public void generate(Writer output, ObjectModelClass clazz, + ObjectModel model) throws IOException{ + + if(! Util.isEntity(clazz)) return; +/*{ + + + + +}*/ + + } + +} // ObjectModelToWidgetsXML + Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java:1.21 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntityUIModel.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,214 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * 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 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectModelToEntityUIModel.java + * + * Created: 1 mai 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.21 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.ui; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; + +import org.codelutin.generator.AbstractObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModelAttribute; +import org.codelutin.generator.models.object.ObjectModelClass; + + +/** +* Ce generateur permet de generer l'interface globale (saisie, modification, +* recherche, suppression des Entities) +*/ +public class ObjectModelToEntityUIModel extends AbstractObjectModelGenerator { // ObjectModelToEntityUIModel + + public String getFilenameForClass(ObjectModelClass clazz) { + // put .uimodel file in uimodel directory + return ".." + File.separator + "uimodel" + File.separator + capitalizeName(clazz) + ".uimodel"; + } + + /** + * Genere un panel qui contient deux autres panels (en haut : le panel + * de saisie appele registerPanel et en bas le panel de recherche + * appele searchPanel) + * registerPanel est un panel de saisie. Ce panel est compose par deux autres + * panels de panels avec l'ensemble des attributs de l'entite et le panel de + * boutons pour ajouter, + * supprimer et annuler l'enregistrement) + */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + + if(Util.isEntity(clazz)){ +/*{ + + + package="<%=clazz.getPackageName()%>.ui"<% } %>> + + + + + + + + + + <%=clazz.getName()%>Panel + + +}*/ +String title = clazz.getName(); +generateBorderPanel(output, clazz, title); +/*{ + + + + + + + + <%=capitalizeName(clazz)%>AttributesPanelPanel + + +}*/ +generateBorderPanel(output, clazz, "Attributes"); +/*{ + + + + + + 0 + 0 + 1 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + + + + <%=capitalizeName(clazz)%>ButtonsPanel + + + + + + + + 1 + 0 + 1 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + + + + <%=capitalizeName(clazz)%>TablePanelPanel + + +}*/ +generateBorderPanel(output, clazz, "Table"); +/*{ + + + + + + 0 + 1 + 2 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + +}*/ + } + } + +} // ObjectModelToEntityUIModel + Index: topia/src/java/org/codelutin/topia/generators/ui/Util.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/Util.java:1.1 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/Util.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,37 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * 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 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * Util.java + * + * Created: 15 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.ui; + +public class Util extends org.codelutin.topia.generators.Util { // Util + +} // Util + Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntitySelectionUIModel.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntitySelectionUIModel.java:1.1 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToEntitySelectionUIModel.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,170 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * 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 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectModelToEntitySelectionUIModel.java + * + * Created: Jul 20, 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.ui; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; + +import org.codelutin.generator.AbstractObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModelClass; + + +/** +* Ce generateur permet de generer l'interface de selection de champs +* se trouvant dans une table +*/ +public class ObjectModelToEntitySelectionUIModel extends AbstractObjectModelGenerator{ // ObjectModelToEntitySelectionUIModel + + public String getFilenameForClass(ObjectModelClass clazz) { + // put .uimodel file in uimodel directory + return ".." + File.separator + "uimodel" + File.separator + capitalizeName(clazz) + "SelectionPanel.uimodel"; + } + + /** + * Genere un panel qui contient un table dans laquelle on + * selectionnera les champs qui devront etre ajoute a une liste + * d'entites + */ + public void generateFromClass(Writer output, ObjectModelClass clazz) + throws IOException { + + if(Util.isEntity(clazz)){ +/*{ + + + package="<%=clazz.getPackageName()%>.ui"<% } %>> + + + + + + + + + + <%=clazz.getName()%>SelectionPanel + + +}*/ +String title = clazz.getName(); +generateBorderPanel(output, clazz, title+"SelectionPanel"); +/*{ + + + + + + + + <%=capitalizeName(clazz)%>TablePanelPanel + + +}*/ +generateBorderPanel(output, clazz, title+" List"); +/*{ + + + + + + 0 + 0 + 1 + 1 + 1.0 + 1.0 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + + + + <%=capitalizeName(clazz)%>ButtonsPanel + + + + + + + + 0 + 1 + 1 + 1 + 1.0 + 0.3 + 10 + 1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + + + + + +}*/ + } + } + +} // ObjectModelToEntitySelectionUIModel + Index: topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToUIMetaGenerator.java diff -u /dev/null topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToUIMetaGenerator.java:1.1 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/generators/ui/ObjectModelToUIMetaGenerator.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,98 @@ +/* *##% + * Copyright (C) 2002, 2003 Code Lutin + * + * 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 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectModelToUIModelGenerator.java + * + * Created: 21 juin 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.generators.ui; + +import java.io.File; +import java.io.IOException; + +import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; +import org.codelutin.topia.generators.ui.swing.ObjectModelToEntityAttributesPanel; +import org.codelutin.topia.generators.ui.swing.ObjectModelToEntityPanel; +import org.codelutin.topia.generators.ui.swing.ObjectModelToEntitySelectionPanel; +import org.codelutin.topia.generators.ui.swing.ObjectModelToEntityTablePanel; + +import javax.swing.JPanel; + +/** +* Meta generateur qui applique les generateurs pour la generation des interface +* par defaut de saisie des entitees. +*/ +public class ObjectModelToUIMetaGenerator extends ObjectModelGenerator { // ObjectModelToUIModelGenerator + + public ObjectModelToUIMetaGenerator(){ + super(); + } + + public void generate(ObjectModel model, File destDir) throws IOException { + ObjectModelGenerator gen = null; + + System.out.println("Generation de ObjectModelToWidgetsXML"); + gen = new ObjectModelToWidgetsXML(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntityAttributesUIModel"); + gen = new ObjectModelToEntityAttributesUIModel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntityTableUIModel"); + gen = new ObjectModelToEntityTableUIModel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntitySelectionUIModel"); + gen = new ObjectModelToEntitySelectionUIModel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntityUIModel"); + gen = new ObjectModelToEntityUIModel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntityAttributesPanel"); + gen = new ObjectModelToEntityAttributesPanel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntityTablePanel"); + gen = new ObjectModelToEntityTablePanel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntitySelectionPanel"); + gen = new ObjectModelToEntitySelectionPanel(); + gen.generate(model, destDir); + + System.out.println("Generation de ObjectModelToEntityPanel"); + gen = new ObjectModelToEntityPanel(); + gen.generate(model, destDir); + + } + +} // ObjectModelToUIModelGenerator +