Create branch work/73847-tagged-uml from master@9817ffc :
umbrello/basictypes.h - New namespace PrimitiveTypes encapsulates basic element of the support for UML primitive types: - enum Enum lists the available primitive types plus a final value Reserved which is used for determining the number of values. - Integer constant n_types acts as synonym for Reserved. - Functions toString convert an Enum or equivalent integer value to the corresponding string. - Function fromString converts a string to the corresponding Enum. If the string doe not correspond to an Enum value then the value Reserved is returned. - Function fromInt converts an integer position number to the Enum value at that position. - At ProgrammingLanguage::Enum value `Reserved' document that this is now used for selecting the UML Primitive Types. umbrello/basictypes.cpp - Implement the functions in new namespace PrimitiveTypes. - In namespace ProgrammingLanguage function toString return "none" for the Reserved value. umbrello/uml1model/stereotype.{h,cpp} - Class AttributeDef defines a stereotype attribute. - Type AttributeDefs is a QVector of AttributeDef. This is the type used by the new protected member m_attrDefs. - Function clearAttributeDefs clears m_attrDefs. - Function setAttributeDefs sets m_attrDefs. - Function getAttributeDefs() returns m_attrDefs. - Function load1 loads m_attrDefs from XMI. - Function saveToXMI1 is extended to save m_attrDefs to XMI. umbrello/model_utils.cpp - In function isCommonDataType case (gen == 0) return true to reflect the fact that UML primitive types are common types. umbrello/dialogs/stereoattributedialog.{h,cpp} - Dialog for specifying up to N_STEREOATTRS stereotype attributes. A stereotype attribute has a name and type. The type can be chosen from among the UML Primitive Types. umbrello/stereotypeswindow.cpp - Extend function contextMenuEvent so that if the user clicks on an existing stereotype row then a StereoAttributeDialog is opened which permits to define the attributes for the selected stereotype. umbrello/codegenwizard/codegenoptionspage.cpp - In function setupActiveLanguageBox while-loop, include Uml::ProgrammingLanguage::Reserved in the range covered by indexCounter. - In function updateCodeGenerationPolicyTab, do not call CodeGenFactory::newCodeGenPolicyExt(pl) if pl is Uml::ProgrammingLanguage::Reserved. umbrello/umldoc.cpp - In function loadExtensionsFromXMI1 decoding of tag "codegeneration", the cgelement attribute "language" may now assume the value "none" to denote that the UML primitive types are selected. In this case do not attempt setting a code generator. - In function addDefaultDatatypes, if UMLApp::app()->generator() returns null on entry then this causes the UML primitive types to be created. umbrello/uml.h - In private slots declare void setLang_none(). - At declaration of m_langAct increase array size by 1 to accomodate the action for Uml::ProgrammingLanguage::Reserved. umbrello/uml.cpp - In function initActions(), - call setProgLangAction for associating Uml::ProgrammingLanguage:: Reserved with the action "setLang_none"; - connect m_langAct[Uml::ProgrammingLanguage::Reserved] trigger with the setLang_none slot. - In function setGenerator : - Remove early actions / early return on (pl == Uml::ProgrammingLanguage::Reserved). - If pl is Uml::ProgrammingLanguage::Reserved then avoid allocating and calling functions on m_codegen. The only actions taken in this case are: Set m_activeLanguage, call updateLangSelectMenu(pl), call slotAddDefaultDatatypes(). - Define added slot setLang_none to call setActiveLanguage(Uml::ProgrammingLanguage::Reserved). - In function updateLangSelectMenu include Uml::ProgrammingLanguage:: Reserved in the range covered by for-loop variable `i'. umbrello/main.cpp - In for-loop constructing the "set-language-" options include Uml::ProgrammingLanguage::Reserved in the iteration in order to construct "set-language-none". - In for-loop listing the supported languages for option "--languages" include Uml::ProgrammingLanguage::Reserved in the iteration. umbrello/uml1model/umlobject.h - Add member m_TaggedValues of type QStringList. umbrello/uml1model/umlobject.cpp WORK IN PROGRESS - In function save1 add saving of m_TaggedValues (if non empty). This creates a new subelement, <UML:ModelElement.taggedValues> in which the <UML:TaggedValue> elements are embedded. - In function loadFromXMI1 add loading of subelement <UML:ModelElement.taggedValues> with nested elements <UML:TaggedValue>. umbrello/CMakeLists.txt - On setting libdialogs_SRCS include new file dialogs/stereoattributedialog.cpp. umbrello/umbrelloui.rc.cmake - In menu "code" submenu "active_lang_menu" add action "setLang_none". umbrello/version.h - Increase XMI_FILE_VERSION to "1.6.20" due to added <UML:Attribute> subelements of <UML:Stereotype>. CCBUG: 73847
Loading