Bug 69592

Summary: Interfaces should allowed to be Object canvas items
Product: [Applications] umbrello Reporter: Roman Kalukiewicz <roman.kalukiewicz>
Component: generalAssignee: Oliver Kellogg <okellogg>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Roman Kalukiewicz 2003-12-03 18:40:05 UTC
Version:           1.2 (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages

I'm not sure, but I think, that it should be possible to put an interface in a sequence diagram. It is really common to design a part of a system, and to specify interfaces, when we don't care for implementation, so it would be really usefull.
Now when we drag an interface to a diagram it is displayed in the same way, as in class diagram. I expect that it should be shown in the same way as a class (or in a different way - I'm not an UML expert ;) )

Thanks in advance
Romek Kalukiewicz
Comment 1 Jonathan Riddell 2003-12-06 14:51:12 UTC
Interesting one this, may take more of a UML expert than me to answer it.  Sequence diagrams can only have objects (i.e. class instances) on them.  Interfaces can't have instances by definition but you could have a class instance cast into an interface.  

Any ideas?
Comment 2 Roman Kalukiewicz 2003-12-15 13:03:20 UTC
hmm.. I think, that even if interface can't be in a sequence diagram (I can't imagine any reason), then it would be usefull.
Now when we can drag an interface into a sequence diagram and it looks as in class diagram, a lot better solution would be to draw it as class in sequence diagram.

As you said sequence diag. can only have objects, but interface instances ARE in fact objects. You can't instantiate interface, but you can have a interface instance.

PS. You can put an abstract class instance into sequence diagram, then why not to put an interface instance there ;P
Comment 3 Jonathan Riddell 2003-12-22 16:44:36 UTC
I think I agree.  A job for Umbrello 1.3.
Comment 4 Nicolas Dumoulin 2005-01-25 14:43:20 UTC
I think too that an interface could be added to a sequence (or activity diagram).
I'm currently designing a generic framework, and I would represent in a sequence the passing through a method of an interface.
The design pattern Strategy is a good example of the need of call a method of an interface.
Comment 5 Oliver Kellogg 2005-01-25 18:40:59 UTC
CVS commit by okellogg: 

BUG:69592 - allow interfaces as Object canvas items


  M +2 -2      ChangeLog   1.60
  M +14 -5     umbrello/umlview.cpp   1.204


--- kdesdk/umbrello/ChangeLog  #1.59:1.60
@@ -17,5 +17,5 @@
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
 53380 53384 54928 55058 55242 57879       61945 62321 63316
-67062 67723       71978 74249 74952 75010 77645       80405
+67062 67723 69592 71978 74249 74952 75010 77645       80405
 80559 82342 85377 86083 86828 86952 86958 87111 87537 87956
 87995 88152 88245 88415 88954 89334 89485 89553 89563 89579
@@ -24,5 +24,5 @@
 92781 92995 93122 93219 93297 93298 93501 93595 93696 94173
 94728 94795 94883 95082 95247 95252 95722 95924 95951 95954
-96216 96221
+96216 96221 96964 97155 97182 97697
 
 Version 1.3

--- kdesdk/umbrello/umbrello/umlview.cpp  #1.203:1.204
@@ -485,10 +485,18 @@ void UMLView::slotObjectCreated(UMLObjec
                 newWidget = new EntityWidget(this, static_cast<UMLEntity*>(o));
         } else if(type == ot_Interface) {
-                InterfaceWidget* interfaceWidget = new InterfaceWidget(this, static_cast<UMLInterface*>(o));
                 Diagram_Type diagramType = getType();
+                if (diagramType == dt_Sequence || diagramType == dt_Collaboration) {
+                        ObjectWidget *ow = new ObjectWidget(this, o, getLocalID() );
+                        if (m_Type == dt_Sequence) {
+                                y = ow->topMargin();
+                        }
+                        newWidget = ow;
+                } else {
+                        InterfaceWidget* interfaceWidget = new InterfaceWidget(this, static_cast<UMLInterface*>(o));
                 if (diagramType == dt_Component || diagramType == dt_Deployment) {
                         interfaceWidget->setDrawAsCircle(true);
                 }
                 newWidget = interfaceWidget;
+                }
         } else if(type == ot_Class ) { // CORRECT?
                 //see if we really want an object widget or class widget
@@ -604,5 +612,5 @@ void UMLView::contentsDragEnterEvent(QDr
         }
         if((diagramType == dt_Sequence || diagramType == dt_Collaboration) &&
-           ot != ot_Class && ot != ot_Actor) {
+           ot != ot_Class && ot != ot_Interface && ot != ot_Actor) {
                 e->accept(false);
                 return;
@@ -1500,4 +1508,5 @@ UMLObjectList* UMLView::getUMLObjects() 
                         case wt_Actor:
                         case wt_Class:
+                        case wt_Interface:
                         case wt_Package:
                         case wt_Component: