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

Florence Mattler florence.mattler at libertysurf.fr
Mon Feb 5 19:04:22 UTC 2007


SVN commit 630571 by mattler:

Add a widget to notify the death of an object in sequence diagram. It can be loaded and saved.
The end of the object line depends on the site of the EndOfLife Widget.


 M  +1 -0      CMakeLists.txt  
 A             endoflifewidget.cpp   [License: GPL (v2+)]
 A             endoflifewidget.h   [License: GPL (v2+)]
 M  +4 -0      objectwidget.cpp  
 M  +7 -0      objectwidget.h  
 M  +3 -6      preconditionwidget.h  
 M  +14 -12    toolbarstatesequence.cpp  
 M  +1 -1      umlnamespace.h  
 M  +4 -1      widget_factory.cpp  


--- branches/work/isi-umbrello/umbrello/umbrello/CMakeLists.txt #630570:630571
@@ -271,6 +271,7 @@
    datatypewidget.cpp 
    dialog_utils.cpp 
    docwindow.cpp 
+   endoflifewidget.cpp   
    entity.cpp 
    entityattribute.cpp 
    entitywidget.cpp 
--- branches/work/isi-umbrello/umbrello/umbrello/objectwidget.cpp #630570:630571
@@ -307,6 +307,10 @@
         m_pLine -> setupDestructionBox();
 }
 
+void ObjectWidget::setEndLine(int yPosition) {
+	m_pLine->setEndOfLine(yPosition);
+}
+
 int ObjectWidget::getEndLineY() {
     int y = this -> getY() + getHeight();
     if( m_pLine)
--- branches/work/isi-umbrello/umbrello/umbrello/objectwidget.h #630570:630571
@@ -187,6 +187,13 @@
     int topMargin();
 
     /**
+     * Sets the y position of the bottom of the vertical line.
+     *
+     * @param yPosition The y coordinate for the bottom of the line.
+     */
+    void setEndLine(int yPosition);
+
+    /**
      * Returns the end Y co-ord of the seq. line.
      *
      * @return  Y coordinate of the endpoint of the sequence line.
--- branches/work/isi-umbrello/umbrello/umbrello/preconditionwidget.h #630570:630571
@@ -71,16 +71,13 @@
     void calculateWidget();
 
     /**
-     * Activates a MessageWidget.  Connects its m_pOw[] pointers
-     * to UMLObjects and also send signals about its FloatingTextWidget.
+     * Activates a PreconditionWidget.  Connects it m_pOw[] pointer
+     * to UMLObject
      */
     void activate(IDChangeLog * Log = 0);
 
     /**
-     * Calculates the size of the widget by calling
-     * calculateDimenstionsSynchronous(),
-     * calculateDimenstionsAsynchronous(), or
-     * calculateDimensionsCreation()
+     * Calculates the size of the widget
      */
      void calculateDimensions();
 
--- branches/work/isi-umbrello/umbrello/umbrello/toolbarstatesequence.cpp #630570:630571
@@ -18,6 +18,7 @@
 // local includes
 #include "floatingtextwidget.h"
 #include "preconditionwidget.h"
+#include "endoflifewidget.h"
 #include "messagewidget.h"
 #include "objectwidget.h"
 #include "uml.h"
@@ -90,26 +91,27 @@
 void ToolBarStateSequence::setWidget(ObjectWidget* firstObject) {
     m_firstObject = firstObject;
 
+    UMLWidget * umlwidget = NULL;
     //m_pUMLView->viewport()->setMouseTracking(true);
     if (getWidgetType() == Uml::wt_Precondition) {
-   	 UMLWidget * precondition = new PreconditionWidget(m_pUMLView, m_firstObject);
+   	umlwidget = new PreconditionWidget(m_pUMLView, m_firstObject);
 
-	Dialog_Utils::askNameForWidget(precondition, i18n("Enter Precondition Name"), i18n("Enter the precondition"), i18n("new precondition"));
+	Dialog_Utils::askNameForWidget(umlwidget, i18n("Enter Precondition Name"), i18n("Enter the precondition"), i18n("new precondition"));
     	    // Create the widget. Some setup functions can remove the widget.
-    	if (precondition != NULL) {
-            m_pUMLView->setupNewWidget(precondition);
-    	}
+    	
     }
 
-    if (getWidgetType() == Uml::wt_End_Of_Life) {
-   	 UMLWidget * precondition = new PreconditionWidget(m_pUMLView, m_firstObject);
+    if (getWidgetType() == Uml::wt_EndOfLife) {
+   	umlwidget = new EndOfLifeWidget(m_pUMLView, m_firstObject);
 
-	Dialog_Utils::askNameForWidget(precondition, i18n("Enter Precondition Name"), i18n("Enter the precondition"), i18n("new precondition"));
+	//Dialog_Utils::askNameForWidget(umlwidget, i18n("Enter Precondition Name"), i18n("Enter the precondition"), i18n("new precondition"));
     	    // Create the widget. Some setup functions can remove the widget.
-    	if (precondition != NULL) {
-            m_pUMLView->setupNewWidget(precondition);
-    	}
+    	
     }
+
+    if (umlwidget != NULL) {
+            m_pUMLView->setupNewWidget(umlwidget);
+    }
 }
 
 
@@ -118,7 +120,7 @@
         return Uml::wt_Precondition;
     }
     if (getButton() == WorkToolBar::tbb_Seq_End_Of_Life) {
-        return Uml::wt_End_Of_Life;
+        return Uml::wt_EndOfLife;
     }
 }
 
--- branches/work/isi-umbrello/umbrello/umbrello/umlnamespace.h #630570:630571
@@ -107,7 +107,7 @@
     wt_ForkJoin,                 // does not have UMLObject representation
     wt_Precondition,		// does not have UMLObject representation
     wt_CombinedFragment,	// does not have UMLObject representation 
-    wt_End_Of_Life		
+    wt_EndOfLife		
 };
 
 enum Diagram_Type
--- branches/work/isi-umbrello/umbrello/umbrello/widget_factory.cpp #630570:630571
@@ -52,6 +52,7 @@
 #include "combinedfragmentwidget.h"
 #include "seqlinewidget.h"
 #include "preconditionwidget.h"
+#include "endoflifewidget.h"
 #include "cmds.h"
 
 
@@ -161,7 +162,7 @@
                              const QString& idStr, UMLView *view) {
     UMLWidget *widget = NULL;
     if (tag == "statewidget" || tag == "notewidget" || tag == "boxwidget" ||
-        tag == "floatingtext" || tag == "activitywidget" || tag == "forkjoin" || tag == "preconditionwidget" ||
+        tag == "floatingtext" || tag == "activitywidget" || tag == "forkjoin" || tag == "preconditionwidget" || tag == "endoflifewidget" ||
         tag == "combinedFragmentwidget"  ||
             // tests for backward compatibility:
             tag == "UML:StateWidget" || tag == "UML:NoteWidget" ||
@@ -188,6 +189,8 @@
             widget = new ForkJoinWidget(view, false, Uml::id_Reserved);
         } else if (tag == "preconditionwidget") {
             widget = new PreconditionWidget(view, NULL, Uml::id_Reserved);
+	} else if (tag == "endoflifewidget") {
+            widget = new EndOfLifeWidget(view, NULL, Uml::id_Reserved);
 	} else if (tag == "combinedFragmentwidget") {
             widget = new CombinedFragmentWidget(view, CombinedFragmentWidget::Ref, Uml::id_Reserved);
 	}




More information about the umbrello-devel mailing list