[Uml-devel] branches/work/isi-umbrello/umbrello/umbrello

Caroline Bourdeu d'Aguerre cbda at free.fr
Thu Feb 8 00:14:32 UTC 2007


SVN commit 631432 by bourdeu:

Add tree new buttons in the tool bar of the activity diagram: send signal, accept signal and 
accept time event.



 M  +2 -0      CMakeLists.txt  
 M  +0 -24     combinedfragmentwidget.cpp  
 M  +1 -7      combinedfragmentwidget.h  
 M  +14 -0     listpopupmenu.cpp  
 M  +2 -2      pics/CMakeLists.txt  
 AM            pics/accept_signal.png  
 AM            pics/accept_time_event.png  
 AM            pics/cursor-accept_signal.png  
 AM            pics/cursor-accept_time_event.png  
 AM            pics/cursor-send_signal.png  
 AM            pics/send_signal.png  
 A             signalwidget.cpp   [License: GPL (v2+)]
 A             signalwidget.h   [License: GPL (v2+)]
 M  +5 -0      toolbarstateother.cpp  
 M  +3 -2      umlnamespace.h  
 M  +27 -0     umlview.cpp  
 M  +9 -1      worktoolbar.cpp  
 M  +6 -0      worktoolbar.h  


--- branches/work/isi-umbrello/umbrello/umbrello/CMakeLists.txt #631431:631432
@@ -313,6 +313,7 @@
    preconditionwidget.cpp
    seqlinewidget.cpp 
    statewidget.cpp 
+   signalwidget.cpp
    stereotype.cpp 
    template.cpp 
    textblock.cpp 
@@ -471,6 +472,7 @@
 #pythonimport.cpp \
 #seqlinewidget.cpp \
 #statewidget.cpp \
+#signalwidget.cpp \
 #stereotype.cpp \
 #template.cpp \
 #textblock.cpp \
--- branches/work/isi-umbrello/umbrello/umbrello/combinedfragmentwidget.cpp #631431:631432
@@ -171,30 +171,6 @@
     setCombinedFragmentType(getCombinedFragmentType(combinedfragmentType) );
 }
 
-void CombinedFragmentWidget::slotMenuSelection(int sel) {
-    bool done = false;
-
-    bool ok = false;
-    QString name = m_Text;
-
-    switch( sel ) {
-    case ListPopupMenu::mt_Rename:
-        name = KInputDialog::getText( i18n("Enter combined Fragment Name"), i18n("Enter the name of the new combined Fragment:"), m_Text, &ok );
-        if( ok && name.length() > 0 )
-            m_Text = name;
-        done = true;
-        break;
-
-    case ListPopupMenu::mt_Properties:
-        showProperties();
-        done = true;
-        break;
-    }
-
-    if( !done )
-        UMLWidget::slotMenuSelection( sel );
-}
-
 bool CombinedFragmentWidget::showProperties() {
 //     DocWindow *docwindow = UMLApp::app()->getDocWindow();
 //     docwindow->updateDocumentation(false);
--- branches/work/isi-umbrello/umbrello/umbrello/combinedfragmentwidget.h #631431:631432
@@ -47,7 +47,7 @@
     };
 
     /**
-     * Creates a Activity widget.
+     * Creates a Combined Fragment widget.
      *
      * @param view              The parent of the widget.
      * @param combinedfragmentType      The type of combined fragment.
@@ -117,12 +117,6 @@
      */
     CombinedFragmentType m_CombinedFragment;
 
-public slots:
-
-    /**
-     * Captures any popup menu signals for menus it created.
-     */
-    void slotMenuSelection(int sel);
 };
 
 #endif
--- branches/work/isi-umbrello/umbrello/umbrello/listpopupmenu.cpp #631431:631432
@@ -32,6 +32,7 @@
 #include "folder.h"
 #include "umlview.h"
 #include "statewidget.h"
+#include "signalwidget.h"
 #include "activitywidget.h"
 #include "preconditionwidget.h"
 #include "combinedfragmentwidget.h"
@@ -355,6 +356,19 @@
         insertStdItem(mt_Line_Color);
         break;
 
