Bug 123633 - new diagram type: object diagram
Summary: new diagram type: object diagram
Status: CONFIRMED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.4.2
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-14 23:01 UTC by Peter Piehler
Modified: 2022-12-04 11:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
State of implemented use cases (78.29 KB, image/png)
2017-03-06 21:58 UTC, Ralf Habacker
Details
State of implemented use cases (update) (115.67 KB, image/png)
2017-03-07 00:37 UTC, Ralf Habacker
Details
related xmi model file (52.17 KB, text/x-xmi)
2017-03-07 00:38 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Piehler 2006-03-14 23:01:05 UTC
Version:           1.4.2 (using KDE KDE 3.4.3)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1) 
OS:                Linux

instance diagram
-A UML diagram that shows objects and the links between them
-similar to collaboration diagram except that it shows links of associations

see:http://www.site.uottawa.ca:4321/oose/index.html#instancediagram_table
Comment 1 François Rey 2009-12-07 12:22:10 UTC
This would be a great addition that I encourage implementing with my vote.
Useful for showing examples of actual instances and how they relate to each other at a specific point in time. A class diagram is a static diagram meaning their semantic should be valid at any point in time. Object (or instance) diagram are just a snapshot of instances at one point in time, showing how they relate to each other.
Comment 2 Ralf Habacker 2015-03-07 11:32:55 UTC
From http://stackoverflow.com/questions/4202970/how-to-represent-class-instances-in-uml

