• 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
  • widgets
umlwidget.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 #include "umlwidget.h"
12 
13 // local includes
14 #include "associationwidget.h"
15 #include "classifier.h"
16 #include "classpropdlg.h"
17 #include "cmds.h"
18 #include "debug_utils.h"
19 #include "docwindow.h"
20 #include "floatingtextwidget.h"
21 #include "idchangelog.h"
22 #include "listpopupmenu.h"
23 #include "settingsdlg.h"
24 #include "uml.h"
25 #include "umldoc.h"
26 #include "umlobject.h"
27 #include "umlscene.h"
28 #include "umlview.h"
29 #include "uniqueid.h"
30 
31 // kde includes
32 #include <kcolordialog.h>
33 #include <kfontdialog.h>
34 #include <klocale.h>
35 #include <kmessagebox.h>
36 
37 // qt includes
38 #include <QColor>
39 #include <QPainter>
40 #include <QPointer>
41 
42 using namespace Uml;
43 
44 DEBUG_REGISTER_DISABLED(UMLWidget)
45 
46 const QSizeF UMLWidget::DefaultMinimumSize(50, 20);
47 const QSizeF UMLWidget::DefaultMaximumSize(1000, 5000);
48 
55 UMLWidget::UMLWidget(UMLScene * scene, WidgetType type, UMLObject * o)
56  : WidgetBase(scene, type)
57 {
58  init();
59  m_umlObject = o;
60  if (m_umlObject) {
61  connect(m_umlObject, SIGNAL(modified()), this, SLOT(updateWidget()));
62  m_nId = m_umlObject->id();
63  }
64 }
65 
73 UMLWidget::UMLWidget(UMLScene *scene, WidgetType type, Uml::ID::Type id)
74  : WidgetBase(scene, type)
75 {
76  init();
77  if (id == Uml::ID::None)
78  m_nId = UniqueID::gen();
79  else
80  m_nId = id;
81 }
82 
86 UMLWidget::~UMLWidget()
87 {
88  cleanup();
89 }
90 
94 UMLWidget& UMLWidget::operator=(const UMLWidget & other)
95 {
96  if (this == &other)
97  return *this;
98 
99  WidgetBase::operator=(other);
100 
101  // assign members loaded/saved
102  m_useFillColor = other.m_useFillColor;
103  m_usesDiagramFillColor = other.m_usesDiagramFillColor;
104  m_usesDiagramUseFillColor = other.m_usesDiagramUseFillColor;
105  m_fillColor = other.m_fillColor;
106  m_Assocs = other.m_Assocs;
107  m_isInstance = other.m_isInstance;
108  m_instanceName = other.m_instanceName;
109  m_instanceName = other.m_instanceName;
110  m_showStereotype = other.m_showStereotype;
111  setX(other.x());
112  setY(other.y());
113  setRect(rect().x(), rect().y(), other.width(), other.height());
114 
115  // assign volatile (non-saved) members
116  m_selected = other.m_selected;
117  m_startMove = other.m_startMove;
118  m_nPosX = other.m_nPosX;
119  m_doc = other.m_doc; //new
120  m_resizable = other.m_resizable;
121  for (unsigned i = 0; i < FT_INVALID; ++i)
122  m_pFontMetrics[i] = other.m_pFontMetrics[i];
123  m_activated = other.m_activated;
124  m_ignoreSnapToGrid = other.m_ignoreSnapToGrid;
125  m_ignoreSnapComponentSizeToGrid = other.m_ignoreSnapComponentSizeToGrid;
126  return *this;
127 }
128 
132 bool UMLWidget::operator==(const UMLWidget& other) const
133 {
134  if (this == &other)
135  return true;
136 
137  if (m_baseType != other.m_baseType) {
138  return false;
139  }
140 
141  if (id() != other.id())
142  return false;
143 
144  /* Testing the associations is already an exaggeration, no?
145  The type and ID should uniquely identify an UMLWidget.
146  */
147  if (m_Assocs.count() != other.m_Assocs.count()) {
148  return false;
149  }
150 
151  // if(getBaseType() != wt_Text) // DON'T do this for floatingtext widgets, an infinite loop will result
152  // {
153  AssociationWidgetListIt assoc_it(m_Assocs);
154  AssociationWidgetListIt assoc_it2(other.m_Assocs);
155  AssociationWidget * assoc = 0, *assoc2 = 0;
156  while (assoc_it.hasNext() && assoc_it2.hasNext()) {
157  assoc = assoc_it.next();
158  assoc2 = assoc_it2.next();
159 
160  if (!(*assoc == *assoc2)) {
161  return false;
162  }
163  }
164  // }
165  return true;
166  // NOTE: In the comparison tests we are going to do, we don't need these values.
167  // They will actually stop things functioning correctly so if you change these, be aware of that.
168  /*
169  if(m_useFillColor != other.m_useFillColor)
170  return false;
171  if(m_nId != other.m_nId)
172  return false;
173  if(m_nX != other.m_nX)
174  return false;
175  if(m_nY != other.m_nY)
176  return false;
177  */
178 }
179 
185 QSizeF UMLWidget::minimumSize()
186 {
187  return m_minimumSize;
188 }
189 
196 void UMLWidget::setMinimumSize(const QSizeF& newSize)
197 {
198  m_minimumSize = newSize;
199 }
200 
206 QSizeF UMLWidget::maximumSize()
207 {
208  return m_maximumSize;
209 }
210 
217 void UMLWidget::setMaximumSize(const QSizeF& newSize)
218 {
219  m_maximumSize = newSize;
220 }
221 
225 void UMLWidget::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
226 {
227  WidgetBase::contextMenuEvent(event);
228 }
229 
247 void UMLWidget::moveWidgetBy(qreal diffX, qreal diffY)
248 {
249  setX(x() + diffX);
250  setY(y() + diffY);
251 }
252 
270 void UMLWidget::constrainMovementForAllWidgets(qreal &diffX, qreal &diffY)
271 {
272  Q_UNUSED(diffX) Q_UNUSED(diffY)
273 }
274 
278 void UMLWidget::toForeground()
279 {
280  QRectF rect = QRectF(scenePos(), QSizeF(width(), height()));
281  QList<QGraphicsItem*> items = scene()->items(rect, Qt::IntersectsItemShape, Qt::DescendingOrder);
282  DEBUG(DBG_SRC) << "items at " << rect << " = " << items.count();
283  if (items.count() > 1) {
284  foreach(QGraphicsItem* i, items) {
285  UMLWidget* w = dynamic_cast<UMLWidget*>(i);
286  if (w) {
287  DEBUG(DBG_SRC) << "item=" << w->name() << " with zValue=" << w->zValue();
288  if (w->name() != name()) {
289  if (w->zValue() >= zValue()) {
290  setZValue(w->zValue() + 1.0);
291  DEBUG(DBG_SRC) << "bring to foreground with zValue: " << zValue();
292  }
293  }
294  }
295  }
296  }
297  else {
298  setZValue(0.0);
299  }
300  DEBUG(DBG_SRC) << "zValue is " << zValue();
301 }
302 
334 void UMLWidget::mouseMoveEvent(QGraphicsSceneMouseEvent* me)
335 {
336  if (m_inResizeArea) {
337  resize(me);
338  return;
339  }
340 
341  if (!m_moved) {
342  UMLApp::app()->document()->writeToStatusBar(i18n("Hold shift or ctrl to move in X axis. Hold shift and control to move in Y axis. Right button click to cancel move."));
343 
344  m_moved = true;
345  //Maybe needed by AssociationWidget
346  m_startMove = true;
347 
348  setSelectionBounds();
349  }
350 
351  QPointF position = me->scenePos() - m_pressOffset;
352  qreal diffX = position.x() - x();
353  qreal diffY = position.y() - y();
354 
355  if ((me->modifiers() & Qt::ShiftModifier) && (me->modifiers() & Qt::ControlModifier)) {
356  // move only in Y axis
357  diffX = 0;
358  } else if ((me->modifiers() & Qt::ShiftModifier) || (me->modifiers() & Qt::ControlModifier)) {
359  // move only in X axis
360  diffY = 0;
361  }
362 
363  constrainMovementForAllWidgets(diffX, diffY);
364 
365  // nothing to move
366  if (diffX == 0 && diffY == 0) {
367  return;
368  }
369 
370  QPointF delta = me->scenePos() - me->lastScenePos();
371  adjustUnselectedAssocs(delta.x(), delta.y());
372 
373  DEBUG(DBG_SRC) << "diffX=" << diffX << " / diffY=" << diffY;
374  foreach(UMLWidget* widget, m_selectedWidgetsList) {
375  widget->moveWidgetBy(diffX, diffY);
376  widget->slotSnapToGrid();
377  }
378 
379  // Move any selected associations.
380  foreach(AssociationWidget* aw, m_scene->selectedAssocs()) {
381  if (aw->isSelected()) {
382  aw->moveEntireAssoc(diffX, diffY);
383  }
384  }
385 
386  umlScene()->resizeSceneToItems();
387 }
388 
416 void UMLWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
417 {
418  if (event->button() != Qt::LeftButton) {
419  event->ignore();
420  return;
421  }
422  event->accept();
423  DEBUG(DBG_SRC) << "widget = " << name() << " / type = " << baseTypeStr();
424 
425  toForeground();
426 
427  m_startMovePostion = pos();
428  m_startResizeSize = QSizeF(width(), height());
429 
430  // saving the values of the widget
431  m_pressOffset = event->scenePos() - pos();
432  DEBUG(DBG_SRC) << "press offset=" << m_pressOffset;
433 
434  m_oldStatusBarMsg = UMLApp::app()->statusBarMsg();
435 
436  if (event->modifiers() == Qt::ShiftModifier || event->modifiers() == Qt::ControlModifier) {
437  m_shiftPressed = true;
438 
439  if (event->button() == Qt::LeftButton) {
440  m_inMoveArea = true;
441  }
442 
443  if (!isSelected()) {
444  selectMultiple(event);
445  }
446  return;
447  }
448 
449  m_shiftPressed = false;
450 
451  int count = m_scene->selectedCount(true);
452  if (event->button() == Qt::LeftButton) {
453  if (isSelected() && count > 1) {
454  // single selection is made in release event if the widget wasn't moved
455  m_inMoveArea = true;
456  m_oldPos = pos();
457  return;
458  }
459 
460  if (isInResizeArea(event)) {
461  m_inResizeArea = true;
462  m_oldW = width();
463  m_oldH = height();
464  } else {
465  m_inMoveArea = true;
466  }
467  }
468 
469  // if widget wasn't selected, or it was selected but with other widgets also selected
470  if (!isSelected() || count > 1) {
471  selectSingle(event);
472  }
473 }
474 
498 void UMLWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *me)
499 {
500  if (!m_moved && !m_resized) {
501  if (!m_shiftPressed && (m_scene->selectedCount(true) > 1)) {
502  selectSingle(me);
503  } else if (!isSelected()) {
504  deselect(me);
505  }
506  } else {
507  // Commands
508  if (m_moved) {
509  foreach(UMLWidget* widget, m_selectedWidgetsList) {
510  UMLApp::app()->executeCommand(new Uml::CmdMoveWidget(widget));
511  }
512  m_moved = false;
513  } else {
514  UMLApp::app()->executeCommand(new Uml::CmdResizeWidget(this));
515  m_resized = false;
516  }
517 
518  if ((m_inMoveArea && wasPositionChanged()) ||
519  (m_inResizeArea && wasSizeChanged())) {
520  umlDoc()->setModified(true);
521  }
522 
523  UMLApp::app()->document()->writeToStatusBar(m_oldStatusBarMsg);
524  }
525 
526  if (m_inResizeArea) {
527  m_inResizeArea = false;
528  m_scene->activeView()->setCursor(Qt::ArrowCursor);
529  } else {
530  m_inMoveArea = false;
531  }
532 }
533 
538 void UMLWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
539 {
540  if (event->button() == Qt::LeftButton) {
541  DEBUG(DBG_SRC) << "widget = " << name() << " / type = " << baseTypeStr();
542  switch(baseType()) {
543  case WidgetBase::wt_Message: // will be handled in its class
544  QGraphicsItem::mouseDoubleClickEvent(event);
545  break;
546  default:
547  showPropertiesDialog();
548  event->accept();
549  break;
550  }
551  }
552 }
553 
558 QPointF UMLWidget::startMovePosition() const
559 {
560  return m_startMovePostion;
561 }
562 
567 QSizeF UMLWidget::startResizeSize() const
568 {
569  return m_startResizeSize;
570 }
571 
583 void UMLWidget::resizeWidget(qreal newW, qreal newH)
584 {
585  setSize(newW, newH);
586 }
587 
591 void UMLWidget::updateWidget()
592 {
593  updateGeometry();
594  switch (m_baseType) {
595  case WidgetBase::wt_Class:
596  m_scene->createAutoAttributeAssociations(this);
597  break;
598  case WidgetBase::wt_Entity:
599  m_scene->createAutoConstraintAssociations(this);
600  break;
601  default:
602  break;
603  }
604 
605  if (isVisible())
606  update();
607 }
608 
617 void UMLWidget::constrain(qreal& width, qreal& height)
618 {
619  QSizeF minSize = minimumSize();
620  if (width < minSize.width())
621  width = minSize.width();
622  if (height < minSize.height())
623  height = minSize.height();
624  QSizeF maxSize = maximumSize();
625  if (width > maxSize.width())
626  width = maxSize.width();
627  if (height > maxSize.height())
628  height = maxSize.height();
629 
630  if (fixedAspectRatio()) {
631  QSizeF size = rect().size();
632  float aspectRatio = size.width() > 0 ? (float)size.height()/size.width() : 1;
633  height = width * aspectRatio;
634  }
635 }
636 
640 void UMLWidget::init()
641 {
642  m_nId = Uml::ID::None;
643  m_isInstance = false;
644  setMinimumSize(DefaultMinimumSize);
645  setMaximumSize(DefaultMaximumSize);
646 
647  for (int i = 0; i < (int)FT_INVALID; ++i) {
648  m_pFontMetrics[(UMLWidget::FontType)i] = 0;
649  }
650 
651  if (m_scene) {
652  m_useFillColor = true;
653  m_usesDiagramFillColor = true;
654  m_usesDiagramUseFillColor = true;
655  const Settings::OptionState& optionState = m_scene->optionState();
656  m_fillColor = optionState.uiState.fillColor;
657  m_showStereotype = optionState.classState.showStereoType;
658  } else {
659  uError() << "SERIOUS PROBLEM - m_scene is NULL";
660  m_useFillColor = false;
661  m_usesDiagramFillColor = false;
662  m_usesDiagramUseFillColor = false;
663  m_showStereotype = false;
664  }
665 
666  m_resizable = true;
667  m_fixedAspectRatio = false;
668 
669  m_selected = false;
670  m_startMove = false;
671  m_activated = false;
672  m_ignoreSnapToGrid = false;
673  m_ignoreSnapComponentSizeToGrid = false;
674  m_doc = UMLApp::app()->document();
675  m_nPosX = 0;
676  connect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected()));
677 
678  connect(m_scene, SIGNAL(sigFillColorChanged(Uml::ID::Type)), this, SLOT(slotFillColorChanged(Uml::ID::Type)));
679  connect(m_scene, SIGNAL(sigLineColorChanged(Uml::ID::Type)), this, SLOT(slotLineColorChanged(Uml::ID::Type)));
680  connect(m_scene, SIGNAL(sigTextColorChanged(Uml::ID::Type)), this, SLOT(slotTextColorChanged(Uml::ID::Type)));
681  connect(m_scene, SIGNAL(sigLineWidthChanged(Uml::ID::Type)), this, SLOT(slotLineWidthChanged(Uml::ID::Type)));
682 
683  m_umlObject = 0;
684 
685  m_oldPos = QPointF();
686  m_pressOffset = QPointF();
687  m_oldW = 0;
688  m_oldH = 0;
689 
690  m_shiftPressed = false;
691  m_inMoveArea = false;
692  m_inResizeArea = false;
693  m_moved = false;
694  m_resized = false;
695 
696  setZValue(2.0); // default for most widgets
697 }
698 
707 void UMLWidget::slotMenuSelection(QAction *trigger)
708 {
709  if (!trigger) {
710  return;
711  }
712 
713  ListPopupMenu::MenuType sel = ListPopupMenu::typeFromAction(trigger);
714  switch (sel) {
715  case ListPopupMenu::mt_Delete:
716  umlScene()->removeWidget(this);
717  break;
718 
719  case ListPopupMenu::mt_Resize:
720  umlScene()->resizeSelection();
721  break;
722 
723  default:
724  WidgetBase::slotMenuSelection(trigger);
725  break;
726  }
727 }
728 
735 void UMLWidget::slotWidgetMoved(Uml::ID::Type /*id*/)
736 {
737 }
738 
744 void UMLWidget::slotFillColorChanged(Uml::ID::Type viewID)
745 {
746  //only change if on the diagram concerned
747  if (m_scene->ID() != viewID) {
748  return;
749  }
750  if (m_usesDiagramFillColor) {
751  WidgetBase::setFillColor(m_scene->fillColor());
752  }
753  if (m_usesDiagramUseFillColor) {
754  WidgetBase::setUseFillColor(m_scene->useFillColor());
755  }
756  update();
757 }
758 
764 void UMLWidget::slotTextColorChanged(Uml::ID::Type viewID)
765 {
766  //only change if on the diagram concerned
767  if (m_scene->ID() != viewID)
768  return;
769  WidgetBase::setTextColor(m_scene->textColor());
770  update();
771 }
772 
773 
779 void UMLWidget::slotLineColorChanged(Uml::ID::Type viewID)
780 {
781  //only change if on the diagram concerned
782  if (m_scene->ID() != viewID)
783  return;
784 
785  if (m_usesDiagramLineColor) {
786  WidgetBase::setLineColor(m_scene->lineColor());
787  }
788  update();
789 }
790 
796 void UMLWidget::slotLineWidthChanged(Uml::ID::Type viewID)
797 {
798  //only change if on the diagram concerned
799  if (m_scene->ID() != viewID) {
800  return;
801  }
802  if (m_usesDiagramLineWidth) {
803  WidgetBase::setLineWidth(m_scene->lineWidth());
804  }
805  update();
806 }
807 
813 void UMLWidget::setUseFillColor(bool fc)
814 {
815  WidgetBase::setUseFillColor(fc);
816  update();
817 }
818 
822 void UMLWidget::setTextColorcmd(const QColor &color)
823 {
824  WidgetBase::setTextColor(color);
825  update();
826 }
827 
831 void UMLWidget::setTextColor(const QColor &color)
832 {
833  UMLApp::app()->executeCommand(new CmdChangeTextColor(this, color));
834  update();
835 }
836 
840 void UMLWidget::setLineColorcmd(const QColor &color)
841 {
842  WidgetBase::setLineColor(color);
843  update();
844 }
845 
849 void UMLWidget::setLineColor(const QColor &color)
850 {
851  UMLApp::app()->executeCommand(new CmdChangeLineColor(this, color));
852 }
853 
857 void UMLWidget::setLineWidth(uint width)
858 {
859  WidgetBase::setLineWidth(width);
860  update();
861 }
862 
868 void UMLWidget::setFillColor(const QColor &color)
869 {
870  UMLApp::app()->executeCommand(new CmdChangeFillColor(this, color));
871 }
872 
878 void UMLWidget::setFillColorcmd(const QColor &color)
879 {
880  WidgetBase::setFillColor(color);
881  update();
882 }
883 
890 bool UMLWidget::activate(IDChangeLog* /*ChangeLog = 0 */)
891 {
892  if (widgetHasUMLObject(m_baseType) && m_umlObject == NULL) {
893  m_umlObject = m_doc->findObjectById(m_nId);
894  if (m_umlObject == NULL) {
895  uError() << "cannot find UMLObject with id=" << Uml::ID::toString(m_nId);
896  return false;
897  }
898  }
899  setFont(m_font);
900  setSize(width(), height());
901  m_activated = true;
902  updateGeometry();
903  if (m_scene->getPaste()) {
904  FloatingTextWidget * ft = 0;
905  QPointF point = m_scene->getPastePoint();
906  int x = point.x() + this->x();
907  int y = point.y() + this->y();
908  if (m_scene->type() == Uml::DiagramType::Sequence) {
909  switch (baseType()) {
910  case WidgetBase::wt_Object:
911  case WidgetBase::wt_Precondition :
912  setY(this->y());
913  setX(x);
914  break;
915 
916  case WidgetBase::wt_Message:
917  setY(this->y());
918  setX(x);
919  break;
920 
921  case WidgetBase::wt_Text:
922  ft = static_cast<FloatingTextWidget *>(this);
923  if (ft->textRole() == Uml::TextRole::Seq_Message) {
924  setX(x);
925  setY(this->y());
926  } else {
927  setX(this->x());
928  setY(this->y());
929  }
930  break;
931 
932  default:
933  setY(y);
934  break;
935  }//end switch base type
936  }//end if sequence
937  else {
938  setX(x);
939  setY(y);
940  }
941  }//end if pastepoint
942  else {
943  setX(this->x());
944  setY(this->y());
945  }
946  if (m_scene->getPaste())
947  m_scene->createAutoAssociations(this);
948  updateGeometry();
949  return true;
950 }
951 
957 bool UMLWidget::isActivated() const
958 {
959  return m_activated;
960 }
961 
967 void UMLWidget::setActivated(bool active /*=true*/)
968 {
969  m_activated = active;
970 }
971 
976 void UMLWidget::addAssoc(AssociationWidget* pAssoc)
977 {
978  if (pAssoc && !m_Assocs.contains(pAssoc)) {
979  m_Assocs.append(pAssoc);
980  }
981 }
982 
987 void UMLWidget::removeAssoc(AssociationWidget* pAssoc)
988 {
989  if (pAssoc) {
990  m_Assocs.removeAll(pAssoc);
991  }
992 }
993 
1000 void UMLWidget::adjustAssocs(qreal dx, qreal dy)
1001 {
1002  // don't adjust Assocs on file load, as
1003  // the original positions, which are stored in XMI
1004  // should be reproduced exactly
1005  // (don't try to reposition assocs as long
1006  // as file is only partly loaded -> reposition
1007  // could be misguided)
1009  if (m_doc->loading()) {
1010  // don't recalculate the assocs during load of XMI
1011  // -> return immediately without action
1012  return;
1013  }
1014 
1015  foreach(AssociationWidget* assocwidget, m_Assocs) {
1016  assocwidget->saveIdealTextPositions();
1017  }
1018 
1019  foreach(AssociationWidget* assocwidget, m_Assocs) {
1020  assocwidget->widgetMoved(this, dx, dy);
1021  }
1022 }
1023 
1030 void UMLWidget::adjustUnselectedAssocs(qreal dx, qreal dy)
1031 {
1032  foreach(AssociationWidget* assocwidget, m_Assocs) {
1033  if (!assocwidget->isSelected())
1034  assocwidget->saveIdealTextPositions();
1035  }
1036 
1037  foreach(AssociationWidget* assocwidget, m_Assocs) {
1038  if (!assocwidget->isSelected()) {
1039  assocwidget->widgetMoved(this, dx, dy);
1040  }
1041  }
1042 }
1043 
1047 void UMLWidget::showPropertiesDialog()
1048 {
1049  // will already be selected so make sure docWindow updates the doc
1050  // back it the widget
1051  UMLApp::app()->docWindow()->updateDocumentation(false);
1052  QPointer<ClassPropDlg> dlg = new ClassPropDlg((QWidget*)UMLApp::app(), this);
1053 
1054  if (dlg->exec()) {
1055  UMLApp::app()->docWindow()->showDocumentation(umlObject(), true);
1056  m_doc->setModified(true);
1057  }
1058  dlg->close(); //wipe from memory
1059  delete dlg;
1060 }
1061 
1071 qreal UMLWidget::onWidget(const QPointF &p)
1072 {
1073  const qreal w = width();
1074  const qreal h = height();
1075  const qreal left = x();
1076  const qreal right = left + w;
1077  const qreal top = y();
1078  const qreal bottom = top + h;
1079  if (p.x() < left || p.x() > right ||
1080  p.y() < top || p.y() > bottom) // Qt coord.sys. origin in top left corner
1081  return 0;
1082  return (w + h) / 2;
1083 }
1084 
1089 void UMLWidget::moveByLocal(qreal dx, qreal dy)
1090 {
1091  qreal newX = x() + dx;
1092  qreal newY = y() + dy;
1093  setX(newX);
1094  setY(newY);
1095  adjustAssocs(dx, dy);
1096 }
1097 
1101 void UMLWidget::setPenFromSettings(QPainter & p)
1102 {
1103  p.setPen(QPen(m_lineColor, m_lineWidth));
1104 }
1105 
1109 void UMLWidget::setPenFromSettings(QPainter *p)
1110 {
1111  p->setPen(QPen(m_lineColor, m_lineWidth));
1112 }
1113 
1120 QCursor UMLWidget::resizeCursor() const
1121 {
1122  return Qt::SizeFDiagCursor;
1123 }
1124 
1133 bool UMLWidget::isInResizeArea(QGraphicsSceneMouseEvent *me)
1134 {
1135  qreal m = 10.0;
1136  const qreal w = width();
1137  const qreal h = height();
1138 
1139  // If the widget itself is very small then make the resize area small, too.
1140  // Reason: Else it becomes impossible to do a move instead of resize.
1141  if (w - m < m || h - m < m) {
1142  m = 2.0;
1143  }
1144 
1145  if (m_resizable &&
1146  me->scenePos().x() >= (x() + w - m) &&
1147  me->scenePos().y() >= (y() + h - m)) {
1148  m_scene->activeView()->setCursor(resizeCursor());
1149  return true;
1150  } else {
1151  m_scene->activeView()->setCursor(Qt::ArrowCursor);
1152  return false;
1153  }
1154 }
1155 
1161 QSizeF UMLWidget::calculateSize()
1162 {
1163  return QSizeF(width(), height());
1164 }
1165 
1169 void UMLWidget::resize()
1170 {
1171  qreal oldW = width();
1172  qreal oldH = height();
1173  // @TODO minimumSize() do not work in all cases, we need a dedicated autoResize() method
1174  QSizeF size = minimumSize();
1175  setSize(size.width(), size.height());
1176  DEBUG(DBG_SRC) << "size=" << size;
1177  adjustAssocs(size.width()-oldW, size.height()-oldH);
1178 }
1179 
1188 void UMLWidget::resize(QGraphicsSceneMouseEvent *me)
1189 {
1190  // TODO the status message lies for at least MessageWidget which could only be resized vertical
1191  UMLApp::app()->document()->writeToStatusBar(i18n("Hold shift or ctrl to move in X axis. Hold shift and control to move in Y axis. Right button click to cancel resize."));
1192 
1193  m_resized = true;
1194 
1195  qreal newW = m_oldW + me->scenePos().x() - x() - m_pressOffset.x();
1196  qreal newH = m_oldH + me->scenePos().y() - y() - m_pressOffset.y();
1197 
1198  if ((me->modifiers() & Qt::ShiftModifier) && (me->modifiers() & Qt::ControlModifier)) {
1199  //Move in Y axis
1200  newW = m_oldW;
1201  } else if ((me->modifiers() & Qt::ShiftModifier) || (me->modifiers() & Qt::ControlModifier)) {
1202  //Move in X axis
1203  newH = m_oldH;
1204  }
1205 
1206  constrain(newW, newH);
1207  resizeWidget(newW, newH);
1208  DEBUG(DBG_SRC) << "event=" << me->scenePos() << "/ pos=" << pos() << " / newW=" << newW << " / newH=" << newH;
1209  QPointF delta = me->scenePos() - me->lastScenePos();
1210  adjustAssocs(delta.x(), delta.y());
1211 
1212  m_scene->resizeSceneToItems();
1213 }
1214 
1221 bool UMLWidget::wasSizeChanged()
1222 {
1223  return m_oldW != width() || m_oldH != height();
1224 }
1225 
1232 bool UMLWidget::wasPositionChanged()
1233 {
1234  return m_oldPos != pos();
1235 }
1236 
1240 void UMLWidget::setSelectionBounds()
1241 {
1242  if (m_scene->selectedCount() > 0) {
1243  m_selectedWidgetsList.clear();
1244  m_selectedWidgetsList = m_scene->selectedWidgetsExt(false);
1245  }
1246 }
1247 
1253 void UMLWidget::setSelected(bool _select)
1254 {
1255  const WidgetBase::WidgetType wt = m_baseType;
1256  if (_select) {
1257  if (m_scene->selectedCount() == 0) {
1258  if (widgetHasUMLObject(wt)) {
1259  UMLApp::app()->docWindow()->showDocumentation(m_umlObject, false);
1260  } else {
1261  UMLApp::app()->docWindow()->showDocumentation(this, false);
1262  }
1263  }//end if
1264  /* if (wt != wt_Text && wt != wt_Box) {
1265  setZ(9);//keep text on top and boxes behind so don't touch Z value
1266  } */
1267  } else {
1268  /* if (wt != wt_Text && wt != wt_Box) {
1269  setZ(m_origZ);
1270  } */
1271  if (m_selected)
1272  UMLApp::app()->docWindow()->updateDocumentation(true);
1273  }
1274  m_selected = _select;
1275 
1276  const QPoint pos(x(), y());
1277  UMLWidget *bkgnd = m_scene->widgetAt(pos);
1278  if (bkgnd && bkgnd != this && _select) {
1279  DEBUG(DBG_SRC) << "setting Z to " << bkgnd->zValue() + 1.0 << ", SelectState: " << _select;
1280  setZValue(bkgnd->zValue() + 1.0);
1281  }
1282 
1283  update();
1284 
1285  // selection changed, we have to make sure the copy and paste items
1286  // are correctly enabled/disabled
1287  UMLApp::app()->slotCopyChanged();
1288 }
1289 
1293 void UMLWidget::slotClearAllSelected()
1294 {
1295  setSelected(false);
1296 }
1297 
1303 void UMLWidget::selectSingle(QGraphicsSceneMouseEvent *me)
1304 {
1305  m_scene->clearSelected();
1306 
1307  // Adds the widget to the selected widgets list, but as it has been cleared
1308  // only the current widget is selected.
1309  selectMultiple(me);
1310 }
1311 
1317 void UMLWidget::selectMultiple(QGraphicsSceneMouseEvent *me)
1318 {
1319  setSelected(true);
1320  m_scene->setSelected(this, me);
1321 }
1322 
1328 void UMLWidget::deselect(QGraphicsSceneMouseEvent *me)
1329 {
1330  setSelected(false);
1331  m_scene->setSelected(this, me);
1332 }
1333 
1337 //void UMLWidget::resetSelection()
1338 //{
1339 // m_scene->clearSelected();
1340 // m_scene->resetToolbar();
1341 // setSelected(false);
1342 //}
1343 
1349 void UMLWidget::setScene(UMLScene *scene)
1350 {
1351  //remove signals from old view - was probably 0 anyway
1352  disconnect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected()));
1353  disconnect(m_scene, SIGNAL(sigFillColorChanged(Uml::ID::Type)), this, SLOT(slotFillColorChanged(Uml::ID::Type)));
1354  disconnect(m_scene, SIGNAL(sigTextColorChanged(Uml::ID::Type)), this, SLOT(slotTextColorChanged(Uml::ID::Type)));
1355  disconnect(m_scene, SIGNAL(sigLineWidthChanged(Uml::ID::Type)), this, SLOT(slotLineWidthChanged(Uml::ID::Type)));
1356  m_scene = scene;
1357  connect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected()));
1358  connect(m_scene, SIGNAL(sigFillColorChanged(Uml::ID::Type)), this, SLOT(slotFillColorChanged(Uml::ID::Type)));
1359  connect(m_scene, SIGNAL(sigTextColorChanged(Uml::ID::Type)), this, SLOT(slotTextColorChanged(Uml::ID::Type)));
1360  connect(m_scene, SIGNAL(sigLineWidthChanged(Uml::ID::Type)), this, SLOT(slotLineWidthChanged(Uml::ID::Type)));
1361 }
1362 
1370 void UMLWidget::setX(qreal x)
1371 {
1372  QGraphicsObject::setX(x);
1373 }
1374 
1382 void UMLWidget::setY(qreal y)
1383 {
1384  QGraphicsObject::setY(y);
1385 }
1386 
1391 void UMLWidget::cleanup()
1392 {
1393 }
1394 
1399 void UMLWidget::slotSnapToGrid()
1400 {
1401  if (!m_ignoreSnapToGrid) {
1402  qreal newX = m_scene->snappedX(x());
1403  setX(newX);
1404  qreal newY = m_scene->snappedX(y());
1405  setY(newY);
1406  }
1407 }
1408 
1412 bool UMLWidget::widgetHasUMLObject(WidgetBase::WidgetType type)
1413 {
1414  if (type == WidgetBase::wt_Actor ||
1415  type == WidgetBase::wt_UseCase ||
1416  type == WidgetBase::wt_Class ||
1417  type == WidgetBase::wt_Interface ||
1418  type == WidgetBase::wt_Enum ||
1419  type == WidgetBase::wt_Datatype ||
1420  type == WidgetBase::wt_Package ||
1421  type == WidgetBase::wt_Component ||
1422  type == WidgetBase::wt_Node ||
1423  type == WidgetBase::wt_Artifact ||
1424  type == WidgetBase::wt_Object) {
1425  return true;
1426  } else {
1427  return false;
1428  }
1429 }
1430 
1434 void UMLWidget::setIgnoreSnapToGrid(bool to)
1435 {
1436  m_ignoreSnapToGrid = to;
1437 }
1438 
1442 bool UMLWidget::getIgnoreSnapToGrid() const
1443 {
1444  return m_ignoreSnapToGrid;
1445 }
1446 
1452 void UMLWidget::setSize(qreal width, qreal height)
1453 {
1454  // snap to the next larger size that is a multiple of the grid
1455  if (!m_ignoreSnapComponentSizeToGrid
1456  && m_scene->snapComponentSizeToGrid()) {
1457  // integer divisions
1458  int numX = width / m_scene->snapX();
1459  int numY = height / m_scene->snapY();
1460  // snap to the next larger valid value
1461  if (width > numX * m_scene->snapX())
1462  width = (numX + 1) * m_scene->snapX();
1463  if (height > numY * m_scene->snapY())
1464  height = (numY + 1) * m_scene->snapY();
1465  }
1466 
1467  setRect(rect().x(), rect().y(), width, height);
1468 }
1469 
1473 void UMLWidget::setSize(const QSizeF& size)
1474 {
1475  setSize(size.width(), size.height());
1476 }
1477 
1481 void UMLWidget::updateGeometry()
1482 {
1483  if (m_doc->loading()) {
1484  return;
1485  }
1486  qreal oldW = width();
1487  qreal oldH = height();
1488  QSizeF size = calculateSize();
1489  qreal clipWidth = size.width();
1490  qreal clipHeight = size.height();
1491  constrain(clipWidth, clipHeight);
1492  setSize(clipWidth, clipHeight);
1493  slotSnapToGrid();
1494  adjustAssocs(size.width()-oldW, size.height()-oldH);
1495 }
1496 
1501 void UMLWidget::clipSize()
1502 {
1503  qreal clipWidth = width();
1504  qreal clipHeight = height();
1505  constrain(clipWidth, clipHeight);
1506  setSize(clipWidth, clipHeight);
1507 }
1508 
1512 void UMLWidget::setDefaultFontMetrics(UMLWidget::FontType fontType)
1513 {
1514  setupFontType(m_font, fontType);
1515  setFontMetrics(fontType, QFontMetrics(m_font));
1516 }
1517 
1518 void UMLWidget::setupFontType(QFont &font, UMLWidget::FontType fontType)
1519 {
1520  switch (fontType) {
1521  case FT_NORMAL:
1522  font.setBold(false);
1523  font.setItalic(false);
1524  font.setUnderline(false);
1525  break;
1526  case FT_BOLD:
1527  font.setBold(true);
1528  font.setItalic(false);
1529  font.setUnderline(false);
1530  break;
1531  case FT_ITALIC:
1532  font.setBold(false);
1533  font.setItalic(true);
1534  font.setUnderline(false);
1535  break;
1536  case FT_UNDERLINE:
1537  font.setBold(false);
1538  font.setItalic(false);
1539  font.setUnderline(true);
1540  break;
1541  case FT_BOLD_ITALIC:
1542  font.setBold(true);
1543  font.setItalic(true);
1544  font.setUnderline(false);
1545  break;
1546  case FT_BOLD_UNDERLINE:
1547  font.setBold(true);
1548  font.setItalic(false);
1549  font.setUnderline(true);
1550  break;
1551  case FT_ITALIC_UNDERLINE:
1552  font.setBold(false);
1553  font.setItalic(true);
1554  font.setUnderline(true);
1555  break;
1556  case FT_BOLD_ITALIC_UNDERLINE:
1557  font.setBold(true);
1558  font.setItalic(true);
1559  font.setUnderline(true);
1560  break;
1561  default: return;
1562  }
1563 }
1564 
1565 void UMLWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
1566 {
1567  Q_UNUSED(option);
1568  Q_UNUSED(widget);
1569 
1570  if (m_selected) {
1571  const qreal w = width();
1572  const qreal h = height();
1573  const qreal s = 4;
1574  QBrush brush(Qt::blue);
1575  painter->fillRect(0, 0, s, s, brush);
1576  painter->fillRect(0, 0 + h - s, s, s, brush);
1577  painter->fillRect(0 + w - s, 0, s, s, brush);
1578 
1579  // Draw the resize anchor in the lower right corner.
1580  // Don't draw it if the widget is so small that the
1581  // resize anchor would cover up most of the widget.
1582  if (m_resizable && w * h > (s*3) * (s*3)) {
1583  brush.setColor(Qt::red);
1584  const int right = 0 + w;
1585  const int bottom = 0 + h;
1586  painter->drawLine(right - s, 0 + h - 1, 0 + w - 1, 0 + h - s);
1587  painter->drawLine(right - (s*2), bottom - 1, right - 1, bottom - (s*2));
1588  painter->drawLine(right - (s*3), bottom - 1, right - 1, bottom - (s*3));
1589  } else {
1590  painter->fillRect(0 + w - s, 0 + h - s, s, s, brush);
1591  }
1592  }
1593 
1594  if (umlScene()->isShowDocumentationIndicator() && hasDocumentation()) {
1595  const qreal h = height();
1596  const qreal d = 8;
1597  QPolygonF p;
1598  p << QPointF(0, h - d) << QPointF(d, h) << QPointF(0, h);
1599  painter->setPen(Qt::blue);
1600  painter->setBrush(Qt::red);
1601  painter->drawPolygon(p);
1602  }
1603 }
1604 
1608 void UMLWidget::setDefaultFontMetrics(UMLWidget::FontType fontType, QPainter &painter)
1609 {
1610  setupFontType(m_font, fontType);
1611  painter.setFont(m_font);
1612  setFontMetrics(fontType, painter.fontMetrics());
1613 }
1614 
1619 QFontMetrics &UMLWidget::getFontMetrics(UMLWidget::FontType fontType)
1620 {
1621  if (m_pFontMetrics[fontType] == 0) {
1622  setDefaultFontMetrics(fontType);
1623  }
1624  return *m_pFontMetrics[fontType];
1625 }
1626 
1630 void UMLWidget::setFontMetrics(UMLWidget::FontType fontType, QFontMetrics fm)
1631 {
1632  delete m_pFontMetrics[fontType];
1633  m_pFontMetrics[fontType] = new QFontMetrics(fm);
1634 }
1635 
1641 void UMLWidget::setFont(const QFont &font)
1642 {
1643  WidgetBase::setFont(font);
1644  forceUpdateFontMetrics(0);
1645  if (m_doc->loading())
1646  return;
1647  update();
1648 }
1649 
1657 void UMLWidget::forceUpdateFontMetrics(QPainter *painter)
1658 {
1659  if (painter == 0) {
1660  for (int i = 0; i < (int)UMLWidget::FT_INVALID; ++i) {
1661  if (m_pFontMetrics[(UMLWidget::FontType)i] != 0)
1662  setDefaultFontMetrics((UMLWidget::FontType)i);
1663  }
1664  } else {
1665  for (int i2 = 0; i2 < (int)UMLWidget::FT_INVALID; ++i2) {
1666  if (m_pFontMetrics[(UMLWidget::FontType)i2] != 0)
1667  setDefaultFontMetrics((UMLWidget::FontType)i2, *painter);
1668  }
1669  }
1670  if (m_doc->loading())
1671  return;
1672  // calculate the size, based on the new font metric
1673  updateGeometry();
1674 }
1675 
1681 void UMLWidget::setShowStereotype(bool flag)
1682 {
1683  m_showStereotype = flag;
1684  updateGeometry();
1685  update();
1686 }
1687 
1693 bool UMLWidget::showStereotype() const
1694 {
1695  return m_showStereotype;
1696 }
1697 
1703 void UMLWidget::moveEvent(QGraphicsSceneMouseEvent* /*me*/)
1704 {
1705 }
1706 
1707 void UMLWidget::saveToXMI(QDomDocument & qDoc, QDomElement & qElement)
1708 {
1709  /*
1710  Call after required actions in child class.
1711  Type must be set in the child class.
1712  */
1713  WidgetBase::saveToXMI(qDoc, qElement);
1714  qElement.setAttribute("xmi.id", Uml::ID::toString(id()));
1715  qElement.setAttribute("x", x());
1716  qElement.setAttribute("y", y());
1717  qElement.setAttribute("width", width());
1718  qElement.setAttribute("height", height());
1719  qElement.setAttribute("isinstance", m_isInstance);
1720  if (!m_instanceName.isEmpty())
1721  qElement.setAttribute("instancename", m_instanceName);
1722  if (m_showStereotype)
1723  qElement.setAttribute("showstereotype", m_showStereotype);
1724 }
1725 
1726 bool UMLWidget::loadFromXMI(QDomElement & qElement)
1727 {
1728  QString id = qElement.attribute("xmi.id", "-1");
1729  m_nId = Uml::ID::fromString(id);
1730 
1731  WidgetBase::loadFromXMI(qElement);
1732  QString x = qElement.attribute("x", "0");
1733  QString y = qElement.attribute("y", "0");
1734  QString h = qElement.attribute("height", "0");
1735  QString w = qElement.attribute("width", "0");
1736 
1737  setSize(w.toFloat(), h.toFloat());
1738  setX(x.toFloat());
1739  setY(y.toFloat());
1740  QString isinstance = qElement.attribute("isinstance", "0");
1741  m_isInstance = (bool)isinstance.toInt();
1742  m_instanceName = qElement.attribute("instancename", "");
1743  QString showstereo = qElement.attribute("showstereotype", "0");
1744  m_showStereotype = (bool)showstereo.toInt();
1745  return true;
1746 }
1747 
1748 #include "umlwidget.moc"
UMLWidget::setScene
void setScene(UMLScene *scene)
Clears the selection, resets the toolbar and deselects the widget.
Definition: umlwidget.cpp:1349
UMLWidget::FT_UNDERLINE
Definition: umlwidget.h:223
UMLApp::slotCopyChanged
void slotCopyChanged()
Slot for enabling cut and copy to clipboard.
Definition: uml.cpp:1773
UMLWidget::selectMultiple
void selectMultiple(QGraphicsSceneMouseEvent *me)
Selects the widget and adds it to the list of selected widgets.
Definition: umlwidget.cpp:1317
umlobject.h
UMLWidget::widgetHasUMLObject
static bool widgetHasUMLObject(WidgetBase::WidgetType type)
Returns whether the widget type has an associated UMLObject.
Definition: umlwidget.cpp:1412
UMLWidget::resizeCursor
virtual QCursor resizeCursor() const
Returns the cursor to be shown when resizing the widget.
Definition: umlwidget.cpp:1120
UniqueID::init
void init()
Reinitialize the unique ID counter.
Definition: uniqueid.cpp:37
UMLWidget::m_inMoveArea
bool m_inMoveArea
If cursor was in move/resize area when left button was pressed (and no other widgets were selected)...
Definition: umlwidget.h:346
UMLScene::useFillColor
bool useFillColor() const
Returns whether to use the fill/background color.
Definition: umlscene.cpp:1203
WidgetBase::m_usesDiagramLineWidth
bool m_usesDiagramLineWidth
Definition: widgetbase.h:184
WidgetBase::wt_Precondition
Definition: widgetbase.h:64
UMLWidget::slotTextColorChanged
virtual void slotTextColorChanged(Uml::ID::Type viewID)
Captures a text color change signal.
Definition: umlwidget.cpp:764
WidgetBase::wt_Package
Definition: widgetbase.h:51
UMLWidget::m_resized
bool m_resized
Definition: umlwidget.h:353
UMLWidget::m_pressOffset
QPointF m_pressOffset
The X/Y offset from the position of the cursor when it was pressed to the upper left corner of the wi...
Definition: umlwidget.h:331
UMLWidget::slotLineColorChanged
virtual void slotLineColorChanged(Uml::ID::Type viewID)
Captures a line color change signal.
Definition: umlwidget.cpp:779
UMLWidget::m_resizable
bool m_resizable
Definition: umlwidget.h:302
UMLScene::selectedCount
int selectedCount(bool filterText=false) const
Return the amount of widgets selected.
Definition: umlscene.cpp:1831
UMLWidget::setIgnoreSnapToGrid
void setIgnoreSnapToGrid(bool to)
Set m_ignoreSnapToGrid.
Definition: umlwidget.cpp:1434
UMLScene::resizeSceneToItems
void resizeSceneToItems()
Sets the size of the scene to just fit on all the items.
Definition: umlscene.cpp:3700
UniqueID::gen
Uml::ID::Type gen()
MAIN FUNCTION: Return a new unique ID.
Definition: uniqueid.cpp:26
UMLScene::snappedX
qreal snappedX(qreal x)
Returns the input coordinate with possible grid-snap applied.
Definition: umlscene.cpp:3605
WidgetBase::umlObject
UMLObject * umlObject() const
Returns the UMLObject set to represent.
Definition: widgetbase.cpp:113
UMLWidget::mouseMoveEvent
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse move event.
Definition: umlwidget.cpp:334
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1565
UMLScene::lineWidth
uint lineWidth() const
Returns the line width to use.
Definition: umlscene.cpp:342
UMLWidget::fixedAspectRatio
bool fixedAspectRatio() const
Definition: umlwidget.h:211
UMLWidget::DefaultMinimumSize
static const QSizeF DefaultMinimumSize
Definition: umlwidget.h:47
Settings::optionState
OptionState & optionState()
Definition: optionstate.cpp:25
WidgetBase::wt_Datatype
Definition: widgetbase.h:48
UMLScene::createAutoAttributeAssociations
void createAutoAttributeAssociations(UMLWidget *widget)
If the m_Type of the given widget is WidgetBase::wt_Class then iterate through the class' attributes ...
Definition: umlscene.cpp:2624
WidgetBase::wt_Actor
Definition: widgetbase.h:44
idchangelog.h
WidgetBase::umlDoc
UMLDoc * umlDoc() const
This is shortcut method for UMLApp::app()->document().
Definition: widgetbase.cpp:103
UMLWidget::constrain
virtual void constrain(qreal &width, qreal &height)
Apply possible constraints to the given candidate width and height.
Definition: umlwidget.cpp:617
UMLScene::fillColor
const QColor & fillColor() const
Returns the fill color to use.
Definition: umlscene.cpp:304
UMLWidget::wasSizeChanged
bool wasSizeChanged()
Checks if the size of the widget changed respect to the size that it had when press event was fired...
Definition: umlwidget.cpp:1221
UMLWidget::mouseReleaseEvent
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse release event.
Definition: umlwidget.cpp:498
umlview.h
UMLWidget::showPropertiesDialog
virtual void showPropertiesDialog()
Show a properties dialog for a UMLWidget.
Definition: umlwidget.cpp:1047
DocWindow::showDocumentation
void showDocumentation(UMLObject *object, bool overwrite=false)
Called when a widget wishes to display its documentation in the doc window.
Definition: docwindow.cpp:87
FloatingTextWidget::textRole
Uml::TextRole::Enum textRole() const
Return the role of the text widget.
Definition: floatingtextwidget.cpp:364
UMLWidget::m_fixedAspectRatio
bool m_fixedAspectRatio
Definition: umlwidget.h:315
UMLWidget::setTextColorcmd
void setTextColorcmd(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:822
UMLWidget::minimumSize
virtual QSizeF minimumSize()
Compute the minimum possible width and height.
Definition: umlwidget.cpp:185
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:35
Uml::CmdChangeTextColor
Definition: cmd_changeTextColor.h:21
IDChangeLog
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
umlscene.h
QGraphicsItem
UMLWidget::m_minimumSize
QSizeF m_minimumSize
Definition: umlwidget.h:304
UMLWidget::DefaultMaximumSize
static const QSizeF DefaultMaximumSize
Definition: umlwidget.h:48
Uml::CmdMoveWidget
Definition: cmd_moveWidget.h:21
UMLDoc::writeToStatusBar
void writeToStatusBar(const QString &text)
Write text to the status bar.
Definition: umldoc.cpp:946
WidgetBase::m_usesDiagramUseFillColor
bool m_usesDiagramUseFillColor
Definition: widgetbase.h:183
WidgetBase::m_lineWidth
uint m_lineWidth
Width of the lines of the widget. Is saved to XMI.
Definition: widgetbase.h:172
WidgetBase::umlScene
UMLScene * umlScene() const
Deliver a pointer to the connected UMLView (needed esp.
Definition: widgetbase.cpp:93
QWidget
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu types.
Definition: listpopupmenu.h:47
UMLWidget::FT_NORMAL
Definition: umlwidget.h:220
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
UMLWidget::setSelectionBounds
void setSelectionBounds()
Fills m_selectedWidgetsList and sets the selection bounds ((m_min/m_max)X/Y attributes).
Definition: umlwidget.cpp:1240
WidgetBase::m_font
QFont m_font
Definition: widgetbase.h:171
UMLWidget::slotLineWidthChanged
virtual void slotLineWidthChanged(Uml::ID::Type viewID)
Captures a linewidth change signal.
Definition: umlwidget.cpp:796
UMLWidget::setSelected
virtual void setSelected(bool _select)
Sets the state of whether the widget is selected.
Definition: umlwidget.cpp:1253
UMLWidget::calculateSize
virtual QSizeF calculateSize()
calculate content related size of widget.
Definition: umlwidget.cpp:1161
UMLWidget::setSize
void setSize(qreal width, qreal height)
Sets the size.
Definition: umlwidget.cpp:1452
DocWindow::updateDocumentation
void updateDocumentation(bool clear=false, bool startup=false)
Call when you wish move changes in the doc window back into the members documentation.
Definition: docwindow.cpp:205
WidgetBase::contextMenuEvent
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Reimplemented to show appropriate context menu.
Definition: widgetbase.cpp:651
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType)
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition: umlwidget.cpp:1619
UMLWidget::moveByLocal
void moveByLocal(qreal dx, qreal dy)
Move the widget by an X and Y offset relative to the current position.
Definition: umlwidget.cpp:1089
UMLWidget::m_ignoreSnapComponentSizeToGrid
bool m_ignoreSnapComponentSizeToGrid
Definition: umlwidget.h:314
WidgetBase::saveToXMI
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
A virtual method to save the properties of this widget into a QDomElement i.e xml.
Definition: widgetbase.cpp:467
UMLWidget::height
qreal height() const
Returns the height of widget.
Definition: umlwidget.h:122
UMLWidget::UMLWidget
UMLWidget(UMLScene *scene, WidgetType type=wt_UMLWidget, UMLObject *o=0)
Creates a UMLWidget object.
Definition: umlwidget.cpp:55
UMLScene::optionState
const Settings::OptionState & optionState() const
Returns the options being used.
Definition: umlscene.cpp:400
WidgetBase::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
A virtual method to load the properties of this widget from a QDomElement into this widget...
Definition: widgetbase.cpp:507
UMLWidget::FT_ITALIC_UNDERLINE
Definition: umlwidget.h:226
UMLWidget::isSelected
bool isSelected() const
Returns the state of whether the widget is selected.
Definition: umlwidget.h:87
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:41
WidgetBase::wt_Interface
Definition: widgetbase.h:47
UMLScene::textColor
const QColor & textColor() const
Returns the text color to use.
Definition: umlscene.cpp:361
ClassPropDlg
Definition: classpropdlg.h:34
UMLWidget::setLineColorcmd
void setLineColorcmd(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:840
AssociationWidgetListIt
QListIterator< AssociationWidget * > AssociationWidgetListIt
Definition: associationwidgetlist.h:21
classifier.h
WidgetBase::id
Uml::ID::Type id() const
Read property of m_nId.
Definition: widgetbase.cpp:145
UMLApp::document
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:872
WidgetBase::m_baseType
WidgetType m_baseType
Type of widget.
Definition: widgetbase.h:153
UMLWidget::m_inResizeArea
bool m_inResizeArea
Definition: umlwidget.h:346
UMLWidget::m_nPosX
int m_nPosX
Definition: umlwidget.h:300
WidgetBase::name
QString name() const
Gets the name from the corresponding UMLObject if this widget has an underlying UMLObject; if it does...
Definition: widgetbase.cpp:197
UMLWidget::m_selected
bool m_selected
Definition: umlwidget.h:297
UMLWidget::m_oldH
qreal m_oldH
Definition: umlwidget.h:337
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:103
WidgetBase::wt_Component
Definition: widgetbase.h:59
debug_utils.h
UMLWidget::wasPositionChanged
bool wasPositionChanged()
Checks if the position of the widget changed respect to the position that it had when press event was...
Definition: umlwidget.cpp:1232
WidgetBase::setFillColor
virtual void setFillColor(const QColor &color)
Sets the fill color.
Definition: widgetbase.cpp:275
Settings::OptionState
Definition: optionstate.h:141
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMe...
Definition: umlwidget.cpp:707
UMLWidget::m_oldPos
QPointF m_oldPos
The X/Y position the widget had when the movement started.
Definition: umlwidget.h:334
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
AssociationWidget
This class represents an association inside a diagram.
Definition: associationwidget.h:50
WidgetBase::m_umlObject
UMLObject * m_umlObject
Definition: widgetbase.h:155
UMLDoc::loading
bool loading() const
Returns true when loading a document file.
Definition: umldoc.cpp:1241
WidgetBase::setLineColor
virtual void setLineColor(const QColor &color)
Sets the line color.
Definition: widgetbase.cpp:254
Settings::UIState::fillColor
QColor fillColor
Definition: optionstate.h:52
UMLScene::snapX
int snapX() const
Returns the x grid size.
Definition: umlscene.cpp:3581
docwindow.h
Uml::TextRole::Seq_Message
Definition: basictypes.h:155
Uml::CmdChangeLineColor
Definition: cmd_changeLineColor.h:21
UMLWidget::resize
void resize()
Resize widget to minimum size.
Definition: umlwidget.cpp:1169
UMLScene::type
Uml::DiagramType::Enum type() const
Returns the type of the diagram.
Definition: umlscene.cpp:256
Uml::DiagramType::Sequence
Definition: basictypes.h:79
WidgetBase::m_usesDiagramFillColor
bool m_usesDiagramFillColor
Definition: widgetbase.h:182
UMLWidget::isActivated
bool isActivated() const
Returns true if the Activate method has been called for this instance.
Definition: umlwidget.cpp:957
UMLScene::snapComponentSizeToGrid
bool snapComponentSizeToGrid() const
Return whether to use snap to grid for component size.
Definition: umlscene.cpp:3563
UMLScene::selectedAssocs
AssociationWidgetList selectedAssocs()
Returns a list with all the selected associations from the diagram.
Definition: umlscene.cpp:1875
UMLWidget::m_doc
UMLDoc * m_doc
shortcut for UMLApp::app()->getDocument()
Definition: umlwidget.h:301
UMLWidget::m_activated
bool m_activated
true if the activate function has been called for this class instance
Definition: umlwidget.h:308
UMLApp::docWindow
DocWindow * docWindow() const
Returns the doc window used.
Definition: uml.cpp:1673
listpopupmenu.h
WidgetBase::m_fillColor
QColor m_fillColor
color of the background of the widget
Definition: widgetbase.h:169
UMLScene::setSelected
void setSelected(UMLWidget *w, QGraphicsSceneMouseEvent *me)
Sets a widget to a selected state and adds it to a list of selected widgets.
Definition: umlscene.cpp:1262
UMLWidget::updateWidget
virtual void updateWidget()
When a widget changes this slot captures that signal.
Definition: umlwidget.cpp:591
WidgetBase::wt_Enum
Definition: widgetbase.h:49
UMLWidget::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Event handler for mouse double click events.
Definition: umlwidget.cpp:538
UMLWidget::forceUpdateFontMetrics
void forceUpdateFontMetrics(QPainter *painter)
Definition: umlwidget.cpp:1657
UMLWidget::setTextColor
virtual void setTextColor(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:831
UMLWidget::contextMenuEvent
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Event handler for context menu events.
Definition: umlwidget.cpp:225
WidgetBase::wt_Class
Definition: widgetbase.h:46
UMLWidget::setFillColor
virtual void setFillColor(const QColor &color)
Sets the background fill color.
Definition: umlwidget.cpp:868
UMLApp::executeCommand
void executeCommand(QUndoCommand *cmd)
Execute a command and pushit in the stack.
Definition: uml.cpp:3077
ListPopupMenu::mt_Delete
Definition: listpopupmenu.h:158
UMLWidget::m_startMovePostion
QPointF m_startMovePostion
Definition: umlwidget.h:298
UMLWidget::m_shiftPressed
bool m_shiftPressed
If shift or control button were pressed in mouse press event.
Definition: umlwidget.h:340
UMLWidget::m_startResizeSize
QSizeF m_startResizeSize
Definition: umlwidget.h:299
WidgetBase::setLineWidth
virtual void setLineWidth(uint width)
Sets the line width.
Definition: widgetbase.cpp:296
umlwidget.h
UMLScene::selectedWidgetsExt
UMLWidgetList selectedWidgetsExt(bool filterText=true)
Fills the List with all the selected widgets from the diagram The list can be filled with all the sel...
Definition: umlscene.cpp:1856
UMLWidget::selectSingle
void selectSingle(QGraphicsSceneMouseEvent *me)
Selects the widget and clears the other selected widgets, if any.
Definition: umlwidget.cpp:1303
UMLScene::resizeSelection
void resizeSelection()
resize selected widgets
Definition: umlscene.cpp:1484
UMLWidget::activate
virtual bool activate(IDChangeLog *ChangeLog=0)
Activate the object after serializing it from a QDataStream.
Definition: umlwidget.cpp:890
AssociationWidget::moveEntireAssoc
void moveEntireAssoc(qreal x, qreal y)
Moves the entire association by the given offset.
Definition: associationwidget.cpp:3822
UMLWidget::m_pFontMetrics
QFontMetrics * m_pFontMetrics[FT_INVALID]
Definition: umlwidget.h:303
WidgetBase::slotMenuSelection
virtual void slotMenuSelection(QAction *trigger)
This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMe...
Definition: widgetbase.cpp:724
UMLScene::widgetAt
UMLWidget * widgetAt(const QPointF &p)
Tests the given point against all widgets and returns the widget for which the point is within its bo...
Definition: umlscene.cpp:968
WidgetBase::setUseFillColor
void setUseFillColor(bool state)
Set state if fill color is used.
Definition: widgetbase.cpp:317
Settings::ClassState::showStereoType
bool showStereoType
Definition: optionstate.h:65
UMLWidget::setActivated
void setActivated(bool active=true)
Set the m_activated flag of a widget but does not perform the Activate method.
Definition: umlwidget.cpp:967
UMLWidget::m_selectedWidgetsList
UMLWidgetList m_selectedWidgetsList
A list containing the selected widgets.
Definition: umlwidget.h:324
WidgetBase::m_usesDiagramLineColor
bool m_usesDiagramLineColor
Definition: widgetbase.h:181
UMLWidget::FT_ITALIC
Definition: umlwidget.h:222
settingsdlg.h
UMLWidget::setFontMetrics
void setFontMetrics(UMLWidget::FontType fontType, QFontMetrics fm)
Set the font metric to use.
Definition: umlwidget.cpp:1630
WidgetBase::wt_Text
Definition: widgetbase.h:56
UMLWidget::isInResizeArea
virtual bool isInResizeArea(QGraphicsSceneMouseEvent *me)
Checks if the mouse is in resize area (right bottom corner), and sets the cursor depending on that...
Definition: umlwidget.cpp:1133
UMLWidget::moveEvent
virtual void moveEvent(QGraphicsSceneMouseEvent *event)
Overrides the standard operation.
Definition: umlwidget.cpp:1703
UMLWidget::startMovePosition
QPointF startMovePosition() const
Return the start position of the move action.
Definition: umlwidget.cpp:558
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:101
Uml::CmdResizeWidget
Definition: cmd_resizeWidget.h:21
UMLWidget::m_showStereotype
bool m_showStereotype
should the stereotype be displayed
Definition: umlwidget.h:293
UMLWidget::m_oldW
qreal m_oldW
The width/height the widget had when the resize started.
Definition: umlwidget.h:337
UMLWidget::setMaximumSize
void setMaximumSize(const QSizeF &size)
This method is used to set the maximum size variable for this widget.
Definition: umlwidget.cpp:217
UMLWidget::m_ignoreSnapToGrid
bool m_ignoreSnapToGrid
Change Widget Behaviour.
Definition: umlwidget.h:313
UMLWidget::setDefaultFontMetrics
virtual void setDefaultFontMetrics(UMLWidget::FontType fontType)
Template Method, override this to set the default font metric.
Definition: umlwidget.cpp:1512
WidgetBase::wt_Artifact
Definition: widgetbase.h:60
UMLWidget::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
A virtual method to load the properties of this widget from a QDomElement into this widget...
Definition: umlwidget.cpp:1726
UMLWidget::setLineWidth
virtual void setLineWidth(uint width)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:857
WidgetBase::rect
QRectF rect() const
return drawing rectangle of widget in local coordinates
Definition: widgetbase.cpp:600
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
UMLWidget::m_startMove
bool m_startMove
Definition: umlwidget.h:297
UMLWidget::slotFillColorChanged
virtual void slotFillColorChanged(Uml::ID::Type viewID)
Captures a color change signal.
Definition: umlwidget.cpp:744
UMLWidget::FT_INVALID
Definition: umlwidget.h:228
Settings::OptionState::uiState
UIState uiState
Definition: optionstate.h:143
UMLWidget::cleanup
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1391
UMLWidget::getIgnoreSnapToGrid
bool getIgnoreSnapToGrid() const
Return the value of m_ignoreSnapToGrid.
Definition: umlwidget.cpp:1442
UMLWidget::slotClearAllSelected
void slotClearAllSelected()
Captures a sigClearAllSelected signal sent by UMLView.
Definition: umlwidget.cpp:1293
Uml::ID::Type
std::string Type
Definition: basictypes.h:317
UMLWidget::updateGeometry
void updateGeometry()
Update the size of this widget.
Definition: umlwidget.cpp:1481
UMLScene::removeWidget
void removeWidget(UMLWidget *o)
Remove a widget from view.
Definition: umlscene.cpp:1172
UMLWidget::FT_BOLD
Definition: umlwidget.h:221
WidgetBase::m_lineColor
QColor m_lineColor
Color of the lines of the widget. Is saved to XMI.
Definition: widgetbase.h:168
UMLWidget::setLineColor
virtual void setLineColor(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:849
UMLScene::createAutoConstraintAssociations
void createAutoConstraintAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2755
associationwidget.h
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
UMLWidget::~UMLWidget
virtual ~UMLWidget()
Destructor.
Definition: umlwidget.cpp:86
cmds.h
WidgetBase::m_nId
Uml::ID::Type m_nId
This ID is only used when the widget does not have a corresponding UMLObject (i.e.
Definition: widgetbase.h:165
UMLWidget::adjustUnselectedAssocs
void adjustUnselectedAssocs(qreal dx, qreal dy)
Adjusts all unselected associations with the given co-ordinates.
Definition: umlwidget.cpp:1030
UMLWidget::saveToXMI
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
A virtual method to save the properties of this widget into a QDomElement i.e xml.
Definition: umlwidget.cpp:1707
WidgetBase::setFont
virtual void setFont(const QFont &font)
Set the font used to display text inside this widget.
Definition: widgetbase.cpp:443
umldoc.h
UMLScene::snapY
int snapY() const
Returns the y grid size.
Definition: umlscene.cpp:3589
UMLWidget::removeAssoc
void removeAssoc(AssociationWidget *pAssoc)
Removes an already created association from the list of associations that include this UMLWidget...
Definition: umlwidget.cpp:987
Uml::CmdChangeFillColor
Definition: cmd_changeFillColor.h:24
UMLWidget::slotSnapToGrid
void slotSnapToGrid()
Tells the widget to snap to grid.
Definition: umlwidget.cpp:1399
UMLWidget::FT_BOLD_UNDERLINE
Definition: umlwidget.h:225
WidgetBase::wt_Entity
Definition: widgetbase.h:50
UMLScene::activeView
UMLView * activeView() const
Returns the active view associated with this scene.
Definition: umlscene.cpp:193
ListPopupMenu::mt_Resize
Definition: listpopupmenu.h:198
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:36
UMLWidget::startResizeSize
QSizeF startResizeSize() const
Return the start size of the resize action.
Definition: umlwidget.cpp:567
UMLScene::clearSelected
void clearSelected()
Clear the selected widgets list.
Definition: umlscene.cpp:1291
WidgetBase::baseTypeStr
QLatin1String baseTypeStr() const
Definition: widgetbase.cpp:84
UMLWidget::onWidget
virtual qreal onWidget(const QPointF &p)
Returns 0 if the given point is not in the boundaries of the widget, else returns a number which is p...
Definition: umlwidget.cpp:1071
UMLWidget::deselect
void deselect(QGraphicsSceneMouseEvent *me)
Deselects the widget and removes it from the list of selected widgets.
Definition: umlwidget.cpp:1328
UMLWidget::showStereotype
bool showStereotype() const
Returns the status of whether to show Stereotype.
Definition: umlwidget.cpp:1693
UMLWidget::operator=
UMLWidget & operator=(const UMLWidget &other)
Assignment operator.
Definition: umlwidget.cpp:94
UMLWidget::m_instanceName
QString m_instanceName
instance name (used if on a deployment diagram)
Definition: umlwidget.h:291
UMLWidget::mousePressEvent
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse press event.
Definition: umlwidget.cpp:416
UMLWidget::setFont
virtual void setFont(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1641
floatingtextwidget.h
WidgetBase::baseType
WidgetType baseType() const
Read property of m_baseType.
Definition: widgetbase.cpp:76
UMLWidget::moveWidgetBy
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Moves the widget to a new position using the difference between the current position and the new posi...
Definition: umlwidget.cpp:247
UMLWidget::addAssoc
void addAssoc(AssociationWidget *pAssoc)
Adds an already created association to the list of associations that include this UMLWidget...
Definition: umlwidget.cpp:976
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Set the pen.
Definition: umlwidget.cpp:1101
UMLScene::getPaste
bool getPaste() const
Returns the status on whether in a paste state.
Definition: umlscene.cpp:3033
UMLWidget::resizeWidget
virtual void resizeWidget(qreal newW, qreal newH)
Resizes the widget.
Definition: umlwidget.cpp:583
UMLWidget::width
qreal width() const
Returns the width of the widget.
Definition: umlwidget.h:129
WidgetBase::wt_Message
Definition: widgetbase.h:55
AssociationWidget::isSelected
bool isSelected() const
Returns the state of whether the widget is selected.
Definition: associationwidget.cpp:3665
uError
#define uError()
Definition: debug_utils.h:96
classpropdlg.h
UMLWidget::setX
virtual void setX(qreal x)
Sets the x-coordinate.
Definition: umlwidget.cpp:1370
UMLWidget::setupFontType
void setupFontType(QFont &font, UMLWidget::FontType fontType)
Definition: umlwidget.cpp:1518
UMLWidget::clipSize
void clipSize()
clip the size of this widget against the minimal and maximal limits.
Definition: umlwidget.cpp:1501
UMLWidget::FT_BOLD_ITALIC
Definition: umlwidget.h:224
WidgetBase::wt_UseCase
Definition: widgetbase.h:45
UMLWidget::setShowStereotype
virtual void setShowStereotype(bool flag)
Set the status of whether to show Stereotype.
Definition: umlwidget.cpp:1681
UMLWidget::setUseFillColor
void setUseFillColor(bool fc)
Set the status of using fill color.
Definition: umlwidget.cpp:813
uniqueid.h
UMLScene::lineColor
const QColor & lineColor() const
Returns the line color to use.
Definition: umlscene.cpp:323
WidgetBase::setRect
void setRect(const QRectF &rect)
set widget rectangle in item coordinates
Definition: widgetbase.cpp:608
UMLScene::createAutoAssociations
void createAutoAssociations(UMLWidget *widget)
Creates automatically any Associations that the given UMLWidget may have on any diagram.
Definition: umlscene.cpp:2441
UMLWidget::maximumSize
virtual QSizeF maximumSize()
Compute the maximum possible width and height.
Definition: umlwidget.cpp:206
WidgetBase::wt_Object
Definition: widgetbase.h:52
UMLWidget::m_isInstance
bool m_isInstance
holds whether this widget is a component instance (i.e. on a deployment diagram)
Definition: umlwidget.h:292
WidgetBase::m_useFillColor
bool m_useFillColor
flag indicates if the UMLWidget uses the Diagram FillColour
Definition: widgetbase.h:173
UMLWidget::adjustAssocs
virtual void adjustAssocs(qreal dx, qreal dy)
Adjusts associations with the given co-ordinates.
Definition: umlwidget.cpp:1000
UMLScene::getPastePoint
QPointF getPastePoint()
Returns the offset point at which to place the paste from clipboard.
Definition: umlscene.cpp:3362
UMLWidget::m_oldStatusBarMsg
QString m_oldStatusBarMsg
The text in the status bar when the cursor was pressed.
Definition: umlwidget.h:327
UMLWidget::FontType
FontType
Definition: umlwidget.h:219
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Convenience method to extract the ListPopupMenu type from an action.
Definition: listpopupmenu.cpp:1122
UMLWidget::setY
virtual void setY(qreal y)
Sets the y-coordinate.
Definition: umlwidget.cpp:1382
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1053
UMLWidget::m_Assocs
AssociationWidgetList m_Assocs
A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram.
Definition: umlwidget.h:289
WidgetBase::wt_Node
Definition: widgetbase.h:61
UMLWidget::constrainMovementForAllWidgets
virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY)
Modifies the value of the diffX and diffY variables used to move the widgets.
Definition: umlwidget.cpp:270
UMLWidget::FT_BOLD_ITALIC_UNDERLINE
Definition: umlwidget.h:227
UMLWidget::m_moved
bool m_moved
If the widget was selected/moved/resized in the press and release cycle.
Definition: umlwidget.h:353
UMLWidget::m_maximumSize
QSizeF m_maximumSize
Definition: umlwidget.h:305
AssociationWidget::widgetMoved
void widgetMoved(UMLWidget *widget, qreal x, qreal y)
Adjusts the ending point of the association that connects to Widget.
Definition: associationwidget.cpp:1863
UMLWidget::setFillColorcmd
void setFillColorcmd(const QColor &color)
Sets the background fill color.
Definition: umlwidget.cpp:878
WidgetBase::operator=
WidgetBase & operator=(const WidgetBase &other)
Assignment operator.
Definition: widgetbase.cpp:574
Settings::OptionState::classState
ClassState classState
Definition: optionstate.h:144
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:319
UMLWidget::setMinimumSize
void setMinimumSize(const QSizeF &size)
This method is used to set the minimum size variable for this widget.
Definition: umlwidget.cpp:196
AssociationWidget::saveIdealTextPositions
void saveIdealTextPositions()
Auxiliary method for widgetMoved(): Saves all ideally computed floatingtext positions before doing an...
Definition: associationwidget.cpp:1849
WidgetBase::setTextColor
virtual void setTextColor(const QColor &color)
Sets the text color.
Definition: widgetbase.cpp:233
UMLApp::statusBarMsg
QString statusBarMsg()
Returns the current text in the status bar.
Definition: uml.cpp:3018
UMLScene
UMLScene instances represent diagrams.
Definition: umlscene.h:70
uml.h
WidgetBase::m_scene
UMLScene * m_scene
Definition: widgetbase.h:154
QList
DBG_SRC
#define DBG_SRC
Definition: import_utils.cpp:42
UMLWidget::slotWidgetMoved
virtual void slotWidgetMoved(Uml::ID::Type id)
Captures when another widget moves if this widget is linked to it.
Definition: umlwidget.cpp:735
UMLWidget::operator==
bool operator==(const UMLWidget &other) const
Overload '==' operator.
Definition: umlwidget.cpp:132
UMLScene::ID
Uml::ID::Type ID() const
Returns the ID of the diagram.
Definition: umlscene.cpp:272
WidgetBase::hasDocumentation
bool hasDocumentation()
Returns state of documentation for the widget.
Definition: widgetbase.cpp:169
UMLWidget
This is the base class for nearly all graphical widgets.
Definition: umlwidget.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:01 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