+    case Uml::wt_Signal:
+	setupColor( object -> getUseFillColour() );
+        insertSeparator();
+        insertStdItem(mt_Cut);
+        insertStdItem(mt_Copy);
+        insertStdItem(mt_Paste);
+        insertItem(SmallIcon( "editdelete"), i18n("Clear"), mt_Clear);
+        insertSeparator();
+        insertItem(i18n("Change Text..."), mt_Rename);
+        insertStdItem(mt_Delete);
+        insertStdItem(mt_Change_Font);
+        break;
+
     case Uml::wt_State:
         pState = static_cast< StateWidget *>( object );
         if( pState -> getStateType() == StateWidget::Normal ) {
--- branches/work/isi-umbrello/umbrello/umbrello/pics/CMakeLists.txt #631431:631432
@@ -10,7 +10,7 @@
 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  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  
-box.png  node.png  entity.png  relationship.png  subsystem.png cursor-actor.png  cursor-andline.png  
+box.png  node.png  entity.png  relationship.png  subsystem.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-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  
@@ -18,7 +18,7 @@
 cursor-class.png  cursor-artifact.png  cursor-dependency.png  cursor-message-synchronous.png  
 cursor-uniassociation.png  cursor-association.png  cursor-end_state.png  cursor-node.png  cursor-box.png  
 cursor-fork.png  cursor-note.png  cursor-branch.png  cursor-generalisation.png  cursor-object.png  
-cursor-entity.png  cursor-relationship.png precondition.png cursor-precondition.png message-found.png 
+cursor-entity.png  cursor-relationship.png precondition.png cursor-precondition.png  cursor-send_signal.png  cursor-accept_signal.png  cursor-accept_time_event.png
 cursor-message-found.png message-lost.png cursor-message-lost.png end_of_life.png cursor-end_of_life.png DESTINATION  
 ${DATA_INSTALL_DIR}/umbrello/pics )
 
** branches/work/isi-umbrello/umbrello/umbrello/pics/accept_signal.png #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/pics/accept_signal.png #property svn:mime-type
   + application/octet-stream
** branches/work/isi-umbrello/umbrello/umbrello/pics/accept_time_event.png #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/pics/accept_time_event.png #property svn:mime-type
   + application/octet-stream
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-accept_signal.png #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-accept_signal.png #property svn:mime-type
   + application/octet-stream
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-accept_time_event.png #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-accept_time_event.png #property svn:mime-type
   + application/octet-stream
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-send_signal.png #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-send_signal.png #property svn:mime-type
   + application/octet-stream
** branches/work/isi-umbrello/umbrello/umbrello/pics/send_signal.png #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/pics/send_signal.png #property svn:mime-type
   + application/octet-stream
--- branches/work/isi-umbrello/umbrello/umbrello/toolbarstateother.cpp #631431:631432
@@ -28,6 +28,7 @@
 #include "preconditionwidget.h"
 #include "combinedfragmentwidget.h"
 #include "statewidget.h"
+#include "signalwidget.h"
 #include "uml.h"
 #include "umlview.h"
 #include "umldoc.h"
@@ -131,6 +132,10 @@
             umlWidget = new StateWidget(m_pUMLView, StateWidget::End);
             break;
 
+        case WorkToolBar::tbb_Send_Signal:
+            umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Send);
+            break;
+
 	case WorkToolBar::tbb_Seq_Combined_Fragment:
             umlWidget = new CombinedFragmentWidget(m_pUMLView);
             break;
--- branches/work/isi-umbrello/umbrello/umbrello/umlnamespace.h #631431:631432
@@ -104,9 +104,10 @@
     wt_Artifact,                // has UMLObject representation
     wt_Node,                    // has UMLObject representation
     wt_Association,             // has UMLObject representation
-    wt_ForkJoin,                 // does not have UMLObject representation
+    wt_ForkJoin,                // does not have UMLObject representation
     wt_Precondition,		// does not have UMLObject representation
-    wt_CombinedFragment,	// does not have UMLObject representation 
+    wt_CombinedFragment,	// does not have UMLObject representation
+    wt_Signal,	                // does not have UMLObject representation
     wt_EndOfLife		
 };
 
--- branches/work/isi-umbrello/umbrello/umbrello/umlview.cpp #631431:631432
@@ -84,6 +84,7 @@
 #include "objectwidget.h"
 #include "messagewidget.h"
 #include "statewidget.h"
+#include "signalwidget.h"
 #include "forkjoinwidget.h"
 #include "activitywidget.h"
 #include "seqlinewidget.h"
@@ -1643,6 +1644,32 @@
         }
         break;
 
