~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to umbrello/umbrello/toolbarstateother.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "activitywidget.h"
22
22
#include "boxwidget.h"
23
23
#include "dialog_utils.h"
 
24
#include "regionwidget.h"
24
25
#include "floatingtextwidget.h"
25
26
#include "forkjoinwidget.h"
26
27
#include "notewidget.h"
27
28
#include "object_factory.h"
 
29
#include "preconditionwidget.h"
 
30
#include "combinedfragmentwidget.h"
28
31
#include "statewidget.h"
 
32
#include "signalwidget.h"
29
33
#include "uml.h"
30
34
#include "umlview.h"
31
35
#include "umldoc.h"
 
36
#include "objectwidget.h"
 
37
#include "objectnodewidget.h"
 
38
#include "pinwidget.h"
 
39
 
32
40
 
33
41
using namespace Uml;
34
42
 
70
78
        case WorkToolBar::tbb_Enum:         ot = ot_Enum;           break;
71
79
        case WorkToolBar::tbb_Entity:       ot = ot_Entity;         break;
72
80
        case WorkToolBar::tbb_Datatype:     ot = ot_Datatype;       break;
 
81
        case WorkToolBar::tbb_Category:     ot = ot_Category;       break;
73
82
 
74
83
        default:                            ot = ot_UMLObject;      break;
75
84
    }
83
92
 
84
93
    switch (getButton()) {
85
94
        case WorkToolBar::tbb_Note:
86
 
            umlWidget = new NoteWidget(m_pUMLView);
 
95
            umlWidget = new NoteWidget(m_pUMLView, NoteWidget::Normal);
87
96
            break;
88
97
 
89
98
        case WorkToolBar::tbb_Box:
107
116
            umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::End);
108
117
            break;
109
118
 
 
119
        case WorkToolBar::tbb_Final_Activity:
 
120
            umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::Final);
 
121
            break;
 
122
 
110
123
        case WorkToolBar::tbb_Branch:
111
124
            umlWidget = new ActivityWidget(m_pUMLView, ActivityWidget::Branch);
112
125
            break;
128
141
            umlWidget = new StateWidget(m_pUMLView, StateWidget::End);
129
142
            break;
130
143
 
 
144
        case WorkToolBar::tbb_Send_Signal:
 
145
            umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Send);
 
146
            break;
 
147
 
 
148
        case WorkToolBar::tbb_Accept_Signal:
 
149
            umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Accept);
 
150
            break;
 
151
 
 
152
        case WorkToolBar::tbb_Accept_Time_Event:
 
153
            umlWidget = new SignalWidget(m_pUMLView, SignalWidget::Time);
 
154
            break;
 
155
 
 
156
        case WorkToolBar::tbb_Region:
 
157
            umlWidget = new RegionWidget(m_pUMLView);
 
158
            break;
 
159
 
 
160
        case WorkToolBar::tbb_Seq_Combined_Fragment:
 
161
            umlWidget = new CombinedFragmentWidget(m_pUMLView);
 
162
            break;
 
163
 
 
164
        case WorkToolBar::tbb_Object_Node:
 
165
            umlWidget = new ObjectNodeWidget(m_pUMLView, ObjectNodeWidget::Data);
 
166
            break;
 
167
 
 
168
        case WorkToolBar::tbb_PrePostCondition:
 
169
            umlWidget = new NoteWidget(m_pUMLView, NoteWidget::Normal);
 
170
            break;
 
171
 
131
172
        default:
132
173
            break;
133
174
    }
142
183
        Dialog_Utils::askNameForWidget(
143
184
            umlWidget, i18n("Enter Activity Name"),
144
185
            i18n("Enter the name of the new activity:"), i18n("new activity"));
 
186
    } else if (getButton() == WorkToolBar::tbb_Accept_Signal
 
187
            || getButton() == WorkToolBar::tbb_Send_Signal) {
 
188
        Dialog_Utils::askNameForWidget(
 
189
            umlWidget, i18n("Enter Signal Name"),
 
190
            i18n("Enter Signal"), i18n("new Signal"));
 
191
    } else if (getButton() == WorkToolBar::tbb_Accept_Time_Event) {
 
192
        Dialog_Utils::askNameForWidget(
 
193
            umlWidget, i18n("Enter Time Event Name"),
 
194
            i18n("Enter Time Event"), i18n("new time event"));
 
195
    } else if (getButton() == WorkToolBar::tbb_Seq_Combined_Fragment) {
 
196
        dynamic_cast<CombinedFragmentWidget*>(umlWidget)->askNameForWidgetType(
 
197
            umlWidget, i18n("Enter Combined Fragment Name"),
 
198
            i18n("Enter the Combined Fragment"), i18n("new Combined Fragment"));
145
199
    } else if (getButton() == WorkToolBar::tbb_State) {
146
200
        Dialog_Utils::askNameForWidget(
147
201
            umlWidget, i18n("Enter State Name"),
150
204
        // It is pretty invisible otherwise.
151
205
        FloatingTextWidget* ft = (FloatingTextWidget*) umlWidget;
152
206
        ft->changeTextDlg();
 
207
    } else if (getButton() == WorkToolBar::tbb_Object_Node) {
 
208
         dynamic_cast<ObjectNodeWidget*>(umlWidget)->askForObjectNodeType(umlWidget);
 
209
    } else if (getButton() == WorkToolBar::tbb_PrePostCondition) {
 
210
         dynamic_cast<NoteWidget*>(umlWidget)->askForNoteType(umlWidget);
153
211
    }
154
212
 
155
213
    // Create the widget. Some setup functions can remove the widget.