[Uml-devel] KDE/kdesdk/umbrello/umbrello

Sharan Rao sharanrao at gmail.com
Thu Jul 19 18:46:11 UTC 2007


SVN commit 689974 by sharan:

*things related to the Category List View Item like, RMB menu, drag and drop support etc.



 M  +14 -0     listpopupmenu.cpp  
 M  +2 -0      listpopupmenu.h  
 M  +1 -0      model_utils.cpp  
 M  +13 -0     umllistview.cpp  
 M  +1 -0      umllistviewitem.cpp  
 M  +2 -1      umlview.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.cpp #689973:689974
@@ -192,6 +192,10 @@
         mt = mt_Template;
         break;
 
+    case Uml::lvt_Category:
+        mt = mt_Category;
+        break;
+
     case Uml::lvt_Entity:
         mt = mt_Entity;
         break;
@@ -281,6 +285,7 @@
     switch(type) {
     case Uml::wt_Actor:
     case Uml::wt_UseCase:
+    case Uml::wt_Category:
         setupColor(object -> getUseFillColour());
         insertStdItems(true, type);
         insertStdItem(mt_Rename);
@@ -611,6 +616,9 @@
     case mt_EntityRelationship_Diagram:
         m_pInsert->addAction(UMLApp::app()->actionCollection()->action("new_entityrelationship_diagram"));
         break;
+    case mt_Category:
+        m_pInsert->insertItem(m_pixmap[pm_Category], i18n("Category"), mt_Category);
+        break;
     case mt_Actor:
         m_pInsert->insertItem(m_pixmap[pm_Actor], i18n("Actor"), mt_Actor);
         break;
@@ -883,6 +891,9 @@
     case mt_Operation:
         type = Uml::ot_Operation;
         break;
+    case mt_Category:
+        type = Uml::ot_Category;
+        break;
     default:
         break;
     }
@@ -914,6 +925,7 @@
     m_pixmap[pm_Component]   .load(dataDir+"component.png",     "PNG");
     m_pixmap[pm_Node]        .load(dataDir+"node.png",          "PNG");
     m_pixmap[pm_Entity]      .load(dataDir+"entity.png",        "PNG");
+    m_pixmap[pm_Category]    .load(dataDir+"category.png",      "PNG");
     m_pixmap[pm_Artifact]    .load(dataDir+"artifact.png",      "PNG");
     m_pixmap[pm_Text]        .load(dataDir+"text.png",          "PNG");
     m_pixmap[pm_Subsystem]   .load(dataDir+"subsystem.png",     "PNG");
@@ -964,6 +976,7 @@
         m_pInsert = new KMenu(this);
         insertStdItem(mt_EntityRelationship_Folder);
         insertStdItem(mt_Entity);
+        insertStdItem(mt_Category);
         insertStdItem(mt_EntityRelationship_Diagram);
         insertFileNew();
         insertSeparator();
@@ -1234,6 +1247,7 @@
     case mt_EntityAttribute:
     case mt_Operation:
     case mt_Template:
+    case mt_Category:
 
         insertStdItems(false);
         insertStdItem(mt_Properties);
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.h #689973:689974
@@ -83,6 +83,7 @@
         mt_ForeignKeyConstraint,
         mt_CheckConstraint,
         mt_Object,
+        mt_Category,
         mt_Initial_State,
         mt_End_State,
         mt_State,
@@ -327,6 +328,7 @@
         pm_EndState,
         pm_Branch,
         pm_Object,
+        pm_Category,
         pm_Component,
         pm_Node,
         pm_Artifact,
--- trunk/KDE/kdesdk/umbrello/umbrello/model_utils.cpp #689973:689974
@@ -712,6 +712,7 @@
         case Uml::lvt_Datatype:
         case Uml::lvt_Enum:
         case Uml::lvt_Entity:
+        case Uml::lvt_Category:
             return true;
             break;
         default:
--- trunk/KDE/kdesdk/umbrello/umbrello/umllistview.cpp #689973:689974
@@ -43,6 +43,7 @@
 #include "artifact.h"
 #include "enum.h"
 #include "entity.h"
+#include "category.h"
 #include "docwindow.h"
 #include "listpopupmenu.h"
 #include "template.h"
@@ -300,6 +301,10 @@
         addNewItem(temp, Uml::lvt_Entity);
         break;
 
+    case ListPopupMenu::mt_Category:
+        addNewItem(temp, Uml::lvt_Category);
+        break;
+
     case ListPopupMenu::mt_Datatype:
         addNewItem(temp, Uml::lvt_Datatype);
         break;
@@ -949,6 +954,7 @@
         case Uml::lvt_Datatype :
         case Uml::lvt_Enum :
         case Uml::lvt_Entity :
+        case Uml::lvt_Category:
             if(item->getUMLObject() == obj)
                 return item;
             break;
@@ -1278,6 +1284,7 @@
             break;
         case Uml::lvt_Entity:
         case Uml::lvt_EntityRelationship_Diagram:
+        case Uml::lvt_Category:
             accept = (dstType == Uml::lvt_EntityRelationship_Folder);
             break;
         default:
@@ -1418,6 +1425,7 @@
         break;
     case Uml::lvt_EntityRelationship_Folder:
     case Uml::lvt_Entity:
+    case Uml::lvt_Category:
     case Uml::lvt_EntityRelationship_Diagram:
         if (newParentType == Uml::lvt_EntityRelationship_Folder ||
                 newParentType == Uml::lvt_EntityRelationship_Model) {
@@ -1676,6 +1684,7 @@
     case Uml::lvt_Datatype:
     case Uml::lvt_Enum:
     case Uml::lvt_Entity:
+    case Uml::lvt_Category:
     case Uml::lvt_Logical_Folder:
     case Uml::lvt_UseCase_Folder:
     case Uml::lvt_Component_Folder:
@@ -2166,6 +2175,10 @@
         object = new UMLEntity( name );
         break;
 
+    case Uml::ot_Category:
+        object = new UMLCategory(name );
+        break;
+
     default:
         kWarning() << "creating UML Object of unknown type" << endl;
         return NULL;
--- trunk/KDE/kdesdk/umbrello/umbrello/umllistviewitem.cpp #689973:689974
@@ -324,6 +324,7 @@
     case Uml::lvt_Subsystem:
     case Uml::lvt_Component:
     case Uml::lvt_Node:
+    case Uml::lvt_Category:
         if (m_pObject == NULL || !doc->isUnique(newText)) {
             cancelRenameWithMsg();
             return;
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #689973:689974
@@ -518,6 +518,7 @@
     case ot_Enum:
     case ot_Entity:
     case ot_Datatype:
+    case ot_Category:
         createAutoAssociations(newWidget);
         // We need to invoke createAutoAttributeAssociations()
         // on all other widgets again because the newly created
@@ -640,7 +641,7 @@
                 bAccept = false;
             break;
         case dt_EntityRelationship:
-            if (ot != ot_Entity)
+            if (ot != ot_Entity && ot != ot_Category)
                 bAccept = false;
             break;
         default:




More information about the umbrello-devel mailing list