From: <de...@us...> - 2004-01-07 01:48:22
|
Update of /cvsroot/pymerase/smw/smw/profiles/UML14/plugins In directory sc8-pr-cvs1:/tmp/cvs-serv32238/smw/profiles/UML14/plugins Added Files: __init__.py mmgenPlugin.py vUML.py Log Message: Imported version of SMW downloaded on 2003 Apr 14 --- NEW FILE: __init__.py --- --- NEW FILE: mmgenPlugin.py --- import qt from smw.modeler import iconcache class MMGenPlugin: def __init__(self,modelerApp): self.modelerApp=modelerApp def doIt(self): from smw.mmgen import mmgen if self.modelerApp.project.profile.name!="UML14": qt.QMessageBox.critical(self.modelerApp,"Invalid Profile", "This plugin only works with the standard UML 1.4 profile.") return dlg=mmgen.GeneratorGUI() dlg.SourceFile.setText("Current model in editor") dlg.SelectSource_3.setEnabled(0) dlg.SourceFile.setEnabled(0) dlg.UMLFormat.setChecked(1) dlg.FileFormat_3.setEnabled(0) dlg.UMLVersion.setCurrentText(self.modelerApp.project.profile.name) dlg.model=self.modelerApp.project.getRoot() dlg.exec_loop() def register(modelerApp): mmgen=MMGenPlugin(modelerApp) modelerApp.actions.registerAction( "mmgenTool","Metamodel Generation Tool...", qt.QIconSet(iconcache.getIcon("pluginManager")), 0,mmgen,mmgen.doIt,"project") # Tell the application to place the icon and menu option just after the # openProject action. (The editor will try to do its best, but maybe the # place is already taken by another plugin) modelerApp.actions["mmgenTool"].pleaseShowAfter( modelerApp.actions["pluginManager"]) return mmgen --- NEW FILE: vUML.py --- import qt from smw.modeler import iconcache class vUMLPlugin: def __init__(self,modelerApp): self.modelerApp=modelerApp def doIt(self): if self.modelerApp.project.profile.name!="UML14": qt.QMessageBox.critical(self.modelerApp,"Invalid Profile", "This plugin only works with the standard UML 1.4 profile.") return def register(modelerApp): mmgen=vUMLPlugin(modelerApp) modelerApp.actions.registerAction( "vUMLTool","vUML Tool...", qt.QIconSet(iconcache.getIcon("pluginManager")), 0,mmgen,mmgen.doIt,"project") # Tell the application to place the icon and menu option just after the # openProject action. (The editor will try to do its best, but maybe the # place is already taken by another plugin) modelerApp.actions["vUMLTool"].pleaseShowAfter( modelerApp.actions["pluginManager"]) return mmgen |