Changeset View
Changeset View
Standalone View
Standalone View
umbrello/umlwidgets/objectnodewidget.cpp
Context not available. | |||||
7 | * copyright (C) 2002-2014 * | 7 | * copyright (C) 2002-2014 * | ||
---|---|---|---|---|---|
8 | * Umbrello UML Modeller Authors <umbrello-devel@kde.org> * | 8 | * Umbrello UML Modeller Authors <umbrello-devel@kde.org> * | ||
9 | ***************************************************************************/ | 9 | ***************************************************************************/ | ||
10 | 10 | #include <iostream> | |||
11 | // own header | 11 | // own header | ||
12 | #include "objectnodewidget.h" | 12 | #include "objectnodewidget.h" | ||
13 | 13 | | |||
Context not available. | |||||
178 | */ | 178 | */ | ||
179 | ObjectNodeWidget::ObjectNodeType ObjectNodeWidget::toObjectNodeType(const QString& type) | 179 | ObjectNodeWidget::ObjectNodeType ObjectNodeWidget::toObjectNodeType(const QString& type) | ||
180 | { | 180 | { | ||
181 | if (type == QLatin1String("Central buffer")) | 181 | if (type == QLatin1String("Central Buffer")) | ||
182 | return ObjectNodeWidget::Buffer; | 182 | return ObjectNodeWidget::Buffer; | ||
183 | if (type == QLatin1String("Data store")) | 183 | if (type == QLatin1String("Data Store")) | ||
184 | return ObjectNodeWidget::Data; | 184 | return ObjectNodeWidget::Data; | ||
185 | if (type == QLatin1String("Object Flow")) | 185 | if (type == QLatin1String("Object Flow")) | ||
186 | return ObjectNodeWidget::Flow; | 186 | return ObjectNodeWidget::Flow; | ||
Context not available. | |||||
196 | { | 196 | { | ||
197 | m_objectNodeType = objectNodeType; | 197 | m_objectNodeType = objectNodeType; | ||
198 | UMLWidget::m_resizable = true; | 198 | UMLWidget::m_resizable = true; | ||
199 | | ||||
200 | switch (m_objectNodeType) { | ||||
201 | case ObjectNodeWidget::Normal : | ||||
202 | setToolTip(QLatin1String("<b>Object Node<b>" | ||||
203 | "<p>A node is a run-time physical object that " | ||||
204 | "represents a computational resource, which " | ||||
205 | "generally has at least a memory and often " | ||||
206 | "processing capability. Run-time objects and " | ||||
207 | "run-time component instances may reside on nodes.</p>")); | ||||
208 | break; | ||||
209 | case ObjectNodeType::Buffer : | ||||
210 | setToolTip(QLatin1String("<b>Buffer Object Node<b>" | ||||
211 | "<p></p>")); | ||||
212 | break; | ||||
213 | case ObjectNodeWidget::Data : | ||||
214 | setToolTip(QLatin1String("<b>Data Object Node<b>" | ||||
215 | "<p></p>")); | ||||
216 | break; | ||||
217 | case Flow: | ||||
218 | setToolTip(QLatin1String("<b>Flow Object Node<b>" | ||||
219 | "<p>A variety of control flow that represents " | ||||
220 | "the relationship between an object and the " | ||||
221 | "object, operation, or transition that creates" | ||||
222 | "it (as an output) or uses it (as an input).</p>")); | ||||
223 | break; | ||||
224 | default : | ||||
225 | break; | ||||
226 | } | ||||
199 | } | 227 | } | ||
200 | 228 | | |||
201 | /** | 229 | /** | ||
Context not available. | |||||
306 | bool pressedOK = false; | 334 | bool pressedOK = false; | ||
307 | int current = 0; | 335 | int current = 0; | ||
308 | const QStringList list = QStringList() | 336 | const QStringList list = QStringList() | ||
309 | << QLatin1String("Central buffer") | 337 | << QLatin1String("Central Buffer") | ||
310 | << QLatin1String("Data store") | 338 | << QLatin1String("Data Store") | ||
311 | << QLatin1String("Object Flow"); | 339 | << QLatin1String("Object Flow"); | ||
312 | 340 | | |||
313 | #if QT_VERSION >= 0x050000 | 341 | #if QT_VERSION >= 0x050000 | ||
Context not available. | |||||
321 | 349 | | |||
322 | if (pressedOK) { | 350 | if (pressedOK) { | ||
323 | targetWidget->asObjectNodeWidget()->setObjectNodeType(type); | 351 | targetWidget->asObjectNodeWidget()->setObjectNodeType(type); | ||
324 | if (type == QLatin1String("Data store")) | 352 | if (type == QLatin1String("Data Store")) | ||
325 | Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the data store node"), i18n("Enter the name of the data store node"), i18n("data store name")); | 353 | Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the data store node"), i18n("Enter the name of the data store node"), i18n("data store name")); | ||
326 | if (type == QLatin1String("Central buffer")) | 354 | if (type == QLatin1String("Central Buffer")) | ||
327 | Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the buffer node"), i18n("Enter the name of the buffer"), i18n("centralBuffer")); | 355 | Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the buffer node"), i18n("Enter the name of the buffer"), i18n("centralBuffer")); | ||
328 | if (type == QLatin1String("Object Flow")) { | 356 | if (type == QLatin1String("Object Flow")) { | ||
329 | Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the object flow"), i18n("Enter the name of the object flow"), i18n("object flow")); | 357 | Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the object flow"), i18n("Enter the name of the object flow"), i18n("object flow")); | ||
Context not available. |