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

Sharan Rao sharanrao at gmail.com
Tue Jul 17 20:14:40 UTC 2007


SVN commit 689167 by sharan:

---Start of Support for Extended Entity Relationship Modelling --
Added support for making "categories" and "category widgets".
Widgets can only be drawn currently ( and moved around ).
Lots more to come :)



 M  +2 -0      CMakeLists.txt  
 A             category.cpp   [License: GPL (v2+)]
 A             category.h   [License: GPL (v2+)]
 A             categorywidget.cpp   [License: GPL (v2+)]
 A             categorywidget.h   [License: GPL (v2+)]
 M  +15 -0     model_utils.cpp  
 M  +4 -0      object_factory.cpp  
 M  +2 -2      pics/CMakeLists.txt  
 AM            pics/category.png  
 AM            pics/cursor-category.png  
 A             pics/sources/category.svg  
 A             pics/sources/cursor-category.svg  
 M  +1 -0      toolbarstateother.cpp  
 M  +4 -0      umllistview.cpp  
 M  +8 -2      umlnamespace.h  
 M  +1 -0      umlview.cpp  
 M  +5 -0      widget_factory.cpp  
 M  +4 -2      worktoolbar.cpp  
 M  +3 -2      worktoolbar.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #689166:689167
@@ -248,6 +248,8 @@
    assocrules.cpp 
    attribute.cpp 
    boxwidget.cpp 
+   category.cpp
+   categorywidget.cpp
    checkconstraint.cpp
    classifier.cpp 
    classifiercodedocument.cpp 
--- trunk/KDE/kdesdk/umbrello/umbrello/model_utils.cpp #689166:689167
@@ -265,6 +265,8 @@
             currentName = i18n("new_folder");
         else if(type == Uml::ot_Association)
             currentName = i18n("new_association");
