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

Ralf Habacker ralf.habacker at gmail.com
Wed Dec 14 20:20:09 UTC 2011


SVN commit 1268757 by habacker:

merged partially from trunk to reduce differences

 M  +15 -15    listpopupmenu.cpp  
 M  +27 -14    widgets/activitywidget.cpp  
 M  +1 -7      widgets/activitywidget.h  
 M  +11 -9     widgets/enumwidget.cpp  
 M  +2 -1      widgets/enumwidget.h  


--- branches/work/soc-umbrello/umbrello/listpopupmenu.cpp #1268756:1268757
@@ -12,27 +12,27 @@
 #include "listpopupmenu.h"
 
 // app includes
+#include "activitywidget.h"
+#include "category.h"
+#include "classifier.h"
+#include "classifierwidget.h"
+#include "combinedfragmentwidget.h"
 #include "debug_utils.h"
-#include "widgetbase.h"
-#include "umldoc.h"
-#include "classifierwidget.h"
-#include "classifier.h"
 #include "floatingtextwidget.h"
-#include "uml.h"
+#include "folder.h"
+#include "forkjoinwidget.h"
 #include "model_utils.h"
-#include "widget_utils.h"
-#include "folder.h"
-#include "umlview.h"
-#include "statewidget.h"
-#include "signalwidget.h"
-#include "activitywidget.h"
-#include "preconditionwidget.h"
-#include "combinedfragmentwidget.h"
 #include "objectnodewidget.h"
-#include "forkjoinwidget.h"
 #include "objectwidget.h"
-#include "category.h"
+#include "preconditionwidget.h"
+#include "signalwidget.h"
+#include "statewidget.h"
+#include "uml.h"
+#include "umldoc.h"
 #include "umlscene.h"
+#include "umlview.h"
+#include "widget_utils.h"
+#include "widgetbase.h"
 
 // kde includes
 #include <klocale.h>
--- branches/work/soc-umbrello/umbrello/widgets/activitywidget.cpp #1268756:1268757
@@ -1,4 +1,5 @@
 /***************************************************************************
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -29,11 +30,6 @@
 #include <klocale.h>
 #include <kinputdialog.h>
 
-// qt includes
-#include <QtGui/QPainter>
-#include <QtGui/QPolygonF>
-
-
 /**
  * Creates a Activity widget.
  *
@@ -49,26 +45,34 @@
     createTextItemGroup();
 }
 
-/// Destructor
+/**
+ *  destructor
+ */
 ActivityWidget::~ActivityWidget()
 {
 }
 
-/// Sets the type of activity
+/**
+ * Sets the type of activity.
+ */
 void ActivityWidget::setActivityType( ActivityType activityType )
 {
     m_activityType = activityType;
     updateTextItemGroups();
 }
 
-/// Sets the precondition text for this widget
+/**
+ * This method set the name of the preText attribute
+ */
 void ActivityWidget::setPreconditionText(const QString& aPreText)
 {
     m_preconditionText = aPreText;
     updateTextItemGroups();
 }
 
-/// Sets the post condition text for this widget.
+ /**
+ * This method set the name of the postText attribute
+ */
 void ActivityWidget::setPostconditionText(const QString& aPostText)
 {
     m_postconditionText = aPostText;
@@ -76,7 +80,7 @@
 }
 
 /**
- * Reimplemented fron UMLWidget::showPropertiesDialog to show a
+ * Reimplemented from UMLWidget::showPropertiesDialog to show a
  * properties dialog for an ActivityWidget.
  */
 void ActivityWidget::showPropertiesDialog()
@@ -92,6 +96,9 @@
     delete dialog;
 }
 
