[Uml-devel] KDE/kdesdk/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu May 26 02:36:26 UTC 2005


SVN commit 418324 by okellogg:

BUG:88117 - Allow abstract class as interface in component diagram.


 M  +2 -2      ChangeLog  
 M  +15 -7     umbrello/umlview.cpp  


--- trunk/KDE/kdesdk/umbrello/ChangeLog #418323:418324
@@ -2,10 +2,10 @@
 
 * Association classes
 * Externalization of folders (i.e. submodel files)
-* Change interface into class and vice versa (if no attributes)
+* Change interface into class and vice versa (if abstract and no attributes)
 
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
-57588 79433 87252 105564
+57588 79433 87252 88117 105564
 
 Version 1.4.1 (maintenance release)
 
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #418323:418324
@@ -513,11 +513,14 @@
 			}
 		}
 		break;
-	case ot_Class: // CORRECT?
+	case ot_Class:
 		//see if we really want an object widget or class widget
-		if(getType() == dt_Class) {
+		if (m_Type == dt_Class || m_Type == dt_Component) {
 			UMLClassifier *c = static_cast<UMLClassifier*>(o);
-			newWidget = new ClassifierWidget(this, c);
+			ClassifierWidget *cw = new ClassifierWidget(this, c);
+			if (m_Type == dt_Component)
+				cw->setDrawAsCircle(true);
+			newWidget = cw;
 		} else {
 			ObjectWidget *ow = new ObjectWidget(this, o, getLocalID() );
 			if (m_Type == dt_Sequence) {
@@ -637,10 +640,15 @@
 		e->accept(false);
 		return;
 	}
-	if (diagramType == dt_Component &&
-	    (ot != ot_Interface && ot != ot_Component && ot != ot_Artifact)) {
-		e->accept(false);
-		return;
+	if (diagramType == dt_Component) {
+		if (ot != ot_Interface && ot != ot_Component && ot != ot_Artifact && ot != ot_Class) {
+			e->accept(false);
+			return;
+		}
+		if (ot == ot_Class && !temp->getAbstract()) {
+			e->accept(false);
+			return;
+		}
 	}
 	if (diagramType == dt_EntityRelationship &&
 	    (ot != ot_Entity )) {




More information about the umbrello-devel mailing list