+   case wt_Signal:
+        {
+            ObjectWidget* pObjectWidget = static_cast<ObjectWidget*>(pWidget);
+            if (pObjectWidget == NULL) {
+                kDebug() << "UMLView::addWidget(): pObjectWidget is NULL" << endl;
+                return false;
+            }
+            Uml::IDType newID = log->findNewID( pWidget -> getID() );
+            if (newID == Uml::id_None) {
+                return false;
+            }
+            pObjectWidget -> setID( newID );
+            Uml::IDType nNewLocalID = getLocalID();
+            Uml::IDType nOldLocalID = pObjectWidget -> getLocalID();
+            m_pIDChangesLog->addIDChange( nOldLocalID, nNewLocalID );
+            pObjectWidget -> setLocalID( nNewLocalID );
+            UMLObject *pObject = m_pDoc -> findObjectById( newID );
+            if( !pObject ) {
+                kDebug() << "addWidget::Can't find UMLObject" << endl;
+                return false;
+            }
+            pWidget -> setUMLObject( pObject );
+            m_WidgetList.append( pWidget );
+        }
+        break;
+
    case wt_CombinedFragment:
         {
             ObjectWidget* pObjectWidget = static_cast<ObjectWidget*>(pWidget);
--- branches/work/isi-umbrello/umbrello/umbrello/worktoolbar.cpp #631431:631432
@@ -145,6 +145,9 @@
         insertHotBtn(tbb_Branch);
         insertHotBtn(tbb_Fork);
         insertHotBtn(tbb_Activity_Transition);
+        insertHotBtn(tbb_Send_Signal);
+        insertHotBtn(tbb_Accept_Signal);
+        insertHotBtn(tbb_Accept_Time_Event);
         break;
 
     case Uml::dt_Component:
@@ -249,7 +252,6 @@
         const char *pngName;
         const char *slotName;
     } buttonInfo[] = {
-    
 
         { tbb_Object, i18n("Object"), "object.png", SLOT(slotObject()) },
         { tbb_Seq_Message_Synchronous, i18n("Synchronous Message"), "message-synchronous.png", SLOT(slotSeq_Message_Synchronous()) },
@@ -277,6 +279,9 @@
         { tbb_Initial_State, i18n("Initial State"), "initial_state.png", SLOT(slotInitial_State()) },
         { tbb_End_State, i18n("End State"), "end_state.png", SLOT(slotEnd_State()) },
         { tbb_Branch, i18n("Branch/Merge"), "branch.png", SLOT(slotBranch()) },
+        { tbb_Send_Signal, i18n("Send signal"), "send_signal.png", SLOT(slotSend_Signal()) },
+        { tbb_Accept_Signal, i18n("Accept signal"), "accept_signal.png", SLOT(slotAccept_Signal()) },
+        { tbb_Accept_Time_Event, i18n("Accept time event"), "accept_time_event.png", SLOT(slotAccept_Time_Event()) },
         { tbb_Fork, i18n("Fork/Join"), "fork.png", SLOT(slotFork()) },
         { tbb_Package, i18n("Package"), "package.png", SLOT(slotPackage()) },
         { tbb_Component, i18n("Component"), "component.png", SLOT(slotComponent()) },
@@ -368,6 +373,9 @@
 void WorkToolBar::slotObject() {buttonChanged(tbb_Object);}
 void WorkToolBar::slotInitial_State() {buttonChanged(tbb_Initial_State);}
 void WorkToolBar::slotState() {buttonChanged(tbb_State);}
+void WorkToolBar::slotSend_Signal() {buttonChanged(tbb_Send_Signal);}
+void WorkToolBar::slotAccept_Signal() {buttonChanged(tbb_Accept_Signal);}
+void WorkToolBar::slotAccept_Time_Event() {buttonChanged(tbb_Accept_Time_Event);}
 void WorkToolBar::slotEnd_State() {buttonChanged(tbb_End_State);}
 void WorkToolBar::slotInitial_Activity() {buttonChanged(tbb_Initial_Activity);}
 void WorkToolBar::slotActivity() {buttonChanged(tbb_Activity);}
--- branches/work/isi-umbrello/umbrello/umbrello/worktoolbar.h #631431:631432
@@ -92,6 +92,9 @@
         tbb_UniAssociation,
         tbb_State_Transition,
         tbb_Activity_Transition,
+        tbb_Send_Signal,
+        tbb_Accept_Signal,
+        tbb_Accept_Time_Event,
         tbb_Anchor,//keep anchor as last association until code uses better algorithm for testing
         tbb_Note,
         tbb_Box,
@@ -233,6 +236,9 @@
     void slotActivity();
     void slotEnd_Activity();
     void slotBranch();
+    void slotSend_Signal();
+    void slotAccept_Signal();
+    void slotAccept_Time_Event();
     void slotFork();
     void slotDeepHistory();
     void slotShallowHistory();




More information about the umbrello-devel mailing list