+        else if(type == Uml::ot_Category)
+            currentName = i18n("new_category");
         else {
             currentName = i18n("new_object");
             kWarning() << "unknown object type in umldoc::uniqObjectName()" << endl;
@@ -362,6 +364,7 @@
         case Uml::ot_UniqueConstraint:
         case Uml::ot_ForeignKeyConstraint:
         case Uml::ot_CheckConstraint:
+        case Uml::ot_Category:
             mt = Uml::mt_EntityRelationship;
             break;
         case Uml::ot_Association:
@@ -981,6 +984,10 @@
         type = Uml::lvt_Entity;
         break;
 
+    case Uml::ot_Category:
+        type = Uml::lvt_Category;
+        break;
+
     case Uml::ot_EntityAttribute:
         type = Uml::lvt_EntityAttribute;
         break;
@@ -1069,6 +1076,10 @@
         ot = Uml::ot_Entity;
         break;
 
+    case Uml::lvt_Category:
+        ot = Uml::ot_Category;
+        break;
+
     case Uml::lvt_EntityAttribute:
         ot = Uml::ot_EntityAttribute;
         break;
@@ -1176,6 +1187,9 @@
         case Uml::lvt_Entity:
             icon = Uml::it_Entity;
             break;
+        case Uml::lvt_Category:
+            icon = Uml::it_Category;
+            break;
         case Uml::lvt_Template:
             icon = Uml::it_Template;
             break;
@@ -1292,6 +1306,7 @@
         case Uml::ot_UniqueConstraint:
         case Uml::ot_ForeignKeyConstraint:
         case Uml::ot_CheckConstraint:
+        case Uml::ot_Category:
             mt = Uml::mt_EntityRelationship;
             break;
         default:
--- trunk/KDE/kdesdk/umbrello/umbrello/object_factory.cpp #689166:689167
@@ -37,6 +37,7 @@
 #include "node.h"
 #include "artifact.h"
 #include "stereotype.h"
+#include "category.h"
 #include "association.h"
 #include "umldoc.h"
 #include "uml.h"
@@ -114,6 +115,9 @@
         case Uml::ot_Folder:
             o = new UMLFolder(name, g_predefinedId);
             break;
+        case Uml::ot_Category:
+            o = new UMLCategory(name, g_predefinedId);
+            break;
         default:
             kWarning() << "createNewUMLObject error unknown type: " << type << endl;
             return NULL;
--- trunk/KDE/kdesdk/umbrello/umbrello/pics/CMakeLists.txt #689166:689167
@@ -9,9 +9,9 @@
 final_activity.png  end_state.png  generalisation.png  initial_state.png  interface.png  join.png  junction.png  datatype.png  enum.png  
 message-synchronous.png  message-asynchronous.png  note.png pin.png object_node.png object.png  
 startlogo.png  template.png  text.png  
-class.png  uniassociation.png  usecase.png  branch.png  fork.png  state-fork.png  package.png  artifact.png  
+class.png  uniassociation.png  usecase.png category.png  branch.png  fork.png  state-fork.png  package.png  artifact.png  
 box.png  node.png  entity.png  relationship.png  subsystem.png foreignkey_constraint.png unique_constraint.png primarykey_constraint.png check_constraint.png cursor-actor.png  message-found.png  accept_signal.png  accept_time_event.png  send_signal.png    cursor-andline.png  
-cursor-choice-rhomb.png  cursor-choice-round.png  cursor-combined_fragment.png  cursor-deep-history.png  cursor-join.png  cursor-junction.png  
+cursor-choice-rhomb.png  cursor-choice-round.png  cursor-combined_fragment.png  cursor-deep-history.png  cursor-join.png  cursor-junction.png  cursor-category.png
 cursor-shallow-history.png  cursor-state-fork.png  cursor-usecase.png  cursor-initial_state.png  cursor-package.png  
 cursor-aggregation.png  cursor-component.png  cursor-containment.png  cursor-interface.png  cursor-datatype.png  
 cursor-enum.png  cursor-text.png  cursor-anchor.png cursor-pin.png cursor-composition.png  cursor-message-asynchronous.png  
** trunk/KDE/kdesdk/umbrello/umbrello/pics/category.png #property svn:mime-type
   + application/octet-stream
** trunk/KDE/kdesdk/umbrello/umbrello/pics/cursor-category.png #property svn:mime-type
   + application/octet-stream
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstateother.cpp #689166:689167
@@ -78,6 +78,7 @@
         case WorkToolBar::tbb_Enum:         ot = ot_Enum;           break;
         case WorkToolBar::tbb_Entity:       ot = ot_Entity;         break;
         case WorkToolBar::tbb_Datatype:     ot = ot_Datatype;       break;
+        case WorkToolBar::tbb_Category:     ot = ot_Category;       break;
 
         default:                            ot = ot_UMLObject;      break;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/umllistview.cpp #689166:689167
@@ -793,6 +793,7 @@
     case Uml::ot_Artifact:
     case Uml::ot_Node:
     case Uml::ot_Folder:
+    case Uml::ot_Category:
         connect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));
         break;
     case Uml::ot_UMLObject:
@@ -1763,6 +1764,7 @@
         break;
     case Uml::lvt_EntityRelationship_Diagram:
     case Uml::lvt_Entity:
+    case Uml::lvt_Category:
         parent = m_lv[Uml::mt_EntityRelationship];
         break;
     default:
@@ -2021,6 +2023,7 @@
     case Uml::lvt_Enum:
     case Uml::lvt_Entity:
     case Uml::lvt_UseCase:
+    case Uml::lvt_Category:
         {
             Uml::Object_Type ot = Model_Utils::convert_LVT_OT(type);
             if (! ot) {
@@ -2388,6 +2391,7 @@
     case Uml::lvt_UseCase:
     case Uml::lvt_Node:
     case Uml::lvt_Artifact:
+    case Uml::lvt_Category:
         return !m_doc->findUMLObject( name, Model_Utils::convert_LVT_OT(type) );
         break;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/umlnamespace.h #689166:689167
@@ -58,7 +58,8 @@
     ot_EntityConstraint,
     ot_UniqueConstraint,
     ot_ForeignKeyConstraint,
-    ot_CheckConstraint
+    ot_CheckConstraint,
+    ot_Category
 };
 
 class Visibility {
@@ -115,7 +116,8 @@
     wt_Signal,                  // does not have UMLObject representation
     wt_Pin,
     wt_ObjectNode,
-    wt_Region
+    wt_Region,
+    wt_Category                 // has UMLObject representation
 };
 
 enum Diagram_Type
@@ -154,6 +156,8 @@
     at_Activity,
     at_Exception,
     at_Relationship,
+    at_Category2Parent,
+    at_Child2Category,
     at_Unknown  =  - 1
 };
 
