[umbrello] [Bug 73847] support for UML tagged values

Oliver Kellogg bugzilla_noreply at kde.org
Mon Dec 21 23:36:53 GMT 2020


https://bugs.kde.org/show_bug.cgi?id=73847

--- Comment #27 from Oliver Kellogg <okellogg at users.sourceforge.net> ---
Git commit c7fdfefc7df721f2f167e1b52bae9e07f68cb439 by Oliver Kellogg.
Committed on 12/10/2020 at 21:28.
Pushed by okellogg into branch 'master'.

Create branch work/73847-tagged-uml from master at 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>.

M  +1    -0    umbrello/CMakeLists.txt
M  +52   -1    umbrello/basictypes.cpp
M  +23   -1    umbrello/basictypes.h
M  +4    -2    umbrello/codegenwizard/codegenoptionspage.cpp
A  +124  -0    umbrello/dialogs/stereoattributedialog.cpp     [License: GPL
(v2+)]
A  +53   -0    umbrello/dialogs/stereoattributedialog.h     [License: GPL
(v2+)]
M  +2    -2    umbrello/main.cpp
M  +1    -1    umbrello/model_utils.cpp
M  +22   -1    umbrello/stereotypeswindow.cpp
M  +1    -0    umbrello/umbrelloui.rc.cmake
M  +16   -13   umbrello/uml.cpp
M  +2    -1    umbrello/uml.h
M  +79   -0    umbrello/uml1model/stereotype.cpp
M  +19   -0    umbrello/uml1model/stereotype.h
M  +43   -1    umbrello/uml1model/umlobject.cpp
M  +5    -0    umbrello/uml1model/umlobject.h
M  +11   -8    umbrello/umldoc.cpp
M  +1    -1    umbrello/version.h

https://invent.kde.org/sdk/umbrello/commit/c7fdfefc7df721f2f167e1b52bae9e07f68cb439

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list