+/**
+ * Overrides the standard paint event.
+ */
 void ActivityWidget::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
 {
     QRectF r = rect();
@@ -102,7 +109,8 @@
     p->setPen(QPen(lineColor(), lineWidth()));
     p->setBrush(brush());
 
-    switch(m_activityType) {
+    switch(m_activityType) 
+    {
     case Normal:
         p->drawRoundRect(r, (h * 60) / w, 60);
         break;
@@ -160,8 +168,11 @@
     }
 }
 
-/// Loads the widget from the "activitywidget" XMI element.
-bool ActivityWidget::loadFromXMI( QDomElement & qElement ) {
+/**
+ * Loads the widget from the "activitywidget" XMI element.
+ */
+bool ActivityWidget::loadFromXMI( QDomElement & qElement ) 
+{
     if( !UMLWidget::loadFromXMI( qElement ) )
         return false;
     setName(qElement.attribute( "activityname", "" ));
@@ -175,7 +186,9 @@
     return true;
 }
 
-/// Saves the widget to the "activitywidget" XMI element.
+/**
+ * Saves the widget to the "activitywidget" XMI element.
+ */
 void ActivityWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement )
 {
     QDomElement activityElement = qDoc.createElement( "activitywidget" );
--- branches/work/soc-umbrello/umbrello/widgets/activitywidget.h #1268756:1268757
@@ -15,8 +15,6 @@
 #include "umlwidget.h"
 
 /**
- * @class ActivityWidget
- *
  * This class is the graphical version of a UML Activity.  A ActivityWidget is created
  * by a @ref UMLView.  An ActivityWidget belongs to only one @ref UMLView instance.
  * When the @ref UMLView instance that this class belongs to, it will be automatically deleted.
@@ -85,12 +83,8 @@
     QVariant attributeChange(WidgetAttributeChange change, const QVariant& oldValue);
     void updateTextItemGroups();
 
-    /**
-     * Type of activity.
-     */
-    ActivityType m_activityType;
+    ActivityType m_activityType; ///< Type of activity.
 
-
     /**
      * Type of normal activity (Invok or not).
      * This function is call by the dialog box properties
--- branches/work/soc-umbrello/umbrello/widgets/enumwidget.cpp #1268756:1268757
@@ -28,10 +28,6 @@
 #include "umlscene.h"
 #include "widget_utils.h"
 
-// qt/kde includes
-#include <QtGui/QPainter>
-#include <QtGui/QStyleOptionGraphicsItem>
-
 /**
  * Constructs an instance of EnumWidget.
  * @param o The NewUMLObject this will be representing.
@@ -54,16 +50,17 @@
 /**
  * Set whether to show package or not.
  *
- * @param b True to show package, false to hide.
+ * @param _status             True if package shall be shown.
  */
-void EnumWidget::setShowPackage(bool b)
+void EnumWidget::setShowPackage(bool _status)
 {
-    m_showPackage = b;
+    m_showPackage = _status;
     updateTextItemGroups();
 }
 
 /**
- * Reimplemented from UMLWidget::paint to draw enum widget.
+ * Draws the enum as a rectangle with a box underneith with a list of literals
+ * Reimplemented from UMLWidget::paint
  */
 void EnumWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
 {
@@ -100,6 +97,12 @@
     qElement.appendChild(conceptElement);
 }
 
+/**
+ * Will be called when a menu selection has been made from the
+ * popup menu.
+ *
+ * @param action       The action that has been selected.
+ */
 void EnumWidget::slotMenuSelection(QAction *action)
 {
     ListPopupMenu *menu = ListPopupMenu::menuFromAction(action);
@@ -116,7 +119,6 @@
         }
         return;
     }
-
     UMLWidget::slotMenuSelection(action);
 }
 
--- branches/work/soc-umbrello/umbrello/widgets/enumwidget.h #1268756:1268757
@@ -62,6 +62,8 @@
     virtual void updateTextItemGroups();
     virtual QVariant attributeChange(WidgetAttributeChange change, const QVariant& oldVal);
 
+    bool m_showPackage;
+
 private:
     enum {
         GroupIndex = 0
@@ -72,7 +74,6 @@
         EnumLiteralStartIndex
     };
 
-    bool m_showPackage;
     QLineF m_nameLine;
 };
 




More information about the umbrello-devel mailing list