@@ -230,6 +234,7 @@
     lvt_PrimaryKeyConstraint,
     lvt_ForeignKeyConstraint,
     lvt_CheckConstraint,
+    lvt_Category,
     lvt_Unknown = -1
 };
 
@@ -262,6 +267,7 @@
     it_Entity,
     it_Actor,
     it_UseCase,
+    it_Category,
     it_Public_Method,
     it_Private_Method,
     it_Protected_Method,
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #689166:689167
@@ -1578,6 +1578,7 @@
     case wt_Datatype:
     case wt_Actor:
     case wt_UseCase:
+    case wt_Category:
         {
             Uml::IDType id = pWidget -> getID();
             Uml::IDType newID = log->findNewID( id );
--- trunk/KDE/kdesdk/umbrello/umbrello/widget_factory.cpp #689166:689167
@@ -44,6 +44,7 @@
 #include "usecase.h"
 #include "notewidget.h"
 #include "boxwidget.h"
+#include "category.h"
 #include "associationwidget.h"
 #include "messagewidget.h"
 #include "objectwidget.h"
@@ -57,6 +58,7 @@
 #include "floatingdashlinewidget.h"
 #include "objectnodewidget.h"
 #include "pinwidget.h"
+#include "categorywidget.h"
 #include "cmds.h"
 
 namespace Widget_Factory {
@@ -136,6 +138,9 @@
             newWidget = ow;
         }
         break;
+    case Uml::ot_Category:
+        newWidget = new CategoryWidget(view, static_cast<UMLCategory*>(o));
+        break;
     default:
         kWarning() << "trying to create an invalid widget" << endl;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/worktoolbar.cpp #689166:689167
@@ -173,6 +173,7 @@
     case Uml::dt_EntityRelationship:
         insertHotBtn(tbb_Entity);
         insertHotBtn(tbb_Relationship);
+        insertHotBtn(tbb_Category);
         break;
 
     default:
@@ -321,7 +322,8 @@
         { tbb_Coll_Message, i18n("Message"), "message-asynchronous.png", SLOT(slotColl_Message()) },
         { tbb_Exception, i18n("Exception"), "exception.png", SLOT(slotException()) },
         { tbb_Object_Node, i18n("Object Node"), "object_node.png", SLOT(slotObject_Node()) },
-        { tbb_PrePostCondition, i18n("Pre/Post condition"), "PrePostCondition.png", SLOT(slotPrePostCondition()) }
+        { tbb_PrePostCondition, i18n("Pre/Post condition"), "PrePostCondition.png", SLOT(slotPrePostCondition()) },
+        { tbb_Category, i18n("Category"), "category.png", SLOT(slotCategory())  }
     };
 
 
@@ -410,6 +412,6 @@
 void WorkToolBar::slotException() {buttonChanged(tbb_Exception);}
 void WorkToolBar::slotObject_Node() {buttonChanged(tbb_Object_Node);}
 void WorkToolBar::slotPrePostCondition() {buttonChanged(tbb_PrePostCondition);}
+void WorkToolBar::slotCategory() {buttonChanged(tbb_Category);}
 
-
 #include "worktoolbar.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/worktoolbar.h #689166:689167
@@ -131,7 +131,8 @@
         tbb_Andline,
         tbb_Exception,
         tbb_Object_Node,
-        tbb_PrePostCondition
+        tbb_PrePostCondition,
+        tbb_Category
     };
 
 private:
@@ -258,8 +259,8 @@
     void slotPrePostCondition();
     void slotPin();
     void slotObject_Node();
+    void slotCategory();
 
-
 };
 
 #endif




More information about the umbrello-devel mailing list