An "instance" diagram in UML is called an Object Diagram.
Comment 3 Ralf Habacker 2015-03-07 12:49:25 UTC
(In reply to Ralf Habacker from comment #2)
> From
> http://stackoverflow.com/questions/4202970/how-to-represent-class-instances-
> in-uml
> 
> An "instance" diagram in UML is called an Object Diagram.

from http://www.sparxsystems.com.au/resources/uml2_tutorial/uml2_objectdiagram.html

Object Diagrams
An object diagram may be considered a special case of a class diagram. Object diagrams use a subset of the elements of a class diagram in order to emphasize the relationship between instances of classes at some point in time. They are useful in understanding class diagrams. They don’t show anything architecturally different to class diagrams, but reflect multiplicity and roles.
Comment 4 Ralf Habacker 2017-02-17 09:12:28 UTC
Git commit 28b760607df4af71f3563a61cc260379e92e17b9 by Ralf Habacker.
Committed on 17/02/2017 at 09:12.
Pushed by habacker into branch 'work/123633'.

Extracted object diagram support from frameworks branch.

This patch already contains a few fixes:
- added missing copyright header
- Fix api changes (constructor)

Open issues:
- Instance related setup in ClassGeneralPage seems
  to be duplicated -> needs review
- missing icons for instance in tool bar
- missing icons for object diagram in diagram toolbar list

To test:
- test load/save

M  +5    -0    umbrello/CMakeLists.txt
M  +4    -0    umbrello/basictypes.cpp
M  +1    -0    umbrello/basictypes.h
M  +1    -0    umbrello/cmds.h
A  +43   -0    umbrello/cmds/generic/cmdrenameumlobjectinstance.cpp     [License: GPL (v2+)]
A  +36   -0    umbrello/cmds/generic/cmdrenameumlobjectinstance.h     [License: GPL (v2+)]
M  +33   -8    umbrello/dialogs/pages/classgeneralpage.cpp
M  +2    -0    umbrello/dialogs/pages/classgeneralpage.h
M  +9    -0    umbrello/dialogs/pages/classifierlistpage.cpp
A  +67   -0    umbrello/dialogs/umlinstanceattributedialog.cpp     [License: GPL (v2+)]
A  +41   -0    umbrello/dialogs/umlinstanceattributedialog.h     [License: GPL (v2+)]
A  +54   -0    umbrello/dialogs/umlinstanceattributedialog.ui
M  +8    -0    umbrello/icon_utils.cpp
M  +2    -0    umbrello/icon_utils.h
M  +56   -2    umbrello/listpopupmenu.cpp
M  +7    -0    umbrello/listpopupmenu.h
M  +55   -3    umbrello/model_utils.cpp
M  +14   -1    umbrello/object_factory.cpp
M  +45   -16   umbrello/toolbarstateother.cpp
M  +1    -0    umbrello/umbrelloui.rc
M  +14   -0    umbrello/uml.cpp
M  +1    -0    umbrello/uml.h
M  +22   -1    umbrello/umllistview.cpp
M  +14   -2    umbrello/umllistviewitem.cpp
M  +3    -0    umbrello/umllistviewitem.h
M  +13   -0    umbrello/umlmodel/classifier.cpp
A  +112  -0    umbrello/umlmodel/instance.cpp     [License: GPL (v2+)]
A  +41   -0    umbrello/umlmodel/instance.h     [License: GPL (v2+)]
A  +104  -0    umbrello/umlmodel/instanceattribute.cpp     [License: GPL (v2+)]
A  +51   -0    umbrello/umlmodel/instanceattribute.h     [License: GPL (v2+)]
M  +1    -1    umbrello/umlmodel/package.cpp
M  +3    -0    umbrello/umlmodel/umlcanvasobject.cpp
M  +34   -1    umbrello/umlmodel/umlobject.cpp
M  +14   -1    umbrello/umlmodel/umlobject.h
M  +14   -0    umbrello/umlscene.cpp
M  +9    -1    umbrello/umlwidgets/associationwidget.cpp
M  +51   -3    umbrello/umlwidgets/classifierwidget.cpp
M  +1    -0    umbrello/umlwidgets/classifierwidget.h
M  +10   -1    umbrello/umlwidgets/widget_factory.cpp
M  +9    -1    umbrello/umlwidgets/widgetbase.cpp
M  +1    -0    umbrello/umlwidgets/widgetbase.h
M  +14   -4    umbrello/worktoolbar.cpp
M  +3    -1    umbrello/worktoolbar.h

https://commits.kde.org/umbrello/28b760607df4af71f3563a61cc260379e92e17b9
Comment 5 Ralf Habacker 2017-02-17 11:22:00 UTC
Git commit 96b5ddc666ee22cab013c5a78b37a3c2fb4a1b1d by Ralf Habacker.
Committed on 17/02/2017 at 11:21.
Pushed by habacker into branch 'work/123633'.

Add icon for object diagram.

M  +1    -0    umbrello/icons.qrc
M  +1    -0    umbrello/pics/CMakeLists.txt
A  +-    --    umbrello/pics/diag_object.png
A  +765  -0    umbrello/pics/sources/diag_object.svg

https://commits.kde.org/umbrello/96b5ddc666ee22cab013c5a78b37a3c2fb4a1b1d
Comment 6 Ralf Habacker 2017-02-27 06:21:19 UTC
Branch work/123633 has been merged into master. 

The following fixes has been applied after the merge to git master to fix issues with the implementation:

1c382a7 Fixup of c91a4bf.
e5fd427 Do not write unrelated xmi attributes for UMLInstance.
c91a4bf Do not write unrelated xmi attributes for instance widgets.
509d7a2 umbrello-diagrams.dtd: Add element 'instancewidget'.
9676daf Keep getting widget name in ClassifierWidget::paint() in sync with ClassifierWidget::calculateSize().
09347ce Enable drag and drop of instance widgets from list view.
cb210c0 Rename class CmdRenameUMLObjectInstance to CmdRenameUMLInstance.
1702611 Merge duplicate references to i18n("Instance name:") into UMLObject::toI18nString().
317ccaf Fix incorrect i18n name for ot_Instance in UMLObject::toI18nString().
7372cd8 Keep instance and class name edit widget in the same order in ClassGeneralPage.
de2c7a8 Remove duplicated implementation for entering instance name in class ClassGeneralPage.
1732503 Move UMLObject::m_instanceName to UMLInstance where it belongs.
111e448 Limit object diagram support to master branch for now.
3a03de1 Fix duplicated label imported from frameworks branch.
f459e4b Change order of "rename" context menu entries for object and instance widgets.
8bab98e Add layout config files for object diagrams.
beee90f Cleanup code for case WidgetBase::wt_Object in ListPopupMenu::insertSingleSelectionMenu().
abb0b7e Fix bug showing "New"->"Class" in object diagrams context menu.
8cc52e3 Indention fix.
343297d Add missing ':' to UMLInstance objects in UMLObject::toI18nString().
fb7630d Indention fix.
077b5ac Fix instance attribute width calculation for displaying instances in ClassifierWidget.
6ff72fc Fix calculating of width in ClassifierWidget on showing instances.
a4294f9 Add loading cursors from embedded pixmaps.
dfc5c0a Indention fix.
859d9b0 Merge multiple usage of i18n("Rename object...")
796b901 Add implementation of ListPopupMenu::mt_Rename_Object for instance widgets.
3b3eb3c Allow assocations between instances.
61a916f Add default diagram name for object diagrams.

Remaining issues:
Implementation does not follow UML 1.4 standard because of using umbrello specific XMI tag UML:InstanceAttribute. Additional UMLInstance is the classifier and do not references a classifier which creates non sharable and incomplete classifiers.
Comment 7 Ralf Habacker 2017-03-02 06:49:09 UTC
Git commit 576a4346ba591796142d716b2dab00fc86ae5708 by Ralf Habacker.
Committed on 02/03/2017 at 06:48.
Pushed by habacker into branch 'master'.

Refactor UMLInstance to be more UML and XMI 1.4 compatible.

- Create classifier instance on construction if not present
  and save it internal instead to be a non sharable classifier.
  Class UMLInstance itself stays to be derived from UMLClassifier
  because of the usage of UMLAttribute representing instance
  attributes.
- Save and load 'classifier' attribute to be xmi 1.4 compatible

M  +0    -2    CMakeLists.txt
M  +1    -1    umbrello/CMakeLists.txt
M  +1    -1    umbrello/cmds.h
R  +13   -14   umbrello/cmds/generic/cmdrenameumlinstancetype.cpp [from: umbrello/cmds/generic/cmdrenameumlinstance.cpp - 056% similarity]
R  +17   -13   umbrello/cmds/generic/cmdrenameumlinstancetype.h [from: umbrello/cmds/generic/cmdrenameumlinstance.h - 055% similarity]
M  +4    -5    umbrello/dialogs/pages/classgeneralpage.cpp
M  +98   -17   umbrello/uml1model/instance.cpp
M  +11   -4    umbrello/uml1model/instance.h
M  +1    -2    umbrello/umlwidgets/associationwidget.cpp
M  +23   -9    umbrello/umlwidgets/classifierwidget.cpp
M  +3    -0    umbrello/umlwidgets/widget_factory.cpp

https://commits.kde.org/umbrello/576a4346ba591796142d716b2dab00fc86ae5708
Comment 8 Ralf Habacker 2017-03-06 21:58:28 UTC
Created attachment 104418 [details]
State of implemented use cases
Comment 9 Ralf Habacker 2017-03-07 00:37:40 UTC
Created attachment 104420 [details]
State of implemented use cases (update)
Comment 10 Ralf Habacker 2017-03-07 00:38:17 UTC
Created attachment 104421 [details]
related xmi model file
Comment 11 Oliver Kellogg 2021-01-05 20:10:40 UTC
(In reply to Ralf Habacker from comment #6)
> [...]
> Remaining issues:
> Implementation does not follow UML 1.4 standard because of using umbrello
> specific XMI tag UML:InstanceAttribute.

In the upcoming commit I change <UML:InstanceAttribute> to <slot>,
I believe this is more in line with UML 1.4.
Furthermore, a slot does not replicate the UMLAttribute but instead has an XML attribute named "attribute" referencing the xmi.id of the corresponding <UML:Attribute>. The slot only adds the XML attribute "value" giving the concrete value for the UMLAttribute.
Comment 12 Oliver Kellogg 2021-01-05 21:19:44 UTC
Git commit e491e53a40413183c8ba2177d1228debca493e02 by Oliver Kellogg.
Committed on 05/01/2021 at 20:32.
Pushed by okellogg into branch 'master'.

umbrello/uml1model/umlcanvasobject.cpp
- In function uniqChildName change case UMLObject::ot_InstanceAttribute
  to UMLObject::ot_Instance.

M  +2    -2    umbrello/uml1model/umlcanvasobject.cpp

https://invent.kde.org/sdk/umbrello/commit/e491e53a40413183c8ba2177d1228debca493e02
Comment 13 Oliver Kellogg 2021-01-05 21:19:52 UTC
Git commit 5015ce47e0a547428668c3243aa933abdbf0c6d2 by Oliver Kellogg.
Committed on 05/01/2021 at 21:18.
Pushed by okellogg into branch 'master'.

umbrello/umlwidgets/associationwidget.cpp
- In function setUMLObject add TODO note on case ot_InstanceAttribute
  and comment this case out.

M  +4    -1    umbrello/umlwidgets/associationwidget.cpp

https://invent.kde.org/sdk/umbrello/commit/5015ce47e0a547428668c3243aa933abdbf0c6d2
Comment 14 Oliver Kellogg 2021-01-05 21:20:01 UTC
Git commit ef4241900e0f65b2c9e4b3b902baefca3a8468fb by Oliver Kellogg.
Committed on 05/01/2021 at 20:59.
Pushed by okellogg into branch 'master'.

umbrello/menus/listpopupmenu.cpp
- In function insertContainerItems(KMenu*, bool, bool, bool) add call to
  insert(mt_Instance, menu).

M  +2    -1    umbrello/menus/listpopupmenu.cpp

https://invent.kde.org/sdk/umbrello/commit/ef4241900e0f65b2c9e4b3b902baefca3a8468fb
Comment 15 Oliver Kellogg 2021-01-06 14:26:33 UTC
Git commit 3203b16acd7adfbed909bdfe7be40eb5c302dad0 by Oliver Kellogg.
Committed on 06/01/2021 at 14:26.
Pushed by okellogg into branch 'master'.

Further work on UML Instances. Main changes:

- Design cleanup: UMLInstance is slaved to UMLClassifier.
  Prominently, UMLInstance does not duplicate the UML attributes but
  holds references to the UML attributes.  The only additional item
  stored in UMLInstanceAttribute is the concrete attribute value.
- Inheritance cleanup:
  - UMLInstanceAttribute is derived from UMLObject.
  - UMLInstance is derived from UMLObject (this might be changed to
    UMLCanvasObject in future).
- Improvements in ClassifierWidget for handling instances.
- In list view,
  - in the menu popping up on right click on a class there is an
    additional choice "Instance". When selected, the attributes of
    the class are automatically transformed into the instance attributes
    of the new instance;
  - when a classifier derived instance has been created, an instance
    attribute value can be modified by double clicking on the instance
    attribute. Note that attribute _name_ change is not possible here;
    name change shall be done only using the master classifier.
- Improved XMI format for saving UMLInstanceAttribute.

Detailed changes:

umbrello/uml1model/instance.h
- Extend class documentation.  Distinguish standalone instance from
  instance slaved to classifier.
- Inherit from UMLObject instead of from UMLClassifier.
- Add Q_OBJECT declaration.
- At constructor add optional argument UMLClassifier *classifier
  defaulting to nullptr.
- Remove setter/getter for classifier name.
- At function setClassifierCmd add optional argument bool emitSignal
  defaulting to true.
- Remove function createAttribute (attribute creation and removal is
  done only via UMLClassifier; instance attributes are strictly slaved
  to the classifier attributes).
- Add function findChildObjectById(Uml::ID::Type) returning pointer to
  UMLInstanceAttribute.
- New type AttributeValues is a typedef of QList<UMLInstanceAttribute*>.
  It contains the attribute values in case this UMLInstance is slaved
  to a classifier.
- Add function getAttrValues returning AttributeValues&.
- Remove member m_classifier.
  The related classifier is now stored in UMLObject::m_pSecondary.
- Add member m_attrValues of type AttributeValues.
- Add public slots attributeAdded(UMLClassifierListItem*) and
  attributeRemoved(UMLClassifierListItem*).  In case the instance is
  slaved to a classifier they are connected to the corresponding signals
  of m_classifier.

umbrello/uml1model/instance.cpp
- In constructor,
  - remove call to Object_Factory::createUMLObject for creating the
    master class;
  - assign m_classifier from argument `c';
  - call setClassifierCmd(c, false).
- Adapt functions setClassifier and setClassifierCmd to replacement of
  m_classifier by UMLObject::m_pSecondary.
- In function setClassifierCmd, if classifier is non null then
  - create a UMLInstanceAttribute for each of the classifier's
    attributes and fill m_attrValues;
  - connect the classifier's attributeAdded/attributeRemoved signals to
    the instance's corresponding slots.
- Adjust function classifier() to m_pSecondary possibly being null (in
  case of an untyped instance).
- New function findChildObjectById seeks the given ID in the XMI IDs of
  m_attrValues and returns pointer to the UMLInstanceAttribute if found.
- New function getAttrValues returns m_attrValues.
- Adjust function saveToXMI1 to use of m_pSecondary for the classifier.
- Adjust function load1 to load the instance attributes from XML tag
  "slot" instead of "UML:InstanceAttribute".
- Adjust function resolveRef to the possibility of m_pSecondary
  legitimately being nullptr.
- In new slot function attributeAdded, add UMLInstanceAttribute
  corresponding to the UMLAttribute into m_attrValues.
- In new slot function attributeRemoved, iterate over m_attrValues and
  test whether the given item is equal to one of the InstanceAttribute's
  parent. Remove the matching instance attribute from m_attrValues.

umbrello/uml1model/instanceattribute.{h,cpp}
- Extend class documentation mentioning that the UMLInstanceAttribute is
  strictly slaved to its corresponding classifier's UMLAttribute.
- Inherit from UMLObject instead of from UMLAttribute.
- At constructor,
  - change type of `parent' to UMLInstance* to more precisely express
    the expected parent type;
  - replace arguments `name', `id', `s', `type' by argument umlAttr of
    type UMLAttribute*.
    UMLObject::m_pSecondary is used for saving the master attribute.
- Remove explicit constructor with single argument `parent'.
- Add accessors setAttribute, getAttribute.
- Remove accessors setAttributes, getAttributes.
- New function toString returns the textual notation for the instance
  attribute.
- Remove member m_attributes.
- Add member m_value.

umbrello/uml1model/instanceattribute.cpp
- In new accessor functions setAttribute/getAttribute manipulate
  UMLObject::m_pSecondary.
  In function setAttribute require the incoming umlAttr to be non null.
- In new accessor functions setValue/getValue manipulate m_value.
- In function saveToXMI1:
  - Replace tag "UML:InstanceAttribute" by "slot".
    This is somewhat more UML 1.4 compliant and is more in line with
    UML2 InstanceSpecification save format.
  - Replace saving of XML attribute "attributes" by "attribute"
    referencing the parent UMLAttribute XMI ID.
  - Replace saving of XML attribute "initialValue" by "value" writing
    member m_value.
- Change function load1 commensurate to saveToXMI1. Load XML attribute
  "attribute" into m_SecondaryId. If m_SecondaryId can be resolved ad
  hoc then set m_pSecondary to the master UMLAttribute, else defer
  resolution to the resolveRef() pass.

umbrello/cmds/generic/cmdrenameumlinstancetype.{h,cpp}
- Remove. Reason: Renaming the instance's associated classifier is not
  supported.  Rather, the classifier itself shall be renamed.

umbrello/CMakeLists.txt
- Remove cmds/generic/cmdrenameumlinstancetype.cpp from libcmds_SRCS.

umbrello/cmds.h
- Remove #include "cmds/generic/cmdrenameumlinstancetype.h".

umbrello/dialogs/pages/classgeneralpage.cpp
- In function apply() non null m_pObject remove call to
  m_pObject->asUMLInstance()->setClassifierName().

umbrello/dialogs/umlinstanceattributedialog.{h,cpp}
- #include "instanceattribute.h" instead of attribute.h.
- At constructor change argument
    UMLAttribute *pAttribute
  to
    UMLInstanceAttribute *pInstanceAttr.
- Change private member
    UMLAttribute *m_pAttribute
  to
    UMLInstanceAttribute *m_pInstanceAttr.
- Remove slots section with slotNameChanged(const QString &).

umbrello/dialogs/umlinstanceattributedialog.cpp
- #include "attribute.h" instead of classifier.h.
- In constructor:
  - Remove signal textChanged() to slotNameChanged() connection.
  - Set ui->nameLE ReadOnly - renaming of the master classifier shall be
    done via the classifier dialog.
  - Initialize text of ui->valueLE to pInstanceAttr->getValue(), or if
    empty then to pInstanceAttr->getAttribute()->getInitialValue().
- In function apply():
  - Remove logic related to changing the classifier name.
  - Call m_pInstanceAttr->setValue(value) and
    m_pInstanceAttr->emitModified().

umbrello/uml1model/classifier.cpp
- In function takeItem remove case UMLObject::ot_InstanceAttribute.
  Reason: subordinates() no longer contain instance attributes because
  class UMLInstanceAttribute does not inherit UMLClassifierListItem.

umbrello/umlwidgets/classifierwidget.{h,cpp}
- At constructor change type of argument `c' from UMLClassifier* to
  UMLObject*.  Reason: UMLInstance does not inherit UMLClassifier.

umbrello/umlwidgets/classifierwidget.cpp
- In function displayedMembers, if umlc is null and m_umlObject is a
  UMLInstance and `ot' is ot_Attribute then set umlc to
  m_umlObject->asUMLInstance()->classifier().
- In function calculateSize,
  - if umlc is null and m_umlObject is a UMLInstance then set umlc to
    m_umlObject->asUMLInstance()->classifier();
  - adjust code to the possibility that m_umlObject is legitimately a
    nullptr.
- In function displayedAttributes call displayedMembers() with argument
  UMLObject::ot_Attribute regardless of baseType().
  Reason: Function displayedMembers handles UMLInstance autonomously.
- In function setClassAssociationWidget improve error message for case
  !classifier().
- In function paint() :
  - If umlc is null and m_umlObject is a UMLInstance then set umlc to
    m_umlObject->asUMLInstance()->classifier();
  - Adjust code to the possibility of m_umlObject legitimately being a
    nullptr;
  - In code for drawing name,
    - streamline calculation of displayedName;
    - if baseType() is wt_Object or wt_Instance then enable underlining.
  - In code for drawing attributes call drawMembers() with argument
    UMLObject::ot_Attribute regardless of baseType().
    Reason: Function drawMembers handles UMLInstance autonomously.
- In function drawMembers :
  - Local bool drawInstanceAttributes is set true when m_umlObject is a
    UMLInstance and argument `ot' is ot_Attribute.
  - Return without action if umlc is null and drawInstanceAttributes is
    false.
  - If drawInstanceAttributes is true then
    - local UMLInstance::AttributeValues ialist is filled using
        m_umlObject->asUMLInstance()->getAttrValues();
    - umlc is set to m_umlObject->asUMLInstance()->classifier().
  - For iterating over `list' replace foreach-loop by for-loop.
    Reason: Index `i' is used for indexing both `list' and `ialist'.
    If drawInstanceAttributes is true then the name is taken from
    list.at(i) and the value is taken from ialist.at(i).
- In function slotMenuSelection remove case mt_InstanceAttribute from
  classifier list item handling.
  Reason: UMLInstanceAttribute is not a UMLClassifierListItem.

umbrello/umllistviewitem.{h,cpp}
- Rename function addClassifierListItem to addChildItem and change its
  `child' argument type to UMLObject*.
  Reason: The function is extended to handle instance attributes (which
  are not of type UMLClassifierListItem).
- At functions deleteChildItem and findChildObject change argument type
  to UMLObject*.  Reason: The functions are extended to handle instance
  attributes (which are not of type UMLClassifierListItem).
- At type ChildObjectMap change key of QMap from UMLClassifierListItem*
  to UMLObject*.  Reason: The map now also stores instance attributes.

umbrello/umllistviewitem.cpp
- In function updateObject handle case (ot == ot_InstanceAttribute).

umbrello/umllistview.cpp
- In function slotMenuSelection add case ListPopupMenu::mt_Instance.
- In function mayHaveChildItems return false for case ot_Instance.
  Reason: UMLInstanceAttribute is not a UMLClassifierListItem.
- In function connectNewObjectsSlots case UMLObject::ot_Instance remove
  connecting of childObjectAdded.
  Reason: On constructing new UMLInstance the instance attributes are
  automatically added using the master classifier.
  Adding/removing attributes is done at the classifier only; dependent
  instances are updated automatically by a different signal connection.
- In function moveObject handle case lvt_Instance alongside Interface/
  Enum/Datatype.
- In function addNewItem case !Model_Utils::typeIsClassifierList(type),
  - local bool instanceOfClass is true if type is lvt_Instance and
    parent is a UMLClassifier;
  - local `package' is set to parent->umlPackage() if instanceOfClass
    is true;
  - if instanceOfClass is true then construct list view items for the
    UMLInstance::AttributeValues of object->asUMLInstance().
- In function isUnique add handling of UMLListViewItem::lvt_Instance.
- In function loadChildrenFromXMI add handling of lvt_InstanceAttribute.

umbrello/object_factory.cpp
- In function createNewUMLObject case UMLObject::ot_Instance, if
  parentPkg is a UMLClassifier then
  - local temporary UMLClassifier *c acts as shorthand for
    parentPkg->asUMLClassifier();
  - call to o->asUMLInstance()->setClassifierCmd(c) automatically
    constructs the instance attributes corresponding to the attributes
    of `c';
  - parentPkg is set to c->umlPackage() to normalize parentage for the
    new UMLInstance.
- In function createChildObject :
  - In switch (type) remove case UMLObject::ot_InstanceAttribute.
    Reason: We use special logic for creating instance attributes.
  - Before returning, check that returnObject can be cast to
    UMLClassifierListItem* and log an error if it can't.

umbrello/model_utils.cpp
- In function findObjectInList handle case UMLObject::ot_Instance
  separately from classifier derived types.
  Reason: UMLInstance is not a UMLClassifier.
- In function isClassifierListitem return false for type
  UMLObject::ot_InstanceAttribute.
  Reason: UMLInstanceAttribute is not a UMLClassifierListItem.
- In function typeIsCanvasWidget return true for case lvt_Instance.
- In function typeIsClassifierList return false for type
  UMLListViewItem::lvt_InstanceAttribute.
  Reason: UMLInstanceAttribute is not a UMLClassifierListItem.
- In function typeIsAllowedInType,
  - for case lvt_Attribute return (parentType == lvt_Class);
  - for case lvt_InstanceAttribute return (parentType == lvt_Instance).
- In function typeIsAllowedInDiagram :
  - In case Uml::DiagramType::Class accept UMLObject::ot_Instance.
    This prepares for using class diagram in style of UML2 composite
    structure diagram.
  - In case Uml::DiagramType::Object accept UMLObject::ot_Instance.

umbrello/assocrules.cpp
- In m_AssocRules[] AssociationType Coll_Mesg_Sync and Coll_Mesg_Async,
  - permit wt_Instance as widgetA/widgetB;
  - permit combinations of wt_Object/wt_Instance as widgetA/widgetB.
  This prepares for supporting instances in collaboration diagrams.

umbrello/version.h
- Increase XMI_FILE_VERSION to "1.7.2" due to changed save format of
  UMLInstanceAttribute.

M  +0    -1    umbrello/CMakeLists.txt
M  +6    -0    umbrello/assocrules.cpp
M  +2    -3    umbrello/cmds.h
D  +0    -42   umbrello/cmds/generic/cmdrenameumlinstancetype.cpp
D  +0    -40   umbrello/cmds/generic/cmdrenameumlinstancetype.h
M  +1    -2    umbrello/dialogs/pages/classgeneralpage.cpp
M  +14   -28   umbrello/dialogs/umlinstanceattributedialog.cpp
M  +4    -7    umbrello/dialogs/umlinstanceattributedialog.h
M  +27   -11   umbrello/model_utils.cpp
M  +19   -12   umbrello/object_factory.cpp
M  +1    -11   umbrello/uml1model/classifier.cpp
M  +120  -99   umbrello/uml1model/instance.cpp
M  +48   -14   umbrello/uml1model/instance.h
M  +83   -34   umbrello/uml1model/instanceattribute.cpp
M  +27   -13   umbrello/uml1model/instanceattribute.h
M  +51   -11   umbrello/umllistview.cpp
M  +24   -14   umbrello/umllistviewitem.cpp
M  +5    -5    umbrello/umllistviewitem.h
M  +17   -13   umbrello/umlscene.cpp
M  +83   -60   umbrello/umlwidgets/classifierwidget.cpp
M  +2    -2    umbrello/umlwidgets/classifierwidget.h
M  +1    -1    umbrello/version.h
M  +3    -2    umbrello/worktoolbar.cpp

https://invent.kde.org/sdk/umbrello/commit/3203b16acd7adfbed909bdfe7be40eb5c302dad0
Comment 16 Oliver Kellogg 2021-01-07 06:54:51 UTC
Git commit 3337da29ac1b938a6a5bb704620ee226332d8171 by Oliver Kellogg.
Committed on 07/01/2021 at 06:54.
Pushed by okellogg into branch 'master'.

Followup to commit 3203b16a work on UML Instances,
> Inheritance cleanup:
> - UMLInstance is derived from UMLObject (this might be changed to
>   UMLCanvasObject in future).

umbrello/uml1model/instance.{h,cpp}
- Derive UMLInstance from UMLCanvasObject.
- Remove function findChildObjectById, use inherited function.
- Remove type AttributeValues and function getAttrValues, use function
  subordinates() of superclass.
- Remove member m_attrValues, it is obsoleted by UMLCanvasObject member
  m_List.

umbrello/umlwidgets/classifierwidget.cpp
- Synchronize function drawMembers with the above changes.

umbrello/umllistview.cpp
- In function connectNewObjectsSlots fix indentation of switch cases.
- Synchronize functions addNewItem and loadChildrenFromXMI with the
  changes in class UMLInstance.

M  +14   -34   umbrello/uml1model/instance.cpp
M  +4    -20   umbrello/uml1model/instance.h
M  +53   -46   umbrello/umllistview.cpp
M  +10   -4    umbrello/umlwidgets/classifierwidget.cpp

https://invent.kde.org/sdk/umbrello/commit/3337da29ac1b938a6a5bb704620ee226332d8171
Comment 17 Oliver Kellogg 2021-01-07 11:34:51 UTC
Git commit 9cd1e80cabc347a3dd07e9de3e68d13cc040fd57 by Oliver Kellogg.
Committed on 07/01/2021 at 11:34.
Pushed by okellogg into branch 'master'.

Create listview item for untyped UMLInstance after loading from XMI:

umbrello/uml1model/instance.cpp
- In function resolveRef add calls to maybeSignalObjectCreated().

M  +5    -4    umbrello/uml1model/instance.cpp

https://invent.kde.org/sdk/umbrello/commit/9cd1e80cabc347a3dd07e9de3e68d13cc040fd57
Comment 18 Oliver Kellogg 2021-01-07 18:28:20 UTC
Git commit c80e77755dfb457363000c4deacae0633b41073b by Oliver Kellogg.
Committed on 07/01/2021 at 18:28.
Pushed by okellogg into branch 'master'.

Followup to commit 3203b16a - Clean up ClassifierWidget construction:
- The constructor which had originally taken a UMLClassifier* argument
  had been changed to take UMLObject* in order to be usable also for
  UMLInstance.  Changing the argument type to UMLObject* introduced an
  error in runtime method selection due to overlap with the constructor
  taking UMLPackage* argument.  Solution:

umbrello/umlwidgets/classifierwidget.{h,cpp}
- At constructor taking UMLObject* argument revert argument type to
  UMLClassifier*.
- Add new constructor taking UMLInstance* argument.

M  +28   -7    umbrello/umlwidgets/classifierwidget.cpp
M  +2    -1    umbrello/umlwidgets/classifierwidget.h

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