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

Andi Fischer andi.fischer at hispeed.ch
Thu Oct 16 11:27:44 UTC 2008


SVN commit 872122 by fischer:

Add the possibility to draw the pseudostates Deep History and Shallow History to state diagrams.

 M  +3 -1      listpopupmenu.cpp  
 M  +2 -0      listpopupmenu.h  
 M  +23 -0     statewidget.cpp  
 M  +3 -1      statewidget.h  
 M  +8 -0      toolbarstateother.cpp  
 M  +4 -4      worktoolbar.cpp  


--- branches/work/soc-umbrello/umbrello/listpopupmenu.cpp #872121:872122
@@ -1111,7 +1111,9 @@
             insert(mt_Initial_State, menu, Icon_Utils::SmallIcon(Icon_Utils::it_InitialState), i18n("Initial State"));
             insert(mt_End_State, menu, Icon_Utils::SmallIcon(Icon_Utils::it_EndState), i18n("End State"));
             insert(mt_State, menu, Icon_Utils::SmallIcon(Icon_Utils::it_UseCase), i18nc("add new state", "State..."));
-            insert(mt_Junction, menu, Icon_Utils::SmallIcon(Icon_Utils::it_Junction), i18nc("Junction", "Junction..."));
+            insert(mt_Junction, menu, Icon_Utils::SmallIcon(Icon_Utils::it_Junction), i18nc("Junction", "Junction"));
+            insert(mt_DeepHistory, menu, Icon_Utils::SmallIcon(Icon_Utils::it_History_Deep), i18nc("Deep History", "Deep History"));
+            insert(mt_ShallowHistory, menu, Icon_Utils::SmallIcon(Icon_Utils::it_History_Shallow), i18nc("Shallow History", "Shallow History"));
             insert(mt_FloatText, menu);
             break;
         case mt_On_Activity_Diagram:
--- branches/work/soc-umbrello/umbrello/listpopupmenu.h #872121:872122
@@ -98,6 +98,8 @@
         mt_End_State,
         mt_State,
         mt_Junction,
+        mt_DeepHistory,
+        mt_ShallowHistory,
         mt_Activity,
         mt_Initial_Activity,
         mt_End_Activity,
--- branches/work/soc-umbrello/umbrello/statewidget.cpp #872121:872122
@@ -98,6 +98,29 @@
             painter->drawEllipse(rect());
         }
         break;
+    case StateWidget::DeepHistory:
+        {
+            const QSizeF sz = QSizeF(18, 18);
+            setMinimumSize(sz);
+            setSize(sz);
+            painter->setBrush(Qt::white);
+            painter->drawEllipse(rect());
+            painter->setPen(Qt::black);
+            painter->drawText(3, 13, "H");
+            painter->drawText(11, 12, "*");
+        }
+        break;
+    case StateWidget::ShallowHistory:
+        {
+            const QSizeF sz = QSizeF(18, 18);
+            setMinimumSize(sz);
+            setSize(sz);
+            painter->setBrush(Qt::white);
+            painter->drawEllipse(rect());
+            painter->setPen(Qt::black);
+            painter->drawText(5, 13, "H");
+        }
+        break;
     default:
         uWarning() << "Unknown state type:" << QLatin1String(ENUM_NAME(StateWidget, StateType, m_stateType));
         break;
--- branches/work/soc-umbrello/umbrello/statewidget.h #872121:872122
@@ -35,7 +35,9 @@
         Initial = 0,
         Normal,
         End,
-        Junction
+        Junction,        // Pseudostate
+        DeepHistory,     // Pseudostate
+        ShallowHistory   // Pseudostate
     };
 
     explicit StateWidget(StateType stateType = Normal, Uml::IDType id = Uml::id_None );
--- branches/work/soc-umbrello/umbrello/toolbarstateother.cpp #872121:872122
@@ -182,6 +182,14 @@
             umlWidget = new StateWidget(StateWidget::Junction);
             break;
 
+        case WorkToolBar::tbb_DeepHistory:
+            umlWidget = new StateWidget(StateWidget::DeepHistory);
+            break;
+
+        case WorkToolBar::tbb_ShallowHistory:
+            umlWidget = new StateWidget(StateWidget::ShallowHistory);
+            break;
+
         case WorkToolBar::tbb_Send_Signal:
             umlWidget = new SignalWidget(SignalWidget::Send);
             break;
--- branches/work/soc-umbrello/umbrello/worktoolbar.cpp #872121:872122
@@ -136,8 +136,8 @@
         insertHotBtn(tbb_State);
         insertHotBtn(tbb_End_State);
         insertHotBtn(tbb_State_Transition);
-        //insertHotBtn(tbb_DeepHistory);        //NotYetImplemented
-        //insertHotBtn(tbb_ShallowHistory);     //NotYetImplemented
+        insertHotBtn(tbb_DeepHistory);
+        insertHotBtn(tbb_ShallowHistory);
         //insertHotBtn(tbb_Join);               //NotYetImplemented
         insertHotBtn(tbb_StateFork);
         insertHotBtn(tbb_Junction);
@@ -326,8 +326,8 @@
         { tbb_Datatype,                 i18n("Datatype"),                Icon_Utils::it_Datatype,                SLOT(slotDatatype()) },
         { tbb_Enum,                     i18n("Enum"),                    Icon_Utils::it_Enum,                    SLOT(slotEnum()) },
         { tbb_Entity,                   i18n("Entity"),                  Icon_Utils::it_Entity,                  SLOT(slotEntity()) },
-        { tbb_DeepHistory,              i18n("Deep History"),            Icon_Utils::it_History_Deep,            SLOT(slotDeepHistory()) },     //NotYetImplemented
-        { tbb_ShallowHistory,           i18n("Shallow History"),         Icon_Utils::it_History_Shallow,         SLOT(slotShallowHistory()) },  //NotYetImplemented
+        { tbb_DeepHistory,              i18n("Deep History"),            Icon_Utils::it_History_Deep,            SLOT(slotDeepHistory()) },
+        { tbb_ShallowHistory,           i18n("Shallow History"),         Icon_Utils::it_History_Shallow,         SLOT(slotShallowHistory()) },
         { tbb_Join,                     i18nc("join states", "Join"),    Icon_Utils::it_Join,                    SLOT(slotJoin()) },            //NotYetImplemented
         { tbb_StateFork,                i18n("Fork"),                    Icon_Utils::it_Fork_State,              SLOT(slotStateFork()) },
         { tbb_Junction,                 i18n("Junction"),                Icon_Utils::it_Junction,                SLOT(slotJunction()) },




More information about the umbrello-devel mailing list