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

Andi Fischer andi.fischer at hispeed.ch
Sat Apr 7 07:07:48 UTC 2012


SVN commit 1288513 by fischer:

Differences to trunk reduced. Drawing of some states fixed.

 M  +1 -1      folder.cpp  
 M  +4 -4      toolbarstate.cpp  
 M  +4 -4      toolbarstate.h  
 M  +36 -6     widgets/statewidget.cpp  
 M  +1 -1      widgets/statewidget.h  


--- branches/work/soc-umbrello/umbrello/folder.cpp #1288512:1288513
@@ -231,7 +231,7 @@
         // from a view, it also causes any UMLAssociations that lack parent
         // association widgets (but once had them) to remove themselves from
         // this document.
-        uDebug() << "removing " << v->umlScene()->name();  //:TODO:
+        uDebug() << "removing " << v->umlScene()->name();
         UMLApp::app()->document()->removeView(v, false);
     }
 
--- branches/work/soc-umbrello/umbrello/toolbarstate.cpp #1288512:1288513
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -482,7 +482,7 @@
  * @return The MessageWidget at the specified position, or null if there is none.
  * @todo Better handling for messages at the same point
  */
-MessageWidget* ToolBarState::getMessageAt(const QPointF& pos)
+MessageWidget* ToolBarState::getMessageAt(const UMLScenePoint& pos)
 {
     QList<QGraphicsItem*> collisions = m_pUMLScene->items(pos);
 
@@ -504,7 +504,7 @@
  * @return The AssociationWidget at the specified position, or null if there is none.
  * @todo Better handling for associations at the same point
  */
-AssociationWidget* ToolBarState::getAssociationAt(const QPointF& pos)
+AssociationWidget* ToolBarState::getAssociationAt(const UMLScenePoint& pos)
 {
     QList<QGraphicsItem*> collisions = m_pUMLScene->items(pos);
 
@@ -525,7 +525,7 @@
  * @param pos The position to get the floatingLine.
  * @return The MessageWidget at the specified position, or null if there is none.
  */
-FloatingDashLineWidget* ToolBarState::getFloatingLineAt(const QPointF& pos)
+FloatingDashLineWidget* ToolBarState::getFloatingLineAt(const UMLScenePoint& pos)
 {
     QList<QGraphicsItem*> collisions = m_pUMLScene->items(pos);
 
--- branches/work/soc-umbrello/umbrello/toolbarstate.h #1288512:1288513
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2004-2009                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -117,9 +117,9 @@
 
     void setMouseEvent(UMLSceneMouseEvent* ome, const QEvent::Type &type);
 
-    AssociationWidget* getAssociationAt(const QPointF& pos);
-    MessageWidget* getMessageAt(const QPointF& pos);
-    FloatingDashLineWidget* getFloatingLineAt(const QPointF& pos);
+    AssociationWidget* getAssociationAt(const UMLScenePoint& pos);
+    MessageWidget* getMessageAt(const UMLScenePoint& pos);
+    FloatingDashLineWidget* getFloatingLineAt(const UMLScenePoint& pos);
 
     UMLScene* m_pUMLScene;  ///< The UMLScene.
 
--- branches/work/soc-umbrello/umbrello/widgets/statewidget.cpp #1288512:1288513
@@ -38,10 +38,10 @@
  * @param id The ID to assign (-1 will prompt a new ID.)
  */
 StateWidget::StateWidget(StateType stateType, Uml::IDType id)
-  : UMLWidget(WidgetBase::wt_State, id)
+  : UMLWidget(WidgetBase::wt_State, id),
+    m_stateType(stateType),
+    m_drawVertical(true)
 {
-    m_stateType = stateType;
-    m_drawVertical = true;
     createTextItemGroup();
 
     const qreal radius = 18.0;
@@ -110,7 +110,7 @@
         }
         break;
     default:
-        uWarning() << "Unknown state type:" << QLatin1String(ENUM_NAME(StateWidget, StateType, m_stateType));
+        uWarning() << "Unknown state type:" << stateTypeStr();
         break;
     }
 
@@ -197,7 +197,7 @@
         }
         break;
     default:
-        uWarning() << "Unknown state type:" << QLatin1String(ENUM_NAME(StateWidget, StateType, m_stateType));
+        uWarning() << "Unknown state type: " << stateTypeStr();
         break;
     }
 }
@@ -341,7 +341,7 @@
 void StateWidget::setDrawVertical(bool to)
 {
     m_drawVertical = to;
-    UMLWidget::updateGeometry();
+    updateGeometry();
 }
 
 /**
@@ -426,6 +426,8 @@
  */
 void StateWidget::updateGeometry()
 {
+    const qreal radius = 18.0;
+
     switch (m_stateType) {
     case StateWidget::Fork:
     case StateWidget::Join:
@@ -438,6 +440,34 @@
             setMaximumSize(QSizeF(100, 10));
         }
         break;
+    case StateWidget::Initial:
+        {
+            const QSizeF sz = QSizeF(radius, radius);
+            setMinimumSize(sz);
+            setMaximumSize(sz);
+        }
+        break;
+    case StateWidget::End:
+        {
+            const QSizeF sz = QSizeF(radius, radius);
+            setMinimumSize(sz);
+            setMaximumSize(sz);
+        }
+        break;
+    case StateWidget::DeepHistory:
+        {
+            const QSizeF sz = QSizeF(radius, radius);
+            setMinimumSize(sz);
+            setMaximumSize(sz);
+        }
+        break;
+    case StateWidget::ShallowHistory:
+        {
+            const QSizeF sz = QSizeF(radius, radius);
+            setMinimumSize(sz);
+            setMaximumSize(sz);
+        }
+        break;
     case StateWidget::Normal:
         {
             TextItemGroup *grp = textItemGroupAt(GroupIndex);
--- branches/work/soc-umbrello/umbrello/widgets/statewidget.h #1288512:1288513
@@ -84,7 +84,7 @@
 private:
     static const QSizeF MinimumEllipseSize;
 
-    StateType m_stateType;    ///< Type of state.
+    StateType m_stateType;    ///< type of state
     bool      m_drawVertical; ///< whether to draw the fork/join horizontally or vertically
 
     enum {




More information about the umbrello-devel mailing list