• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
umllistviewitem.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2002-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 // own header
12 #include "umllistviewitem.h"
13 
14 // app includes
15 #include "debug_utils.h"
16 #include "folder.h"
17 #include "classifier.h"
18 #include "entity.h"
19 #include "template.h"
20 #include "attribute.h"
21 #include "operation.h"
22 #include "entityconstraint.h"
23 #include "umldoc.h"
24 #include "umllistview.h"
25 #include "umlobjectlist.h"
26 #include "umlscene.h"
27 #include "umlview.h"
28 #include "model_utils.h"
29 #include "uniqueid.h"
30 #include "uml.h"
31 #include "cmds.h"
32 
33 // kde includes
34 #include <klocale.h>
35 #include <kmessagebox.h>
36 
37 // qt includes
38 #include <QDrag>
39 #include <QFile>
40 #include <QRegExp>
41 #include <QTextStream>
42 
43 // system includes
44 #include <cstdlib>
45 
46 #define DBG_LVI "UMLListViewItem"
47 
48 DEBUG_REGISTER(UMLListViewItem)
49 
50 
58 UMLListViewItem::UMLListViewItem(UMLListView * parent, const QString &name,
59  ListViewType t, UMLObject* o)
60  : QTreeWidgetItem(parent)
61 {
62  init();
63  if (parent == 0) {
64  DEBUG(DBG_LVI) << "UMLListViewItem constructor called with a null listview parent";
65  }
66  m_type = t;
67  m_object = o;
68  if (o) {
69  m_id = o->id();
70  }
71  setIcon(Icon_Utils::it_Home);
72  setText(name);
73 }
74 
80 UMLListViewItem::UMLListViewItem(UMLListView * parent)
81  : QTreeWidgetItem(parent)
82 {
83  init();
84  if (parent == 0) {
85  DEBUG(DBG_LVI) << "UMLListViewItem constructor called with a NULL listview parent";
86  }
87 }
88 
94 UMLListViewItem::UMLListViewItem(UMLListViewItem * parent)
95  : QTreeWidgetItem(parent)
96 {
97  init();
98 }
99 
108 UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, const QString &name, ListViewType t, UMLObject*o)
109  : QTreeWidgetItem(parent)
110 {
111  init();
112  m_type = t;
113  m_object = o;
114  if (!o) {
115  m_id = Uml::ID::None;
116  updateFolder();
117  } else {
118  UMLClassifierListItem *umlchild = dynamic_cast<UMLClassifierListItem*>(o);
119  if (umlchild)
120  parent->addClassifierListItem(umlchild, this);
121  updateObject();
122  m_id = o->id();
123  }
124  setText(name);
125  if (!Model_Utils::typeIsRootView(t)) {
126  setFlags(flags() | Qt::ItemIsEditable);
127  }
128 }
129 
138 UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, const QString &name, ListViewType t, Uml::ID::Type id)
139  : QTreeWidgetItem(parent)
140 {
141  init();
142  m_type = t;
143  m_id = id;
144  switch (m_type) {
145  case lvt_Collaboration_Diagram:
146  setIcon(Icon_Utils::it_Diagram_Collaboration);
147  break;
148  case lvt_Class_Diagram:
149  setIcon(Icon_Utils::it_Diagram_Class);
150  break;
151  case lvt_State_Diagram:
152  setIcon(Icon_Utils::it_Diagram_State);
153  break;
154  case lvt_Activity_Diagram:
155  setIcon(Icon_Utils::it_Diagram_Activity);
156  break;
157  case lvt_Sequence_Diagram:
158  setIcon(Icon_Utils::it_Diagram_Sequence);
159  break;
160  case lvt_Component_Diagram:
161  setIcon(Icon_Utils::it_Diagram_Component);
162  break;
163  case lvt_Deployment_Diagram:
164  setIcon(Icon_Utils::it_Diagram_Deployment);
165  break;
166  case lvt_UseCase_Diagram:
167  setIcon(Icon_Utils::it_Diagram_Usecase);
168  break;
169  default:
170  setIcon(Icon_Utils::it_Diagram);
171  }
172  // Constructor also used by folder so just make sure we don't need to
173  // to set pixmap to folder. doesn't hurt diagrams.
174  updateFolder();
175  setText(name);
176  setFlags(flags() | Qt::ItemIsEditable);
177 }
178 
182 UMLListViewItem::~UMLListViewItem()
183 {
184 }
185 
189 void UMLListViewItem::init()
190 {
191  m_type = lvt_Unknown;
192  m_object = 0;
193  m_id = Uml::ID::None;
194 }
195 
200 QString UMLListViewItem::toolTip()
201 {
202  UMLObject *obj = umlObject();
203  if (obj) {
204  switch (obj->baseType()) {
205  case UMLObject::ot_Class:
206  return obj->doc();
207  case UMLObject::ot_Operation:
208  {
209  UMLOperation *op = static_cast<UMLOperation*>(obj);
210  return op->toString(Uml::SignatureType::ShowSig);
211  }
212  case UMLObject::ot_Attribute:
213  {
214  UMLAttribute *at = static_cast<UMLAttribute*>(obj);
215  return at->toString(Uml::SignatureType::ShowSig);
216  }
217  default:
218  return QString();
219  }
220  }
221  else {
222  return QString();
223  }
224 }
225 
231 UMLListViewItem::ListViewType UMLListViewItem::type() const
232 {
233  return m_type;
234 }
235 
239 void UMLListViewItem::addClassifierListItem(UMLClassifierListItem *child, UMLListViewItem *childItem)
240 {
241  m_comap[child] = childItem;
242 }
243 
247 void UMLListViewItem::deleteChildItem(UMLClassifierListItem *child)
248 {
249  UMLListViewItem *childItem = findChildObject(child);
250  if (childItem == 0) {
251  uError() << child->name() << ": child listview item not found";
252  return;
253  }
254  m_comap.remove(child);
255  delete childItem;
256 }
257 
258 void UMLListViewItem::setVisible(bool state)
259 {
260  setHidden(!state);
261 }
262 
268 Uml::ID::Type UMLListViewItem::ID() const
269 {
270  if (m_object) {
271  return m_object->id();
272  }
273  return m_id;
274 }
275 
282 void UMLListViewItem::setID(Uml::ID::Type id)
283 {
284  if (m_object) {
285  Uml::ID::Type oid = m_object->id();
286  if (id != Uml::ID::None && oid != id) {
287  DEBUG(DBG_LVI) << "new id " << Uml::ID::toString(id) << " does not agree with object id "
288  << Uml::ID::toString(oid);
289  }
290  }
291  m_id = id;
292 }
293 
299 void UMLListViewItem::setUMLObject(UMLObject * obj)
300 {
301  m_object = obj;
302 }
303 
309 UMLObject * UMLListViewItem::umlObject() const
310 {
311  return m_object;
312 }
313 
318 bool UMLListViewItem::isOwnParent(Uml::ID::Type listViewItemID)
319 {
320  UMLListView* listView = static_cast<UMLListView*>(treeWidget());
321  QTreeWidgetItem *lvi = static_cast<QTreeWidgetItem*>(listView->findItem(listViewItemID));
322  if (lvi == 0) {
323  uError() << "ListView->findItem(" << Uml::ID::toString(listViewItemID) << ") returns NULL";
324  return true;
325  }
326  for (QTreeWidgetItem *self = static_cast<QTreeWidgetItem*>(this); self; self = self->parent()) {
327  if (lvi == self)
328  return true;
329  }
330  return false;
331 }
332 
336 void UMLListViewItem::updateObject()
337 {
338  if (m_object == 0)
339  return;
340 
341  Uml::Visibility::Enum scope = m_object->visibility();
342  UMLObject::ObjectType ot = m_object->baseType();
343  QString modelObjText = m_object->name();
344  if (Model_Utils::isClassifierListitem(ot)) {
345  UMLClassifierListItem *pNarrowed = static_cast<UMLClassifierListItem*>(m_object);
346  modelObjText = pNarrowed->toString(Uml::SignatureType::SigNoVis);
347  }
348  setText(modelObjText);
349 
350  Icon_Utils::IconType icon = Icon_Utils::it_Home;
351  switch (ot) {
352  case UMLObject::ot_Package:
353  if (m_object->stereotype() == "subsystem")
354  icon = Icon_Utils::it_Subsystem;
355  else
356  icon = Icon_Utils::it_Package;
357  break;
358  /*
359  case UMLObject::ot_Folder:
360  {
361  ListViewType lvt = Model_Utils::convert_OT_LVT(m_object);
362  icon = Model_Utils::convert_LVT_IT(lvt);
363  }
364  break;
365  */
366  case UMLObject::ot_Operation:
367  if (scope == Uml::Visibility::Public)
368  icon = Icon_Utils::it_Public_Method;
369  else if (scope == Uml::Visibility::Private)
370  icon = Icon_Utils::it_Private_Method;
371  else if (scope == Uml::Visibility::Implementation)
372  icon = Icon_Utils::it_Private_Method;
373  else
374  icon = Icon_Utils::it_Protected_Method;
375  break;
376 
377  case UMLObject::ot_Attribute:
378  case UMLObject::ot_EntityAttribute:
379  if (scope == Uml::Visibility::Public)
380  icon = Icon_Utils::it_Public_Attribute;
381  else if (scope == Uml::Visibility::Private)
382  icon = Icon_Utils::it_Private_Attribute;
383  else if (scope == Uml::Visibility::Implementation)
384  icon = Icon_Utils::it_Private_Attribute;
385  else
386  icon = Icon_Utils::it_Protected_Attribute;
387  break;
388  case UMLObject::ot_UniqueConstraint:
389  m_type = Model_Utils::convert_OT_LVT(umlObject());
390  icon = Model_Utils::convert_LVT_IT(m_type);
391  break;
392 
393  default:
394  icon = Model_Utils::convert_LVT_IT(m_type);
395  break;
396  }//end switch
397  if (icon)
398  setIcon(icon);
399 }
400 
404 void UMLListViewItem::updateFolder()
405 {
406  Icon_Utils::IconType icon = Model_Utils::convert_LVT_IT(m_type);
407  if (icon) {
408  if (Model_Utils::typeIsFolder(m_type))
409  icon = (Icon_Utils::IconType)((int)icon + (int)isExpanded());
410  setIcon(icon);
411  }
412 }
413 
418 void UMLListViewItem::setOpen(bool expand)
419 {
420  QTreeWidgetItem::setExpanded(expand);
421  updateFolder();
422 }
423 
427 void UMLListViewItem::setText(const QString &newText)
428 {
429  setText(0, newText);
430 }
431 
435 void UMLListViewItem::setText(int column, const QString &newText)
436 {
437  m_label = newText;
438  QTreeWidgetItem::setText(column, newText);
439 }
440 
444 QString UMLListViewItem::getSavedText() const
445 {
446  return m_label;
447 }
448 
452 void UMLListViewItem::setIcon(Icon_Utils::IconType iconType)
453 {
454  QPixmap p = Icon_Utils::SmallIcon(iconType);
455  QTreeWidgetItem::setIcon(0, QIcon(p));
456 }
457 
461 void UMLListViewItem::slotEditFinished(const QString &newText)
462 {
463  m_label = text(0);
464 
465  DEBUG(DBG_LVI) << this << "text=" << newText;
466  UMLListView* listView = static_cast<UMLListView*>(treeWidget());
467  UMLDoc* doc = listView->document();
468  if (newText == m_label) {
469  return;
470  }
471  if (newText.isEmpty()) {
472  cancelRenameWithMsg();
473  return;
474  }
475  switch (m_type) {
476  case lvt_UseCase:
477  case lvt_Actor:
478  case lvt_Class:
479  case lvt_Package:
480  case lvt_UseCase_Folder:
481  case lvt_Logical_Folder:
482  case lvt_Component_Folder:
483  case lvt_Deployment_Folder:
484  case lvt_EntityRelationship_Folder:
485  case lvt_Interface:
486  case lvt_Datatype:
487  case lvt_Enum:
488  case lvt_EnumLiteral:
489  case lvt_Subsystem:
490  case lvt_Component:
491  case lvt_Node:
492  case lvt_Category:
493  if (m_object == 0 || !doc->isUnique(newText)) {
494  cancelRenameWithMsg();
495  return;
496  }
497  UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(m_object, newText));
498  doc->setModified(true);
499  m_label = newText;
500  break;
501 
502  case lvt_Operation: {
503  if (m_object == 0) {
504  cancelRenameWithMsg();
505  return;
506  }
507  UMLOperation *op = static_cast<UMLOperation*>(m_object);
508  UMLClassifier *parent = static_cast<UMLClassifier *>(op->parent());
509  Model_Utils::OpDescriptor od;
510  Model_Utils::Parse_Status st = Model_Utils::parseOperation(newText, od, parent);
511  if (st == Model_Utils::PS_OK) {
512  // TODO: Check that no operation with the exact same profile exists.
513  UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(op, od.m_name));
514  op->setType(od.m_pReturnType);
515  UMLAttributeList parmList = op->getParmList();
516  const int newParmListCount = parmList.count();
517  if (newParmListCount > od.m_args.count()) {
518  // Remove parameters at end of of list that no longer exist.
519  for (int i = od.m_args.count(); i < newParmListCount; i++) {
520  UMLAttribute *a = parmList.at(i);
521  op->removeParm(a, false);
522  }
523  }
524  Model_Utils::NameAndType_ListIt lit = od.m_args.begin();
525  for (int i = 0; lit != od.m_args.end(); ++lit, ++i) {
526  const Model_Utils::NameAndType& nm_tp = *lit;
527  UMLAttribute *a;
528  if (i < newParmListCount) {
529  a = parmList.at(i);
530  } else {
531  a = new UMLAttribute(op);
532  a->setID(UniqueID::gen());
533  }
534  UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(a, nm_tp.m_name));
535  a->setType(nm_tp.m_type);
536  a->setParmKind(nm_tp.m_direction);
537  a->setInitialValue(nm_tp.m_initialValue);
538  if (i >= newParmListCount) {
539  op->addParm(a);
540  }
541  }
542  m_label = op->toString(Uml::SignatureType::SigNoVis);
543  } else {
544  KMessageBox::error(0,
545  Model_Utils::psText(st),
546  i18n("Rename canceled"));
547  }
548  setText(m_label);
549  break;
550  }
551 
552  case lvt_Attribute:
553  case lvt_EntityAttribute: {
554  if (m_object == 0) {
555  cancelRenameWithMsg();
556  return;
557  }
558  UMLClassifier *parent = static_cast<UMLClassifier*>(m_object->parent());
559  Model_Utils::NameAndType nt;
560  Uml::Visibility::Enum vis;
561  Model_Utils::Parse_Status st;
562  st = Model_Utils::parseAttribute(newText, nt, parent, &vis);
563  if (st == Model_Utils::PS_OK) {
564  UMLObject *exists = parent->findChildObject(newText);
565  if (exists) {
566  cancelRenameWithMsg();
567  return;
568  }
569  UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(m_object, nt.m_name));
570  UMLAttribute *pAtt = static_cast<UMLAttribute*>(m_object);
571  pAtt->setType(nt.m_type);
572  pAtt->setVisibility(vis);
573  pAtt->setParmKind(nt.m_direction);
574  pAtt->setInitialValue(nt.m_initialValue);
575  m_label = pAtt->toString(Uml::SignatureType::SigNoVis);
576  } else {
577  KMessageBox::error(0,
578  Model_Utils::psText(st),
579  i18n("Rename canceled"));
580  }
581  setText(m_label);
582  break;
583  }
584 
585  case lvt_PrimaryKeyConstraint:
586  case lvt_UniqueConstraint:
587  case lvt_ForeignKeyConstraint:
588  case lvt_CheckConstraint: {
589  if (m_object == 0) {
590  cancelRenameWithMsg();
591  return;
592  }
593  UMLEntity *parent = static_cast<UMLEntity*>(m_object->parent());
594  QString name;
595  Model_Utils::Parse_Status st;
596  st = Model_Utils::parseConstraint(newText, name, parent);
597  if (st == Model_Utils::PS_OK) {
598  UMLObject *exists = parent->findChildObject(name);
599  if (exists) {
600  cancelRenameWithMsg();
601  return;
602  }
603  UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(m_object, name));
604 
605  UMLEntityConstraint* uec = static_cast<UMLEntityConstraint*>(m_object);
606  m_label = uec->toString(Uml::SignatureType::SigNoVis);
607  } else {
608  KMessageBox::error(0,
609  Model_Utils::psText(st),
610  i18n("Rename canceled"));
611  }
612  setText(m_label);
613  break;
614  }
615 
616  case lvt_Template: {
617  if (m_object == 0) {
618  cancelRenameWithMsg();
619  return;
620  }
621  UMLClassifier *parent = static_cast<UMLClassifier*>(m_object->parent());
622  Model_Utils::NameAndType nt;
623  Model_Utils::Parse_Status st = Model_Utils::parseTemplate(newText, nt, parent);
624  if (st == Model_Utils::PS_OK) {
625  UMLObject *exists = parent->findChildObject(newText);
626  if (exists) {
627  cancelRenameWithMsg();
628  return;
629  }
630  UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObject(m_object, nt.m_name));
631  UMLTemplate *tmpl = static_cast<UMLTemplate*>(m_object);
632  tmpl->setType(nt.m_type);
633  m_label = tmpl->toString(Uml::SignatureType::SigNoVis);
634  } else {
635  KMessageBox::error(0,
636  Model_Utils::psText(st),
637  i18n("Rename canceled"));
638  }
639  setText(m_label);
640  break;
641  }
642 
643  case lvt_UseCase_Diagram:
644  case lvt_Class_Diagram:
645  case lvt_Sequence_Diagram:
646  case lvt_Collaboration_Diagram:
647  case lvt_State_Diagram:
648  case lvt_Activity_Diagram:
649  case lvt_Component_Diagram:
650  case lvt_Deployment_Diagram: {
651  UMLView *view = doc->findView(ID());
652  if (view == 0) {
653  cancelRenameWithMsg();
654  return;
655  }
656  UMLView *anotherView = doc->findView(view->umlScene()->type(), newText);
657  if (anotherView && anotherView->umlScene()->ID() == ID()) {
658  anotherView = 0;
659  }
660  if (anotherView) {
661  cancelRenameWithMsg();
662  return;
663  }
664  view->umlScene()->setName(newText);
665  setText(newText);
666  doc->signalDiagramRenamed(view);
667  break;
668  }
669  default:
670  KMessageBox::error(0,
671  i18n("Renaming an item of listview type %1 is not yet implemented.", m_type),
672  i18n("Function Not Implemented"));
673  setText(m_label);
674  break;
675  }
676  doc->setModified(true);
677 }
678 
682 void UMLListViewItem::cancelRenameWithMsg()
683 {
684  DEBUG(DBG_LVI) << this << " - column=" << ":TODO:col" << ", text=" << text(0);
685  KMessageBox::error(0,
686  i18n("The name you entered was invalid.\nRenaming process has been canceled."),
687  i18n("Name Not Valid"));
688  setText(m_label);
689 }
690 
696 #if 0
697 int UMLListViewItem::compare(QTreeWidgetItem *other, int col, bool ascending) const
698 {
699  UMLListViewItem *ulvi = static_cast<UMLListViewItem*>(other);
700  ListViewType ourType = type();
701  ListViewType otherType = ulvi->type();
702 
703  if (ourType < otherType)
704  return -1;
705  if (ourType > otherType)
706  return 1;
707  // ourType == otherType
708  const bool subItem = Model_Utils::typeIsClassifierList(ourType);
709  const int alphaOrder = key(col, ascending).compare(other->key(col, ascending));
710  int retval = 0;
711  QString dbgPfx = "compare(type=" + QString::number((int)ourType)
712  + ", self=" + text() + ", other=" + ulvi->text()
713  + "): return ";
714  UMLObject *otherObj = ulvi->umlObject();
715  if (m_object == 0) {
716  retval = (subItem ? 1 : alphaOrder);
717 #ifdef DEBUG_LVITEM_INSERTION_ORDER
718  DEBUG(DBG_LVI) << dbgPfx << retval << " because (m_object==0)";
719 #endif
720  return retval;
721  }
722  if (otherObj == 0) {
723  retval = (subItem ? -1 : alphaOrder);
724 #ifdef DEBUG_LVITEM_INSERTION_ORDER
725  DEBUG(DBG_LVI) << dbgPfx << retval << " because (otherObj==0)";
726 #endif
727  return retval;
728  }
729  UMLClassifier *ourParent = dynamic_cast<UMLClassifier*>(m_object->parent());
730  UMLClassifier *otherParent = dynamic_cast<UMLClassifier*>(otherObj->parent());
731  if (ourParent == 0) {
732  retval = (subItem ? 1 : alphaOrder);
733 #ifdef DEBUG_LVITEM_INSERTION_ORDER
734  DEBUG(DBG_LVI) << dbgPfx << retval << " because (ourParent==0)";
735 #endif
736  return retval;
737  }
738  if (otherParent == 0) {
739  retval = (subItem ? -1 : alphaOrder);
740 #ifdef DEBUG_LVITEM_INSERTION_ORDER
741  DEBUG(DBG_LVI) << dbgPfx << retval << " because (otherParent==0)";
742 #endif
743  return retval;
744  }
745  if (ourParent != otherParent) {
746  retval = (subItem ? 0 : alphaOrder);
747 #ifdef DEBUG_LVITEM_INSERTION_ORDER
748  DEBUG(DBG_LVI) << dbgPfx << retval << " because (ourParent != otherParent)";
749 #endif
750  return retval;
751  }
752  UMLClassifierListItem *thisUmlItem = dynamic_cast<UMLClassifierListItem*>(m_object);
753  UMLClassifierListItem *otherUmlItem = dynamic_cast<UMLClassifierListItem*>(otherObj);
754  if (thisUmlItem == 0) {
755  retval = (subItem ? 1 : alphaOrder);
756 #ifdef DEBUG_LVITEM_INSERTION_ORDER
757  DEBUG(DBG_LVI) << dbgPfx << retval << " because (thisUmlItem==0)";
758 #endif
759  return retval;
760  }
761  if (otherUmlItem == 0) {
762  retval = (subItem ? -1 : alphaOrder);
763 #ifdef DEBUG_LVITEM_INSERTION_ORDER
764  DEBUG(DBG_LVI) << dbgPfx << retval << " because (otherUmlItem==0)";
765 #endif
766  return retval;
767  }
768  UMLClassifierListItemList items = ourParent->getFilteredList(thisUmlItem->baseType());
769  int myIndex = items.indexOf(thisUmlItem);
770  int otherIndex = items.indexOf(otherUmlItem);
771  if (myIndex < 0) {
772  retval = (subItem ? -1 : alphaOrder);
773  uError() << dbgPfx << retval << " because (myIndex < 0)";
774  return retval;
775  }
776  if (otherIndex < 0) {
777  retval = (subItem ? 1 : alphaOrder);
778  uError() << dbgPfx << retval << " because (otherIndex < 0)";
779  return retval;
780  }
781  return (myIndex < otherIndex ? -1 : myIndex > otherIndex ? 1 : 0);
782 }
783 #endif
784 
790 UMLListViewItem* UMLListViewItem::deepCopy(UMLListViewItem *newParent)
791 {
792  QString nm = text(0);
793  ListViewType t = type();
794  UMLObject *o = umlObject();
795  UMLListViewItem* newItem;
796  if (o)
797  newItem = new UMLListViewItem(newParent, nm, t, o);
798  else
799  newItem = new UMLListViewItem(newParent, nm, t, m_id);
800  for (int i=0; i < childCount(); i++) {
801  UMLListViewItem *childItem = static_cast<UMLListViewItem*>(child(i));
802  childItem->deepCopy(newItem);
803  }
804  return newItem;
805 }
806 
812 UMLListViewItem* UMLListViewItem::findUMLObject(const UMLObject *o)
813 {
814  if (m_object == o)
815  return this;
816  for (int i = 0; i < childCount(); i++) {
817  UMLListViewItem *item = static_cast<UMLListViewItem*>(child(i));
818  UMLListViewItem *testItem = item->findUMLObject(o);
819  if (testItem)
820  return testItem;
821  }
822  return 0;
823 }
824 
831 UMLListViewItem* UMLListViewItem::findChildObject(UMLClassifierListItem *cli)
832 {
833  ChildObjectMap::iterator it = m_comap.find(cli);
834  if (it != m_comap.end()) {
835  return *it;
836  }
837  return 0;
838 }
839 
848 UMLListViewItem * UMLListViewItem::findItem(Uml::ID::Type id)
849 {
850  if (ID() == id) {
851  return this;
852  }
853  for (int i = 0; i < childCount(); ++i) {
854  UMLListViewItem *childItem = static_cast<UMLListViewItem*>(child(i));
855  UMLListViewItem *inner = childItem->findItem(id);
856  if (inner) {
857  return inner;
858  }
859  }
860  return 0;
861 }
862 
866 void UMLListViewItem::saveToXMI(QDomDocument & qDoc, QDomElement & qElement)
867 {
868  QDomElement itemElement = qDoc.createElement("listitem");
869  Uml::ID::Type id = ID();
870  QString idStr = Uml::ID::toString(id);
871  //DEBUG(DBG_LVI) << "id = " << idStr << ", type = " << m_type;
872  if (id != Uml::ID::None)
873  itemElement.setAttribute("id", idStr);
874  itemElement.setAttribute("type", m_type);
875  UMLFolder *extFolder = 0;
876  if (m_object == 0) {
877  if (! Model_Utils::typeIsDiagram(m_type) && m_type != lvt_View)
878  uError() << text(0) << ": m_object is NULL";
879  if (m_type != lvt_View)
880  itemElement.setAttribute("label", text(0));
881  } else if (m_object->id() == Uml::ID::None) {
882  if (text(0).isEmpty()) {
883  DEBUG(DBG_LVI) << "Skipping empty item";
884  return;
885  }
886  DEBUG(DBG_LVI) << "saving local label " << text(0) << " because umlobject ID is not set";
887  if (m_type != lvt_View)
888  itemElement.setAttribute("label", text(0));
889  } else if (m_object->baseType() == UMLObject::ot_Folder) {
890  extFolder = static_cast<UMLFolder*>(m_object);
891  if (!extFolder->folderFile().isEmpty()) {
892  itemElement.setAttribute("open", "0");
893  qElement.appendChild(itemElement);
894  return;
895  }
896  }
897  itemElement.setAttribute("open", isExpanded());
898  QDomElement folderRoot;
899  for (int i=0; i < childCount(); i++) {
900  UMLListViewItem *childItem = static_cast<UMLListViewItem*>(child(i));
901  childItem->saveToXMI(qDoc, itemElement);
902  }
903  qElement.appendChild(itemElement);
904 }
905 
909 bool UMLListViewItem::loadFromXMI(QDomElement& qElement)
910 {
911  QString id = qElement.attribute("id", "-1");
912  QString type = qElement.attribute("type", "-1");
913  QString label = qElement.attribute("label", "");
914  QString open = qElement.attribute("open", "1");
915  if (!label.isEmpty())
916  setText(label);
917  else if (id == "-1") {
918  uError() << "Item of type " << type << " has neither ID nor label";
919  return false;
920  }
921 
922  m_id = Uml::ID::fromString(id);
923  if (m_id != Uml::ID::None) {
924  UMLListView* listView = static_cast<UMLListView*>(treeWidget());
925  m_object = listView->document()->findObjectById(m_id);
926  }
927  m_type = (ListViewType)(type.toInt());
928  if (m_object)
929  updateObject();
930  setOpen((bool)open.toInt());
931  return true;
932 }
933 
934 UMLListViewItem* UMLListViewItem::childItem(int i)
935 {
936  return static_cast<UMLListViewItem*>(child(i));
937 }
938 
939 QString UMLListViewItem::toString(ListViewType type)
940 {
941  switch (type) {
942  case lvt_View:
943  return "lvt_View";
944  case lvt_Logical_View:
945  return "lvt_Logical_View";
946  case lvt_UseCase_View:
947  return "lvt_UseCase_View";
948  case lvt_Logical_Folder:
949  return "lvt_Logical_Folder";
950  case lvt_UseCase_Folder:
951  return "lvt_UseCase_Folder";
952  case lvt_UseCase_Diagram:
953  return "lvt_UseCase_Diagram";
954  case lvt_Collaboration_Diagram:
955  return "lvt_Collaboration_Diagram";
956  case lvt_Class_Diagram:
957  return "lvt_Class_Diagram";
958  case lvt_State_Diagram:
959  return "lvt_State_Diagram";
960  case lvt_Activity_Diagram:
961  return "lvt_Activity_Diagram";
962  case lvt_Sequence_Diagram:
963  return "lvt_Sequence_Diagram";
964  case lvt_Actor:
965  return "lvt_Actor";
966  case lvt_UseCase:
967  return "lvt_UseCase";
968  case lvt_Class:
969  return "lvt_Class";
970  case lvt_Attribute:
971  return "lvt_Attribute";
972  case lvt_Operation:
973  return "lvt_Operation";
974  case lvt_Template:
975  return "lvt_Template";
976  case lvt_Interface:
977  return "lvt_Interface";
978  case lvt_Package:
979  return "lvt_Package";
980  case lvt_Component_Diagram:
981  return "lvt_Component_Diagram";
982  case lvt_Component_Folder:
983  return "lvt_Component_Folder";
984  case lvt_Component_View:
985  return "lvt_Component_View";
986  case lvt_Component:
987  return "lvt_Component";
988  case lvt_Diagrams:
989  return "lvt_Diagrams";
990  case lvt_Artifact:
991  return "lvt_Artifact";
992  case lvt_Deployment_Diagram:
993  return "lvt_Deployment_Diagram";
994  case lvt_Deployment_Folder:
995  return "lvt_Deployment_Folder";
996  case lvt_Deployment_View:
997  return "lvt_Deployment_View";
998  case lvt_Node:
999  return "lvt_Node";
1000  case lvt_Datatype:
1001  return "lvt_Datatype";
1002  case lvt_Datatype_Folder:
1003  return "lvt_Datatype_Folder";
1004  case lvt_Enum:
1005  return "lvt_Enum";
1006  case lvt_Entity:
1007  return "lvt_Entity";
1008  case lvt_EntityAttribute:
1009  return "lvt_EntityAttribute";
1010  case lvt_EntityRelationship_Diagram:
1011  return "lvt_EntityRelationship_Diagram";
1012  case lvt_EntityRelationship_Folder:
1013  return "lvt_EntityRelationship_Folder";
1014  case lvt_EntityRelationship_Model:
1015  return "lvt_EntityRelationship_Model";
1016  case lvt_Subsystem:
1017  return "lvt_Subsystem";
1018  case lvt_Model:
1019  return "lvt_Model";
1020  case lvt_EnumLiteral:
1021  return "lvt_EnumLiteral";
1022  case lvt_UniqueConstraint:
1023  return "lvt_UniqueConstraint";
1024  case lvt_PrimaryKeyConstraint:
1025  return "lvt_PrimaryKeyConstraint";
1026  case lvt_ForeignKeyConstraint:
1027  return "lvt_ForeignKeyConstraint";
1028  case lvt_CheckConstraint:
1029  return "lvt_CheckConstraint";
1030  case lvt_Category:
1031  return "lvt_Category";
1032  case lvt_Unknown:
1033  return "lvt_Unknown";
1034  default:
1035  return "? ListViewType ?";
1036  }
1037 }
1038 
1042 QDebug operator<<(QDebug dbg, const UMLListViewItem& item)
1043 {
1044  dbg.nospace() << "UMLListViewItem: " << item.text(0)
1045  << ", type=" << UMLListViewItem::toString(item.type())
1046  << ", id=" << Uml::ID::toString(item.ID())
1047  << ", children=" << item.childCount();
1048  return dbg.space();
1049 }
UMLListViewItem::childItem
UMLListViewItem * childItem(int i)
Definition: umllistviewitem.cpp:934
UMLListViewItem::setText
void setText(int column, const QString &text)
Changes the current text.
Definition: umllistviewitem.cpp:435
Model_Utils::isClassifierListitem
bool isClassifierListitem(UMLObject::ObjectType type)
Return true if the given object type is a classifier list item type.
Definition: model_utils.cpp:550
UMLListViewItem::deepCopy
UMLListViewItem * deepCopy(UMLListViewItem *newParent)
Overrides the default sorting to sort by item type.
Definition: umllistviewitem.cpp:790
UMLListViewItem::lvt_UseCase_View
Definition: umllistviewitem.h:47
UMLOperation::removeParm
void removeParm(UMLAttribute *a, bool emitModifiedSignal=true)
Remove a parameter from the operation.
Definition: operation.cpp:151
Model_Utils::typeIsClassifierList
bool typeIsClassifierList(UMLListViewItem::ListViewType type)
Return true if the listview type is an attribute, operation, or template.
Definition: model_utils.cpp:983
UMLListViewItem
Items used by the class UMLListView.
Definition: umllistviewitem.h:38
UMLListViewItem::lvt_EntityRelationship_Diagram
Definition: umllistviewitem.h:79
entity.h
UMLListViewItem::m_object
UMLObject * m_object
Definition: umllistviewitem.h:162
UniqueID::init
void init()
Reinitialize the unique ID counter.
Definition: uniqueid.cpp:37
UMLListViewItem::lvt_CheckConstraint
Definition: umllistviewitem.h:88
UMLClassifierListItemList
This sub-class adds copyInto and clone to the QPtrList base class...
Definition: umlclassifierlistitemlist.h:26
UMLListViewItem::setOpen
void setOpen(bool state)
Overrides default method.
Definition: umllistviewitem.cpp:418
UMLListViewItem::saveToXMI
void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves the listview item to a "listitem" tag.
Definition: umllistviewitem.cpp:866
UMLClassifier
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
UMLListViewItem::lvt_Package
Definition: umllistviewitem.h:63
UMLListViewItem::umlObject
UMLObject * umlObject() const
Return the UMLObject associated with this instance.
Definition: umllistviewitem.cpp:309
UMLListViewItem::m_id
Uml::ID::Type m_id
Definition: umllistviewitem.h:161
UMLListViewItem::lvt_EntityRelationship_Folder
Definition: umllistviewitem.h:80
UMLListViewItem::m_label
QString m_label
Definition: umllistviewitem.h:163
UniqueID::gen
Uml::ID::Type gen()
MAIN FUNCTION: Return a new unique ID.
Definition: uniqueid.cpp:26
Icon_Utils::it_Diagram_Class
Definition: icon_utils.h:113
UMLListViewItem::lvt_Model
Definition: umllistviewitem.h:83
Model_Utils::typeIsDiagram
bool typeIsDiagram(UMLListViewItem::ListViewType type)
Return true if the listview type is a diagram.
Definition: model_utils.cpp:1017
UMLClassifierListItem
Classifiers (classes, interfaces) have lists of operations, attributes, templates and others...
Definition: classifierlistitem.h:29
UMLListViewItem::updateFolder
void updateFolder()
Updates the icon on a folder.
Definition: umllistviewitem.cpp:404
Uml::Visibility::Enum
Enum
Definition: basictypes.h:56
UMLClassifierListItem::setType
virtual void setType(UMLObject *type)
Sets the type of the UMLAttribute.
Definition: classifierlistitem.cpp:125
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:435
UMLClassifier::getFilteredList
virtual UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Returns the entries in m_List that are of the requested type.
Definition: classifier.cpp:1019
UMLListViewItem::lvt_Datatype_Folder
Definition: umllistviewitem.h:75
Model_Utils::Parse_Status
Parse_Status
Definition: model_utils.h:91
umlview.h
UMLListViewItem::lvt_UseCase_Folder
Definition: umllistviewitem.h:49
UMLListViewItem::lvt_Interface
Definition: umllistviewitem.h:62
Model_Utils::OpDescriptor
Definition: model_utils.h:112
UMLAttribute::setVisibility
void setVisibility(Uml::Visibility::Enum s)
Reimplementation of method from UMLObject is required as an extra signal, attributeChanged(), is emitted.
Definition: attribute.cpp:86
UMLListViewItem::isOwnParent
bool isOwnParent(Uml::ID::Type listViewItemID)
Returns true if the UMLListViewItem of the given ID is a parent of this UMLListViewItem.
Definition: umllistviewitem.cpp:318
UMLListViewItem::lvt_Subsystem
Definition: umllistviewitem.h:82
UMLListViewItem::lvt_Node
Definition: umllistviewitem.h:73
umlscene.h
UMLListViewItem::lvt_Deployment_View
Definition: umllistviewitem.h:72
Model_Utils::parseConstraint
Parse_Status parseConstraint(QString m, QString &name, UMLEntity *owningScope)
Parses a constraint.
Definition: model_utils.cpp:863
UMLView
UMLView instances represent diagrams.
Definition: umlview.h:32
Uml::CmdRenameUMLObject
Definition: cmd_renameUMLObject.h:20
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
UMLListViewItem::lvt_Unknown
Definition: umllistviewitem.h:90
UMLListViewItem::slotEditFinished
void slotEditFinished(const QString &newText)
This slot is called to finish item editing.
Definition: umllistviewitem.cpp:461
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
UMLListViewItem::findUMLObject
UMLListViewItem * findUMLObject(const UMLObject *o)
Find the UMLListViewItem that is related to the given UMLObject in the tree rooted at the current UML...
Definition: umllistviewitem.cpp:812
UMLListViewItem::lvt_Artifact
Definition: umllistviewitem.h:69
UMLAttributeList
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
UMLListViewItem::toolTip
QString toolTip()
Returns the signature of items that are operations.
Definition: umllistviewitem.cpp:200
UMLListViewItem::lvt_Collaboration_Diagram
Definition: umllistviewitem.h:51
UMLListViewItem::lvt_UseCase
Definition: umllistviewitem.h:57
UMLObject::ot_UniqueConstraint
Definition: umlobject.h:71
UMLListViewItem::lvt_Class_Diagram
Definition: umllistviewitem.h:52
UMLTemplate
This class holds information used by template classes, called paramaterised class in UML and a generi...
Definition: template.h:26
UMLListViewItem::lvt_Sequence_Diagram
Definition: umllistviewitem.h:55
Icon_Utils::it_Diagram_Sequence
Definition: icon_utils.h:118
UMLObject::ot_Operation
Definition: umlobject.h:59
UMLListViewItem::lvt_Template
Definition: umllistviewitem.h:61
UMLListViewItem::lvt_Attribute
Definition: umllistviewitem.h:59
UMLListViewItem::lvt_Actor
Definition: umllistviewitem.h:56
UMLListViewItem::lvt_ForeignKeyConstraint
Definition: umllistviewitem.h:87
classifier.h
UMLListViewItem::lvt_Enum
Definition: umllistviewitem.h:76
Icon_Utils::it_Home
Definition: icon_utils.h:40
UMLListViewItem::deleteChildItem
void deleteChildItem(UMLClassifierListItem *child)
Deletes the child listview item representing the given UMLClassifierListItem.
Definition: umllistviewitem.cpp:247
model_utils.h
debug_utils.h
UMLOperation::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the operation.
Definition: operation.cpp:198
UMLDoc::signalDiagramRenamed
void signalDiagramRenamed(UMLView *view)
Signal a view/diagram has been renamed.
Definition: umldoc.cpp:2903
operator<<
QDebug operator<<(QDebug dbg, const UMLListViewItem &item)
Overloading operator for debugging output.
Definition: umllistviewitem.cpp:1042
Model_Utils::PS_OK
Return type of parseOperation().
Definition: model_utils.h:92
UMLListViewItem::UMLListViewItem
UMLListViewItem(UMLListView *parent, const QString &name, ListViewType t, UMLObject *o=0)
Sets up an instance.
Definition: umllistviewitem.cpp:58
UMLListViewItem::ID
Uml::ID::Type ID() const
Returns the id this class represents.
Definition: umllistviewitem.cpp:268
Uml::Visibility::Private
Definition: basictypes.h:58
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
UMLListViewItem::setUMLObject
void setUMLObject(UMLObject *obj)
Set the UMLObject associated with this instance.
Definition: umllistviewitem.cpp:299
UMLOperation::setType
void setType(UMLObject *type)
Reimplement method from UMLClassifierListItem.
Definition: operation.cpp:87
UMLClassifierListItem::toString
virtual QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the list item.
Definition: classifierlistitem.cpp:89
UMLDoc::findView
UMLView * findView(Uml::ID::Type id)
Finds a view (diagram) by the ID given to method.
Definition: umldoc.cpp:733
UMLListViewItem::lvt_Logical_Folder
Definition: umllistviewitem.h:48
UMLListView
This is one of the main classes used in this program.
Definition: umllistview.h:48
Icon_Utils::it_Diagram_Activity
Definition: icon_utils.h:112
UMLScene::type
Uml::DiagramType::Enum type() const
Returns the type of the diagram.
Definition: umlscene.cpp:256
Uml::SignatureType::SigNoVis
Definition: basictypes.h:137
Model_Utils::typeIsRootView
bool typeIsRootView(UMLListViewItem::ListViewType type)
Return true if the listview type is one of the predefined root views (root, logical, usecase, component, deployment, datatype, or entity- relationship view.)
Definition: model_utils.cpp:898
UMLListViewItem::type
ListViewType type() const
Returns the type this instance represents.
Definition: umllistviewitem.cpp:231
Model_Utils::NameAndType::m_name
QString m_name
< Data structure filled by parseAttribute().
Definition: model_utils.h:97
Icon_Utils::it_Protected_Attribute
Definition: icon_utils.h:106
Uml::SignatureType::ShowSig
Definition: basictypes.h:136
UMLAttribute::setInitialValue
void setInitialValue(const QString &iv)
Sets the initial value of the UMLAttribute.
Definition: attribute.cpp:108
UMLListViewItem::lvt_Entity
Definition: umllistviewitem.h:77
Icon_Utils::it_Diagram
Definition: icon_utils.h:75
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Add a parameter to the operation.
Definition: operation.cpp:259
attribute.h
UMLListViewItem::lvt_EntityAttribute
Definition: umllistviewitem.h:78
Icon_Utils::it_Diagram_State
Definition: icon_utils.h:119
UMLListViewItem::lvt_Deployment_Diagram
Definition: umllistviewitem.h:70
UMLApp::executeCommand
void executeCommand(QUndoCommand *cmd)
Execute a command and pushit in the stack.
Definition: uml.cpp:3077
Model_Utils::NameAndType::m_direction
Uml::ParameterDirection::Enum m_direction
Definition: model_utils.h:99
UMLDoc::isUnique
bool isUnique(const QString &name)
Returns true if the given name is unique within its scope.
Definition: umldoc.cpp:972
UMLListViewItem::lvt_UseCase_Diagram
Definition: umllistviewitem.h:50
UMLObject::ot_Folder
Definition: umlobject.h:69
template.h
UMLListViewItem::toString
static QString toString(ListViewType type)
Definition: umllistviewitem.cpp:939
UMLListViewItem::getSavedText
QString getSavedText() const
Returns the saved text.
Definition: umllistviewitem.cpp:444
Icon_Utils::it_Private_Attribute
Definition: icon_utils.h:105
umlobjectlist.h
Uml::Visibility::Implementation
Definition: basictypes.h:60
UMLListViewItem::setID
void setID(Uml::ID::Type id)
Sets the id this class represents.
Definition: umllistviewitem.cpp:282
Icon_Utils::SmallIcon
QPixmap SmallIcon(IconType type)
Returns the pixmap for the given type as small icon.
Definition: icon_utils.cpp:36
UMLListViewItem::lvt_Operation
Definition: umllistviewitem.h:60
UMLListViewItem::m_comap
ChildObjectMap m_comap
Definition: umllistviewitem.h:164
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:101
UMLListViewItem::lvt_UniqueConstraint
Definition: umllistviewitem.h:85
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Find a child object with the given name.
Definition: umlcanvasobject.cpp:240
DBG_LVI
#define DBG_LVI
Definition: umllistviewitem.cpp:46
Model_Utils::NameAndType::m_initialValue
QString m_initialValue
Definition: model_utils.h:100
UMLListView::findItem
UMLListViewItem * findItem(Uml::ID::Type id)
Searches through the tree for the item with the given ID.
Definition: umllistview.cpp:1232
UMLListViewItem::lvt_Component
Definition: umllistviewitem.h:67
UMLFolder
This class manages the UMLObjects and UMLViews of a Folder.
Definition: folder.h:34
UMLDoc::setModified
void setModified(bool modified=true)
Sets the modified flag for the document after a modifying action on the view connected to the documen...
Definition: umldoc.cpp:2607
Model_Utils::convert_LVT_IT
Icon_Utils::IconType convert_LVT_IT(UMLListViewItem::ListViewType lvt)
Return the IconType which corresponds to the given listview type.
Definition: model_utils.cpp:1428
Model_Utils::NameAndType
Definition: model_utils.h:96
Model_Utils::OpDescriptor::m_name
QString m_name
< Data structure filled by parseOperation().
Definition: model_utils.h:113
UMLListViewItem::~UMLListViewItem
~UMLListViewItem()
Standard destructor.
Definition: umllistviewitem.cpp:182
UMLListViewItem::lvt_Logical_View
Definition: umllistviewitem.h:46
UMLListViewItem::cancelRenameWithMsg
void cancelRenameWithMsg()
Auxiliary method for okRename().
Definition: umllistviewitem.cpp:682
UMLListViewItem::lvt_Component_View
Definition: umllistviewitem.h:66
Icon_Utils::it_Diagram_Deployment
Definition: icon_utils.h:116
Icon_Utils::it_Public_Attribute
Definition: icon_utils.h:104
QTreeWidgetItem
UMLObject::stereotype
QString stereotype(bool includeAdornments=false) const
Returns the stereotype.
Definition: umlobject.cpp:581
Uml::ID::Type
std::string Type
Definition: basictypes.h:317
Uml::Visibility::Public
Definition: basictypes.h:57
Model_Utils::psText
QString psText(Parse_Status value)
Returns the Parse_Status as a text.
Definition: model_utils.cpp:883
Model_Utils::parseOperation
Parse_Status parseOperation(QString m, OpDescriptor &desc, UMLClassifier *owningScope)
Parses an operation given in UML syntax.
Definition: model_utils.cpp:793
Model_Utils::NameAndType_ListIt
QLinkedList< NameAndType >::iterator NameAndType_ListIt
Auxiliary type for OpDescriptor.
Definition: model_utils.h:110
folder.h
UMLObject::ot_Attribute
Definition: umlobject.h:58
UMLObject::baseType
ObjectType baseType() const
Returns the type of the object.
Definition: umlobject.cpp:366
UMLEntityConstraint
This class is used to set up information for a entity constraint.
Definition: entityconstraint.h:26
UMLListViewItem::lvt_View
Definition: umllistviewitem.h:45
UMLListViewItem::lvt_Diagrams
Definition: umllistviewitem.h:68
UMLTemplate::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the list item.
Definition: template.cpp:54
UMLListViewItem::lvt_Datatype
Definition: umllistviewitem.h:74
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1048
UMLDoc::findObjectById
UMLObject * findObjectById(Uml::ID::Type id)
Used to find a reference to a UMLObject by its ID.
Definition: umldoc.cpp:766
Icon_Utils::it_Diagram_Component
Definition: icon_utils.h:115
Model_Utils::parseAttribute
Parse_Status parseAttribute(QString a, NameAndType &nmTp, UMLClassifier *owningScope, Uml::Visibility::Enum *vis)
Parses an attribute given in UML syntax.
Definition: model_utils.cpp:718
cmds.h
operation.h
umldoc.h
UMLView::umlScene
UMLScene * umlScene() const
Getter for the scene.
Definition: umlview.cpp:58
UMLListView::document
UMLDoc * document() const
Returns the document pointer.
Definition: umllistview.cpp:1947
Model_Utils::parseTemplate
Parse_Status parseTemplate(QString t, NameAndType &nmTp, UMLClassifier *owningScope)
Parses a template parameter given in UML syntax.
Definition: model_utils.cpp:678
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:47
UMLObject::ot_Class
Definition: umlobject.h:56
UMLListViewItem::lvt_EntityRelationship_Model
Definition: umllistviewitem.h:81
UMLListViewItem::lvt_Deployment_Folder
Definition: umllistviewitem.h:71
UMLListViewItem::lvt_State_Diagram
Definition: umllistviewitem.h:53
UMLListViewItem::updateObject
void updateObject()
Updates the representation of the object.
Definition: umllistviewitem.cpp:336
UMLListViewItem::lvt_Category
Definition: umllistviewitem.h:89
UMLListViewItem::lvt_EnumLiteral
Definition: umllistviewitem.h:84
UMLFolder::folderFile
QString folderFile() const
Get the folder file name for a separate submodel.
Definition: folder.cpp:253
Model_Utils::OpDescriptor::m_args
NameAndType_List m_args
Definition: model_utils.h:114
Icon_Utils::it_Private_Method
Definition: icon_utils.h:101
Model_Utils::NameAndType::m_type
UMLObject * m_type
Definition: model_utils.h:98
UMLListViewItem::m_type
ListViewType m_type
Definition: umllistviewitem.h:160
UMLListViewItem::addClassifierListItem
void addClassifierListItem(UMLClassifierListItem *child, UMLListViewItem *childItem)
Adds the child listview item representing the given UMLClassifierListItem.
Definition: umllistviewitem.cpp:239
UMLListViewItem::lvt_PrimaryKeyConstraint
Definition: umllistviewitem.h:86
UMLListViewItem::findItem
UMLListViewItem * findItem(Uml::ID::Type id)
Find the UMLListViewItem of the given ID in the tree rooted at the current UMLListViewItem.
Definition: umllistviewitem.cpp:848
UMLListViewItem::findChildObject
UMLListViewItem * findChildObject(UMLClassifierListItem *cli)
Find the UMLListViewItem that represents the given UMLClassifierListItem in the children of the curre...
Definition: umllistviewitem.cpp:831
UMLListViewItem::lvt_Class
Definition: umllistviewitem.h:58
umllistview.h
Model_Utils::OpDescriptor::m_pReturnType
UMLObject * m_pReturnType
Definition: model_utils.h:115
UMLListViewItem::loadFromXMI
bool loadFromXMI(QDomElement &qElement)
Loads a "listitem" tag, this is only used by the clipboard currently.
Definition: umllistviewitem.cpp:909
uError
#define uError()
Definition: debug_utils.h:96
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:102
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
uniqueid.h
UMLListViewItem::lvt_Component_Folder
Definition: umllistviewitem.h:65
UMLListViewItem::lvt_Activity_Diagram
Definition: umllistviewitem.h:54
umllistviewitem.h
UMLListViewItem::setIcon
void setIcon(Icon_Utils::IconType iconType)
Set the pixmap corresponding to the given IconType.
Definition: umllistviewitem.cpp:452
UMLObject::ot_Package
Definition: umlobject.h:52
UMLObject::setID
virtual void setID(Uml::ID::Type NewID)
Assigns a new Id to the object.
Definition: umlobject.cpp:159
UMLListViewItem::ListViewType
ListViewType
Definition: umllistviewitem.h:41
Icon_Utils::it_Diagram_Usecase
Definition: icon_utils.h:120
Icon_Utils::IconType
IconType
Definition: icon_utils.h:38
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1053
Icon_Utils::it_Diagram_Collaboration
Definition: icon_utils.h:114
Icon_Utils::it_Public_Method
Definition: icon_utils.h:100
Icon_Utils::it_Protected_Method
Definition: icon_utils.h:102
Icon_Utils::it_Subsystem
Definition: icon_utils.h:82
entityconstraint.h
UMLListViewItem::init
void init()
Initializes key variables of the class.
Definition: umllistviewitem.cpp:189
UMLAttribute::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the UMLAttribute.
Definition: attribute.cpp:132
Model_Utils::convert_OT_LVT
UMLListViewItem::ListViewType convert_OT_LVT(UMLObject *o)
Convert an object's type to the equivalent list view type.
Definition: model_utils.cpp:1186
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:319
UMLListViewItem::setVisible
void setVisible(bool state)
Definition: umllistviewitem.cpp:258
UMLObject::ot_EntityAttribute
Definition: umlobject.h:68
UMLScene::setName
void setName(const QString &name)
Set the name of the diagram.
Definition: umlscene.cpp:248
UMLEntity
This class contains the non-graphical information required for a UML Entity.
Definition: entity.h:34
UMLAttribute::setParmKind
void setParmKind(Uml::ParameterDirection::Enum pk)
Definition: attribute.cpp:116
Icon_Utils::it_Package
Definition: icon_utils.h:81
uml.h
UMLObject::doc
QString doc() const
Returns the documentation for the object.
Definition: umlobject.cpp:404
UMLOperation::getParmList
UMLAttributeList getParmList() const
Returns a list of parameters.
Definition: operation.cpp:171
Model_Utils::typeIsFolder
bool typeIsFolder(UMLListViewItem::ListViewType type)
Return true if the listview type is a logical, usecase or component folder.
Definition: model_utils.cpp:950
UMLScene::ID
Uml::ID::Type ID() const
Returns the ID of the diagram.
Definition: umlscene.cpp:272
UMLListViewItem::lvt_Component_Diagram
Definition: umllistviewitem.h:64
UMLDoc
UMLDoc provides a document object for a document-view model.
Definition: umldoc.h:63
UMLObject::id
virtual Uml::ID::Type id() const
Returns the ID of the object.
Definition: umlobject.cpp:394
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal