Bug 73847 - support for UML tagged values
Summary: support for UML tagged values
Status: CONFIRMED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on: 345546
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-30 22:30 UTC by Erik Engbrecht
Modified: 2021-01-14 21:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Engbrecht 2004-01-30 22:30:09 UTC
Version:            (using KDE KDE 3.1.3)
Installed from:    RedHat RPMs

Add support for UML tagged values on all UML objects.  For an example see the feature implemented in ArgoUML.  Adding support for these would be very beneficial to users who wish to embed additional data in their models that can then be used by external code generators.
Comment 1 Derek Broughton 2007-12-14 20:34:36 UTC
Is there any chance this is ever going to happen?  I believe I've seen that Tagged Values aren't actually supported in new versions of UML, in which case, I guess the code generators using them need to be rewritten, but for now I'd just love to turf the ugly ArgoUML in favor of Umbrello - but I need tagged values.
Comment 2 Oliver Kellogg 2007-12-14 20:43:26 UTC
> Is there any chance this is ever going to happen?

Hmm well, to quote http://uml.sourceforge.net/contact.php :

> Umbrello is an open source community effort.
> We are always looking for people to participate in the development
> by fixing bugs and implementing new features.

and currently there _are_ (almost) no volunteers.
So IMHO your best bet is to go ahead and implement it.
Comment 3 Derek Broughton 2009-09-24 15:08:10 UTC
Umbrello, therefore, should be dropped from KDE.  It's pretty, but useless.
Comment 4 Ralf Habacker 2014-12-02 21:42:20 UTC
Documentation about tagged values from http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/modeling_basics/thetaggedvaluestab.html
Comment 5 Ralf Habacker 2014-12-02 21:49:56 UTC
additional documentation from http://argouml-users.net/index.php?title=Stereotypes_and_Tagged_Values
Comment 6 Ralf Habacker 2014-12-02 21:50:59 UTC
from http://en.wikipedia.org/wiki/Stereotype_%28UML%29
"... From version 2.0 the previously independent tagged value is considered to be a stereotype attribute. " .- which is basically already supported by umbrello - "The name tagged value is still kept. Each stereotype has zero or more tag definitions, and all stereotyped UML elements have the corresponding number of tagged values."
Comment 7 Oliver Kellogg 2014-12-03 21:42:49 UTC
(In reply to Ralf Habacker from comment #6)
> from http://en.wikipedia.org/wiki/Stereotype_%28UML%29
> "... From version 2.0 the previously independent tagged value is considered
> to be a stereotype attribute. " .- which is basically already supported by
> umbrello [...]

I don't understand. What do you mean by this?
As far as I know, stereotype attributes are not supported at all by Umbrello.

BTW thanks for providing the info links.
Here is a further one:
http://www.uml-diagrams.org/profile-diagrams.html#tagged-value
Comment 8 Ralf Habacker 2014-12-04 23:04:37 UTC
(In reply to Oliver Kellogg from comment #7)
> (In reply to Ralf Habacker from comment #6)
> > from http://en.wikipedia.org/wiki/Stereotype_%28UML%29
> > "... From version 2.0 the previously independent tagged value is considered
> > to be a stereotype attribute. " .- which is basically already supported by
> > umbrello [...]
> 
> I don't understand. What do you mean by this?
> As far as I know, stereotype attributes are not supported at all by Umbrello.
The recent state of stereotype support includes implicit the attribute if a related stereotype is present or not, which theoretical could be also expressed as an explicit attribute  "present=yes|no" (I'm not saying that we should implement that, it is only for understanding) 

To support uml 1.4 tagged values, it is required
1. to add a key/value map to class UMLStereotype
2. to extend stereotype xmi  save/load with this map
3. to adapt client code to use UMLStereotype class if not done 
4. to extend the property dialog of class UMLStereotype
5. to extend the property dialogs supporting stereotypes to add/change stereotype attributes

Just a few ideas:
3.   by using UMLStereotype::name() to get the name 
 5. may be implemented by replacing the current widget code shown below
Classgeneralpage::Classgeneralpage()
... 
    m_pStereoTypeL = new QLabel(i18n("&Stereotype name:"), this);
    m_pNameLayout->addWidget(m_pStereoTypeL, 1, 0);

    m_pStereoTypeCB = new KComboBox(true, this);
    m_pNameLayout->addWidget(m_pStereoTypeCB, 1, 1);

    m_pStereoTypeCB->setItemText(m_pStereoTypeCB->currentIndex(), m_pObject->stereotype());
    m_pStereoTypeL->setBuddy(m_pStereoTypeCB);

  if (t == UMLObject::ot_Interface || t == UMLObject::ot_Datatype || t == UMLObject::ot_Enum)  {
        m_pStereoTypeCB->setEditable(false);

...
 
by a new dedicated dialog widget class located in umbrello/dialogs/widgets/umlstereotype.cpp
  UMLStereotypeWidget *widget = new UMLStereotypeWidget (m_pObject->stereotype());
  if (t == UMLObject::ot_Interface || t == UMLObject::ot_Datatype || t == UMLObject::ot_Enum) 
     widget->setEditable(false);
 m_pNameLayout->addWidget(widget);

the latter would also be a preparation for future properties editor support (see bug 97291)

For full uml 2.0 support it is additional required to support profiles. On a first run profile support could be reduced to a hard coded default profile using the current implementation.

BTW: Umbrello supports already a kind of profile support in the code generation area (one profile for each language)

> BTW thanks for providing the info links.
> Here is a further one:
> http://www.uml-diagrams.org/profile-diagrams.html#tagged-value
This is very useful
Comment 9 Ralf Habacker 2014-12-07 22:50:30 UTC
(In reply to Ralf Habacker from comment #8)
> To support uml 1.4 tagged values, it is required
> 1. to add a key/value map to class UMLStereotype
> 2. to extend stereotype xmi  save/load with this map
> 3. to adapt client code to use UMLStereotype class if not done 
> 4. to extend the property dialog of class UMLStereotype
> 5. to extend the property dialogs supporting stereotypes to add/change stereotype attributes
6. extend tree view with a stereotypes folder, where stereotypes (attributes) could be changed globally.
7. display stereotype attributes in related widgets
Comment 10 Ralf Habacker 2014-12-08 21:44:10 UTC
Git commit b0b0de97ddb73c2b5fb70a6f03689774ecc67179 by Ralf Habacker.
Committed on 05/12/2014 at 19:16.
Pushed by habacker into branch 'work/73847'.

Use UMLStereotypeWidget on uml attribute dialog.

M  +1    -0    umbrello/dialogs/umlattributedialog.h

http://commits.kde.org/umbrello/b0b0de97ddb73c2b5fb70a6f03689774ecc67179
Comment 11 Ralf Habacker 2014-12-08 21:44:11 UTC
Git commit ecaa4bf3c692a398e79e58b5e2d429d0cc550949 by Ralf Habacker.
Committed on 05/12/2014 at 19:17.
Pushed by habacker into branch 'work/73847'.

Use UMLStereotypeWidget on uml entity attribute dialog.

M  +1    -0    umbrello/dialogs/umlentityattributedialog.cpp
M  +2    -2    umbrello/dialogs/umlentityattributedialog.h

http://commits.kde.org/umbrello/ecaa4bf3c692a398e79e58b5e2d429d0cc550949
Comment 12 Ralf Habacker 2014-12-08 21:44:12 UTC
Git commit f662667cc2d239948436c140a120b1215492d2d7 by Ralf Habacker.
Committed on 08/12/2014 at 21:44.
Pushed by habacker into branch 'work/73847'.

Add class ObjectBrowser as replacement for list view dock widget.

M  +1    -0    umbrello/CMakeLists.txt
A  +129  -0    umbrello/objectbrowser.cpp     [License: UNKNOWN]  *
A  +32   -0    umbrello/objectbrowser.h     [License: UNKNOWN]  *
M  +2    -2    umbrello/uml.cpp
M  +0    -3    umbrello/uml.h
M  +7    -85   umbrello/umlappprivate.h
M  +0    -2    umbrello/umldoc.cpp

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/umbrello/f662667cc2d239948436c140a120b1215492d2d7
Comment 13 Ralf Habacker 2014-12-09 06:19:51 UTC
Git commit 06869f2cf08213ff75aecd16e3023cbc03376b3e by Ralf Habacker.
Committed on 08/12/2014 at 21:44.
Pushed by habacker into branch 'work/73847'.

Add class ObjectBrowser as replacement for list view dock widget.

M  +1    -0    umbrello/CMakeLists.txt
A  +139  -0    umbrello/objectbrowser.cpp     [License: GPL (v2+)]
A  +42   -0    umbrello/objectbrowser.h     [License: GPL (v2+)]
M  +2    -2    umbrello/uml.cpp
M  +0    -3    umbrello/uml.h
M  +7    -85   umbrello/umlappprivate.h
M  +0    -2    umbrello/umldoc.cpp

http://commits.kde.org/umbrello/06869f2cf08213ff75aecd16e3023cbc03376b3e
Comment 14 Ralf Habacker 2014-12-09 10:56:28 UTC
Git commit aede266afbedf7c0983776e44a4e20108be36b63 by Ralf Habacker.
Committed on 05/12/2014 at 11:39.
Pushed by habacker into branch 'master'.

Add class UMLStereotypeWidget for editing stereotypes.

Use this widget in
 - general page of classifer widget dialog
 - in parameter properties dialog
 - in template dialog
 - in uml attribute dialog
 - in entity attribute dialog
 - in uml operation dialog

Having common widgets gives unique user experience and
makes it possible to suppport different layouts.

M  +2    -0    umbrello/CMakeLists.txt
M  +58   -68   umbrello/dialogs/pages/classgeneralpage.cpp
M  +3    -1    umbrello/dialogs/pages/classgeneralpage.h
M  +6    -43   umbrello/dialogs/parameterpropertiesdialog.cpp
M  +4    -4    umbrello/dialogs/parameterpropertiesdialog.h
M  +4    -4    umbrello/dialogs/umlattributedialog.cpp
M  +5    -2    umbrello/dialogs/umlattributedialog.h
M  +5    -4    umbrello/dialogs/umlentityattributedialog.cpp
M  +4    -2    umbrello/dialogs/umlentityattributedialog.h
M  +4    -39   umbrello/dialogs/umloperationdialog.cpp
M  +2    -3    umbrello/dialogs/umloperationdialog.h
M  +4    -6    umbrello/dialogs/umltemplatedialog.cpp
M  +4    -2    umbrello/dialogs/umltemplatedialog.h
A  +140  -0    umbrello/dialogs/widgets/umlstereotypewidget.cpp     [License: GPL (v2+)]
A  +43   -0    umbrello/dialogs/widgets/umlstereotypewidget.h     [License: GPL (v2+)]
M  +10   -0    umbrello/stereotype.cpp
M  +2    -0    umbrello/stereotype.h
M  +2    -5    umbrello/umlobject.cpp
M  +1    -1    umbrello/umlobject.h

http://commits.kde.org/umbrello/aede266afbedf7c0983776e44a4e20108be36b63
Comment 15 Andi Fischer 2014-12-11 21:56:47 UTC
Git commit 334c1250e94bd995c15d27ec4875c0c33babc002 by Andi Fischer, on behalf of Ralf Habacker.
Committed on 05/12/2014 at 11:39.
Pushed by fischer into branch 'frameworks'.

Add class UMLStereotypeWidget for editing stereotypes.

Use this widget in
 - general page of classifer widget dialog
 - in parameter properties dialog
 - in template dialog
 - in uml attribute dialog
 - in entity attribute dialog
 - in uml operation dialog

Having common widgets gives unique user experience and
makes it possible to suppport different layouts.

M  +2    -0    umbrello/CMakeLists.txt
M  +58   -66   umbrello/dialogs/pages/classgeneralpage.cpp
M  +3    -1    umbrello/dialogs/pages/classgeneralpage.h
M  +6    -42   umbrello/dialogs/parameterpropertiesdialog.cpp
M  +4    -4    umbrello/dialogs/parameterpropertiesdialog.h
M  +4    -4    umbrello/dialogs/umlattributedialog.cpp
M  +5    -2    umbrello/dialogs/umlattributedialog.h
M  +5    -4    umbrello/dialogs/umlentityattributedialog.cpp
M  +4    -2    umbrello/dialogs/umlentityattributedialog.h
M  +4    -38   umbrello/dialogs/umloperationdialog.cpp
M  +2    -3    umbrello/dialogs/umloperationdialog.h
M  +4    -6    umbrello/dialogs/umltemplatedialog.cpp
M  +4    -2    umbrello/dialogs/umltemplatedialog.h
A  +140  -0    umbrello/dialogs/widgets/umlstereotypewidget.cpp     [License: GPL (v2+)]
A  +43   -0    umbrello/dialogs/widgets/umlstereotypewidget.h     [License: GPL (v2+)]
M  +10   -0    umbrello/stereotype.cpp
M  +2    -0    umbrello/stereotype.h
M  +2    -5    umbrello/umlobject.cpp
M  +1    -1    umbrello/umlobject.h

http://commits.kde.org/umbrello/334c1250e94bd995c15d27ec4875c0c33babc002
Comment 16 Ralf Habacker 2015-03-18 12:20:46 UTC
The related git branch has been rebased and got a better name, see http://quickgit.kde.org/?p=umbrello.git&a=shortlog&h=43856d05914bd58c172702d84471408acafd6b24 for details
Comment 17 Ralf Habacker 2015-03-19 00:09:49 UTC
(In reply to Ralf Habacker from comment #8)

> by a new dedicated dialog widget class located in umbrello/dialogs/widgets/umlstereotype.cpp
>   UMLStereotypeWidget *widget = new UMLStereotypeWidget
this has been implemented with commit http://commits.kde.org/umbrello/aede266afbedf7c0983776e44a4e20108be36b63
Comment 18 Robert Hairgrove 2020-08-11 14:29:27 UTC
Can we close this now?
Comment 19 Oliver Kellogg 2020-08-12 11:17:22 UTC
(In reply to Robert Hairgrove from comment #18)
> Can we close this now?

Unfortunately no. Comment #7 still applies,
> [...] stereotype attributes are not supported at all by Umbrello.

Comment #8 has some ideas but no one has stepped forward.
Comment 20 Oliver Kellogg 2020-09-20 20:59:03 UTC
(In reply to Ralf Habacker from comment #8)
> [...]
> To support uml 1.4 tagged values, it is required
> 1. to add a key/value map to class UMLStereotype

IMHO stereotype definition needs to be separated from stereotype application.
This means that the stereotype definition would declare e.g.
" this stereotype has an attribute named 'foo' of type String and an attribute 'bar' of type Double "
and the stereotype application would define the concrete values of the 'foo' and 'bar' attributes.
Example in XMI:

1) Stereotype definition
<UML:Stereotype xmi.id="theStereoID" name="mystereo" namespace="m1">
  <UML:Attribute xmi.id="fooID" type="String" name="foo"/>
  <UML:Attribute xmi.id="barID" type="Double" name="bar"/>
</UML:Stereotype>

2) Stereotype application
<UML:Class [...] name="MyClass">
  <UML:StereoApp [...] type="theStereoID">
    <foo value="fidget widget"/>
    <bar value="12345.67"/>
  </UML:StereoApp>
</UML:Class>

We need the separation between definition and application because different classes will apply the same stereotype but with different concrete values for the stereotype attributes.
Stereotype attributes cannot be of arbitrary type but they can use the UML primitive types, see
https://www.omg.org/spec/UML/20161101/PrimitiveTypes.xmi
I.e. the possible attribute types are:
- Boolean
- UnlimitedNatural
- Integer
- Real
- String

The stereotype definition attributes from the example,
  <UML:Attribute xmi.id="fooID" type="String" name="foo"/>
  <UML:Attribute xmi.id="barID" type="Double" name="bar"/>
use the xmi.id given at "type" to be equal to the primitive type name.
Comment 21 Oliver Kellogg 2020-09-21 06:24:35 UTC
(In reply to Oliver Kellogg from comment #20)
> [...]
> 2) Stereotype application
> <UML:Class [...] name="MyClass">
>   <UML:StereoApp [...] type="theStereoID">
>     <foo value="fidget widget"/>
>     <bar value="12345.67"/>
>   </UML:StereoApp>
> </UML:Class>

Correction:
There is no need for inventing a new tag here ("StereoApp").
Instead we can use the UML 1.3 TaggedValue extended by an attribute
  stereotype="xmiid_of_the_stereotype_def"
where "xmiid_of_the_stereotype_def" is the xmi.id of the <UML:Stereotype> definition.

Here the corrected stereotype application example:

<UML:Class [...] name="MyClass">
  <UML:ModelElement.taggedValues>
    <UML:TaggedValue xmi.id="X.30" stereotype="theStereoID" tag="foo" value="fidget widget"/>
    <UML:TaggedValue xmi.id="X.31" stereotype="theStereoID" tag="bar" value="12345.67"/>
  </UML:ModelElement.taggedValues>
</UML:Class>
Comment 22 Julian S. 2020-10-06 14:20:03 UTC
(In reply to Oliver Kellogg from comment #21)

> There is no need for inventing a new tag here ("StereoApp").
> Instead we can use the UML 1.3 TaggedValue extended by an attribute
>   stereotype="xmiid_of_the_stereotype_def"
> where "xmiid_of_the_stereotype_def" is the xmi.id of the <UML:Stereotype>
> definition.

Are UML Tagged Values already implemented? I can't find any option to specify my own tagged values on class attributes/classes/associations. Also I wonder wether it is possible to specifiy multiplicity of a class attribute?
Using v0.34 on Windows.
Thanks!
Comment 23 Oliver Kellogg 2020-10-06 17:33:46 UTC
(In reply to Julian S. from comment #22)
> 
> Are UML Tagged Values already implemented? I can't find any option to
> specify my own tagged values on class attributes/classes/associations.

Not yet; this is work in progress.
Having started the work, it looks like a tunnel that becomes longer the more I progress.
There are a lot of preparatory changes necessary before Umbrello is in shape for adding the actual feature.
This first set of changes will benefit Umbrello regardless of the tagged value feature. I plan to commit it to git master before making the actual feature branch.
Judging by my current rate of progress, the work will take at least several weeks.

> I wonder whether it is possible to specify multiplicity of a class attribute?

This can be done using an association in place of the attribute.
Comment 24 Oliver Kellogg 2020-10-10 12:58:12 UTC
Git commit 4fa1d9994d0b64172800f4fb3c20c6a61ae09195 by Oliver Kellogg.
Committed on 10/10/2020 at 10:40.
Pushed by okellogg into branch 'master'.

Preparation for reverting commit 92d13fb required by planned changes:

umbrello/uml1model/package.{h,cpp}
- At function addObject add argument interactOnConflict of type bool
  defaulting to true.  If interactOnConflict is passed in false and
  pObject's name is already present in the package's contained objects
  then the function returns false without opening a dialog asking the
  user to provide a different name.

umbrello/codeimport/import_utils.cpp
- In function remapUMLEnum,
  - reduce indentation by returning early in case (ns == 0);
  - for adding `e' to currentScope->containedObjects() call
    currentScope->addObject(e, false).

umbrello/codeimport/javaimport.cpp
- In function parseStmt handling of keywords "class" / "interface", for
  adding m_klass to currentScope->containedObjects() call
  currentScope()->addObject(m_klass, false).

M  +26   -21   umbrello/codeimport/import_utils.cpp
M  +3    -3    umbrello/codeimport/javaimport.cpp
M  +23   -5    umbrello/uml1model/package.cpp
M  +1    -1    umbrello/uml1model/package.h

https://invent.kde.org/sdk/umbrello/commit/4fa1d9994d0b64172800f4fb3c20c6a61ae09195
Comment 25 Oliver Kellogg 2020-10-10 12:58:20 UTC
Git commit 18747a69c5fa6489cab0e71a82b2f68620ec020b by Oliver Kellogg.
Committed on 10/10/2020 at 12:56.
Pushed by okellogg into branch 'master'.

Reverting commit 92d13fb prepares for work on tagged values:

umbrello/uml1model/package.{h,cpp}
- Function containedObjects() shall return UMLObjectList by value.
  Reason: In near future we will not be returning a class member.

umbrello/model_utils.cpp
umbrello/models/objectsmodel.cpp
umbrello/umldoc.cpp
umbrello/umllistview.cpp
umbrello/dialogs/pages/packagecontentspage.cpp
- At calls to UMLPackage::containedObjects() receive returned list by
  value.

M  +3    -3    umbrello/dialogs/pages/packagecontentspage.cpp
M  +1    -1    umbrello/model_utils.cpp
M  +4    -2    umbrello/models/objectsmodel.cpp
M  +1    -1    umbrello/uml1model/package.cpp
M  +1    -1    umbrello/uml1model/package.h
M  +10   -8    umbrello/umldoc.cpp
M  +1    -1    umbrello/umllistview.cpp

https://invent.kde.org/sdk/umbrello/commit/18747a69c5fa6489cab0e71a82b2f68620ec020b
Comment 26 Oliver Kellogg 2020-10-13 06:08:27 UTC
Further progress happens in the branch work/73847-tagged-uml, see
https://invent.kde.org/sdk/umbrello/-/tree/work/73847-tagged-uml
Comment 27 Oliver Kellogg 2020-12-21 23:36:53 UTC
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@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
Comment 28 Oliver Kellogg 2020-12-21 23:37:01 UTC
Git commit 66da747fe8dbd48aeea79074da9e06539e4aee59 by Oliver Kellogg.
Committed on 13/10/2020 at 21:44.
Pushed by okellogg into branch 'master'.

Add default value capability at stereotype attribute:

umbrello/uml1model/stereotype.h
- In class AttributeDef,
  - add member defaultVal of type QString;
  - extend constructor for externally provided defaultVal.

umbrello/uml1model/stereotype.cpp
- In function saveToXMI1 loop over m_attrDefs, if ad.defaultVal is
  non empty then setAttribute "initialValue" on attElement.
- In function load1 traversal of QDomNodes tag "UML:Stereotype.feature"
  while-loop over attElem tag "UML:Attribute" retrieve attElem attribute
  "initialValue" into local dfltVal of type QString.
  Pass dfltVal into AttributeDef constructor.

umbrello/dialogs/stereoattributedialog.h
- Add member m_pDefaultValueLabel[N_STEREOATTRS] of type QLabel*.
- Add member m_pDefaultValueEdit [N_STEREOATTRS] of type KLineEdit*.

umbrello/dialogs/stereoattributedialog.cpp
- In function setupDialog() for-loop of row,
  - place m_pDefaultValueLabel[row], m_pDefaultValueEdit[row] into
    columns 4, 5 using Dialog_Utils::makeLabeledEditField();
  - in case (adefs.count() > row) initialize m_pDefaultValueEdit[row]
    from adefs.at(row).defaultVal.
- In function apply() pass m_pDefaultValueEdit[i]->text().trimmed()
  into UMLStereotype::AttributeDef constructor argument dfltVal.

M  +11   -2    umbrello/dialogs/stereoattributedialog.cpp
M  +7    -5    umbrello/dialogs/stereoattributedialog.h
M  +4    -1    umbrello/uml1model/stereotype.cpp
M  +5    -3    umbrello/uml1model/stereotype.h

https://invent.kde.org/sdk/umbrello/commit/66da747fe8dbd48aeea79074da9e06539e4aee59
Comment 29 Oliver Kellogg 2020-12-21 23:37:09 UTC
Git commit 506b58b7e9330c9265b0f6fc808c441d6cd7293e by Oliver Kellogg.
Committed on 17/10/2020 at 21:00.
Pushed by okellogg into branch 'master'.

umbrello/uml1model/umlobject.{h,cpp} followup to commit c7fdfef :
- Add function tags() returning reference to m_TaggedValues.
- In function loadFromXMI1 fix loading of subelement
  <UML:ModelElement.taggedValues> and nested elements <UML:TaggedValue>.

M  +11   -2    umbrello/uml1model/umlobject.cpp
M  +2    -0    umbrello/uml1model/umlobject.h

https://invent.kde.org/sdk/umbrello/commit/506b58b7e9330c9265b0f6fc808c441d6cd7293e
Comment 30 Oliver Kellogg 2020-12-21 23:37:17 UTC
Git commit f0779b7aa6593bacbcf26e60c5da8ac83affe1b9 by Oliver Kellogg.
Committed on 17/10/2020 at 21:11.
Pushed by okellogg into branch 'master'.

umbrello/dialogs/dialog_utils.{h,cpp}
- New function makeTagEditFields creates labeled edit fields for
  stereotype tags.
  The label/line-edit pairs are arranged horizontally on the same row.
  The label texts are taken from the AttributeDefs of the object's
  UMLStereotype.
- New function remakeTagEditFields recreates labeled edit fields for
  stereotype tags.  This means that the existing label/line-edit pairs
  are deleted and new ones are created afresh.
  It is intended for use when the object's stereotype has changed.
  The label/line-edit pairs are arranged horizontally on the same row.
  The label texts are taken from the AttributeDefs of the object's
  UMLStereotype.
- New function updateTagsFromEditFields updates the stereotype tag
  values of the given UMLObject from the corresponding values in the
  given array of KLineEdit widgets.
  This is useful as the action in the slot method when the Apply or
  OK button is pressed.

M  +98   -0    umbrello/dialogs/dialog_utils.cpp
M  +15   -0    umbrello/dialogs/dialog_utils.h

https://invent.kde.org/sdk/umbrello/commit/f0779b7aa6593bacbcf26e60c5da8ac83affe1b9
Comment 31 Oliver Kellogg 2020-12-21 23:37:26 UTC
Git commit 144e809eb7aa659d8e63d4c465fc35db0ce29ef8 by Oliver Kellogg.
Committed on 17/10/2020 at 21:49.
Pushed by okellogg into branch 'master'.

Hook up UMLObject::m_TaggedValues in the Class, Attribute, and Operation
dialogs:

umbrello/dialogs/pages/classgeneralpage.{h,cpp}
- Remove unused members m_pInstanceL, m_pStereoTypeL.
- New member m_pNameLayout replaces same named local variable of
  classgeneralpage.cpp.
- New member m_pTagL is an array of QLabel* for stereotype tags.
- New member m_pTagLE is an array of KLineEdit* for stereotype tags.
- Function setupDialog initializes m_pTagL[] and m_pTagLE[] using
  Dialog_Utils::makeTagEditFields().
- New function slotStereoTextChanged is connected to
  m_stereotypeWidget->editField() signal currentTextChanged().
  Tag fields are rebuilt using Dialog_Utils::remakeTagEditFields().
- In function apply(), if m_stereotypeWidget and m_pObject are both
  non null then call Dialog_Utils::updateTagsFromEditFields().

umbrello/dialogs/umlattributedialog.{h,cpp}
- New member m_pValuesLayout replaces local variable valuesLayout of
  umlattributedialog.cpp.
- New member m_pTagL is an array of QLabel* for stereotype tags.
- New member m_pTagLE is an array of KLineEdit* for stereotype tags.
- Function setupDialog initializes m_pTagL[] and m_pTagLE[] using
  Dialog_Utils::makeTagEditFields().
- New function slotStereoTextChanged is connected to
  m_stereotypeWidget->editField() signal currentTextChanged().
  Tag fields are rebuilt using Dialog_Utils::remakeTagEditFields().
- In function apply() call Dialog_Utils::updateTagsFromEditFields().

umbrello/dialogs/umloperationdialog.{h,cpp}
- New member m_pGenLayout replaces local variable genLayout of
  umloperationdialog.cpp.
- New member m_pTagL is an array of QLabel* for stereotype tags.
- New member m_pTagLE is an array of KLineEdit* for stereotype tags.
- Function setupDialog initializes m_pTagL[] and m_pTagLE[] using
  Dialog_Utils::makeTagEditFields().
- New function slotStereoTextChanged is connected to
  m_stereotypeWidget->editField() signal currentTextChanged().
  Tag fields are rebuilt using Dialog_Utils::remakeTagEditFields().
- In function apply() call Dialog_Utils::updateTagsFromEditFields().

M  +28   -10   umbrello/dialogs/pages/classgeneralpage.cpp
M  +6    -1    umbrello/dialogs/pages/classgeneralpage.h
M  +21   -8    umbrello/dialogs/umlattributedialog.cpp
M  +7    -0    umbrello/dialogs/umlattributedialog.h
M  +30   -18   umbrello/dialogs/umloperationdialog.cpp
M  +7    -0    umbrello/dialogs/umloperationdialog.h

https://invent.kde.org/sdk/umbrello/commit/144e809eb7aa659d8e63d4c465fc35db0ce29ef8
Comment 32 Oliver Kellogg 2020-12-21 23:37:34 UTC
Git commit c588e7b6c7cb76490cde5e840b4150bded318456 by Oliver Kellogg.
Committed on 17/10/2020 at 21:18.
Pushed by okellogg into branch 'master'.

umbrello/dialogs/widgets/comboboxwidgetbase.{h,cpp}
- New function editField() returns the KComboBox *m_editField.
  This is useful for connecting a slot method to signals such as
  currentIndexChanged(), currentTextChanged(), activated().

M  +9    -1    umbrello/dialogs/widgets/comboboxwidgetbase.cpp
M  +2    -0    umbrello/dialogs/widgets/comboboxwidgetbase.h

https://invent.kde.org/sdk/umbrello/commit/c588e7b6c7cb76490cde5e840b4150bded318456
Comment 33 Oliver Kellogg 2020-12-21 23:37:42 UTC
Git commit a7fd4318f7397cbe77f3ae4697f5e482ba31eded by Oliver Kellogg.
Committed on 30/10/2020 at 20:56.
Pushed by okellogg into branch 'master'.

Hook up UMLObject::m_TaggedValues in widgets and class options:

umbrello/basictypes.h
- Add namespace ShowStereoType with Enum { None, Name, Tags }.

umbrello/umbrello.kcfg
- In group "Class Options" change entry "showStereoType" to type "Enum"
  with choices "None", "Name", "Tags".

umbrello/optionstate.h
- In class ClassState change type of member showStereoType to
  Uml::ShowStereoType::Enum.

umbrello/optionstate.cpp
- Adjust function ClassState::loadFromXMI1 to changed type of member
  showStereoType.

umbrello/umlwidgets/umlwidget.{h,cpp}
- Change type of member m_showStereotype to Uml::ShowStereoType::Enum.
- At function showStereotype change return type to
  Uml::ShowStereoType::Enum.
- At function setShowStereotype change argument type to
  Uml::ShowStereoType::Enum.
- New function tags() returns stringified m_umlObject->tags().

umbrello/umlwidgets/widgetbase.cpp
- In function slotMenuSelection add deprecation note at case
  ListPopupMenu::mt_{Show,Hide}_Stereotypes_Selection.

umbrello/umlwidgets/classifierwidget.h
- At enum VisualProperty add deprecation note on value ShowStereotype.

umbrello/umlwidgets/classifierwidget.cpp
- Adjust to change in type of OptionState::ClassState::showStereoType
  and UMLWidget::m_showStereotype.  Affect methods:
  - ClassifierWidget(UMLScene *, UMLClassifier *)
  - ClassifierWidget(UMLScene *, UMLPackage *)
  - bool visualProperty(VisualProperty) const
  - void setVisualPropertyCmd(VisualProperty, bool)
  - QSizeF calculateSize(bool withExtensions) const
  - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
  - void changeToClass()
  - void changeToInterface()
  - void changeToPackage()
  - bool loadFromXMI1(QDomElement &)
  - void saveToXMI1(QDomDocument &, QDomElement &)

umbrello/umlwidgets/entitywidget.cpp
- In function slotMenuSelection remove case
  ListPopupMenu::mt_Show_Stereotypes, it is handled in
  UMLWidget::slotMenuSelection().

umbrello/menus/widgetbasepopupmenu.cpp
- Adjust function makeClassifierShowPopup to changed return type of
  UMLWidget::showStereotype().

umbrello/dialogs/pages/classoptionspage.{h,cpp}
- Change type of member m_showStereotypeCB to KComboBox*.
  Reason: It shall represent the values of Uml::ShowStereoType::Enum.
- New function createShowStereotypeCB(QGroupBox*) encapsulates creation
  of the KComboBox for m_showStereotype.
  For the moment this is a member method but it could be made "static"
  or be moved to Dialog_Utils.

M  +14   -2    umbrello/basictypes.h
M  +23   -10   umbrello/dialogs/pages/classoptionspage.cpp
M  +3    -1    umbrello/dialogs/pages/classoptionspage.h
M  +1    -1    umbrello/menus/widgetbasepopupmenu.cpp
M  +1    -1    umbrello/optionstate.cpp
M  +2    -2    umbrello/optionstate.h
M  +7    -2    umbrello/umbrello.kcfg
M  +57   -21   umbrello/umlwidgets/classifierwidget.cpp
M  +5    -1    umbrello/umlwidgets/classifierwidget.h
M  +2    -1    umbrello/umlwidgets/entitywidget.cpp
M  +47   -5    umbrello/umlwidgets/umlwidget.cpp
M  +4    -3    umbrello/umlwidgets/umlwidget.h
M  +2    -0    umbrello/umlwidgets/widgetbase.cpp

https://invent.kde.org/sdk/umbrello/commit/a7fd4318f7397cbe77f3ae4697f5e482ba31eded
Comment 34 Oliver Kellogg 2020-12-22 11:14:30 UTC
The merge from the work/73847-tagged-uml branch adds a minimal implementation:

Below the tree view you should see tabs such as "Tree View", "Stereotypes", "Diagrams", "UML Objects".
Select the Stereotypes tab.
In the Name/Usage display that appears, right click on the stereotype for which you want to add tags.
A dialog will pop up which permits specifying up to three tags for the stereotype.
Note that this dialog only defines the stereotype tag *definition* not the concrete tag values.

Once the tag types are defined, go back to the Tree View and double click on the class for which the stereotype attributes shall be applied.
In the General Settings dialog that appears, at the line "Stereotype name" there will appear additional fields for the attributes.
In these fields the concrete tag values can be filled in.
Comment 35 Oliver Kellogg 2020-12-22 11:25:15 UTC
I set this back to CONFIRMED because I am currently not finding time for a full implementation.
"Full implementation" would mean
* making a top level menu entry for the tag definition and/or extending the
  UML object dialogs for tag definition
* permitting tags to be applied to all elements for which stereotypes can be
  applied (currently only implemented for classifiers).
Comment 36 Oliver Kellogg 2020-12-28 11:16:04 UTC
Git commit 4b1a4d487d1775df1fc8c5828185489b8cd2abf2 by Oliver Kellogg.
Committed on 28/12/2020 at 11:15.
Pushed by okellogg into branch 'master'.

umbrello/dialogs/pages/classoptionspage.cpp followup to commit a7fd431

- In function createShowStereotypeCB texts at calls to cobox->addItem()
  provide context "Stereotype" which was omitted by accident.

M  +3    -3    umbrello/dialogs/pages/classoptionspage.cpp

https://invent.kde.org/sdk/umbrello/commit/4b1a4d487d1775df1fc8c5828185489b8cd2abf2
Comment 37 Oliver Kellogg 2021-01-14 21:23:49 UTC
Git commit d6ff4174622ef2c6db542028908ed2da2a947f1d by Oliver Kellogg.
Committed on 14/01/2021 at 21:23.
Pushed by okellogg into branch 'master'.

Fixes for commit c7fdfef saving of tagged values to XMI:

umbrello/uml1model/stereotype.cpp
- In function saveToXMI1 case !m_attrDefs.isEmpty() loop over m_attrDefs
  call writer.writeEndElement() to close the opened <UML:Attribute>.

umbrello/uml1model/umlobject.cpp
- In function save1end case m_TaggedValues.count(), after end of loop
  over m_TaggedValues call writer.writeEndElement() to close the opened
  <UML:ModelElement.taggedValues>.

M  +2    -1    umbrello/uml1model/stereotype.cpp
M  +2    -1    umbrello/uml1model/umlobject.cpp

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