umbrello: umbrello/umlscene.h Source File

umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

umlscene.h
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-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef UMLSCENE_H
12 #define UMLSCENE_H
13
14 // local includes
15 #include "associationwidgetlist.h"
16 #include "basictypes.h"
17 #include "classifierwidget.h"
18 #include "messagewidgetlist.h"
19 #include "optionstate.h"
20 #include "umlobject.h"
21 #include "umlobjectlist.h"
22 #include "umlwidgetlist.h"
23 #include "worktoolbar.h"
24 #include "widgetbase.h"
25
26 // Qt includes
27 #include <QDomDocument>
28 #include <QGraphicsScene>
29 #include <QGraphicsItem>
30 #include <QGraphicsSceneMouseEvent>
31 #include <QGraphicsPolygonItem>
32 #include <QKeyEvent>
33 #include <QMouseEvent>
34 #include <QPixmap>
35
36 // forward declarations
37 class ClassOptionsPage;
38 class IDChangeLog;
39 class LayoutGrid;
40 class FloatingTextWidget;
41 class ObjectWidget;
42 class ToolBarState;
43 class ToolBarStateFactory;
44 class UMLFolder;
45 class UMLDoc;
46 class UMLAttribute;
47 class UMLCanvasObject;
48 class UMLClassifier;
49 class UMLViewImageExporter;
50 class UMLForeignKeyConstraint;
51 class UMLEntity;
52 class UMLView;
53
54 class QHideEvent;
55 class QMouseEvent;
56 class QPrinter;
57 class QShowEvent;
58 class UMLScenePrivate;
59
60 // migration wrapper for QGraphicsScene items
61 typedef QList<QGraphicsItem*> UMLSceneItemList;
62
68 class UMLScene : public QGraphicsScene
69 {
70 Q_OBJECT
71 public:
72 friend class UMLViewImageExporterModel;
73
74 explicit UMLScene(UMLFolder *parentFolder, UMLView *view = 0);
75 virtual ~UMLScene();
76
77 UMLView* activeView() const;
78
79 // Accessors and other methods dealing with loaded/saved data
80
81 UMLFolder* folder() const;
82 void setFolder(UMLFolder *folder);
83
84 QString documentation() const;
85 void setDocumentation(const QString &doc);
86
87 bool autoIncrementSequence() const;
88 void setAutoIncrementSequence(bool state);
89 QString autoIncrementSequenceValue();
90
91 QString name() const;
92 void setName(const QString &name);
93
94 Uml::DiagramType::Enum type() const;
95 void setType(Uml::DiagramType::Enum type);
96
97 Uml::ID::Type ID() const;
98 void setID(Uml::ID::Type id);
99
100 QPointF pos() const;
101 void setPos(const QPointF &pos);
102
103 const QColor& fillColor() const;
104 void setFillColor(const QColor &color);
105
106 const QColor& lineColor() const;
107 void setLineColor(const QColor &color);
108
109 uint lineWidth() const;
110 void setLineWidth(uint width);
111
112 const QColor& textColor() const;
113 void setTextColor(const QColor& color);
114
115 const QColor& gridDotColor() const;
116 void setGridDotColor(const QColor& color);
117
118 const QColor& backgroundColor() const;
119
120 bool snapToGrid() const;
121 void setSnapToGrid(bool bSnap);
122
123 bool snapComponentSizeToGrid() const;
124 void setSnapComponentSizeToGrid(bool bSnap);
125
126 int snapX() const;
127 int snapY() const;
128 void setSnapSpacing(int x, int y);
129
130 qreal snappedX(qreal x);
131 qreal snappedY(qreal y);
132
133 bool isSnapGridVisible() const;
134 void setSnapGridVisible(bool bShow);
135
136 bool isShowDocumentationIndicator() const;
137 void setShowDocumentationIndicator(bool bShow);
138
139 bool useFillColor() const;
140 void setUseFillColor(bool ufc);
141
142 QFont font() const;
143 void setFont(QFont font, bool changeAllWidgets = false);
144
145 bool showOpSig() const;
146 void setShowOpSig(bool bShowOpSig);
147
148 Settings::OptionState& optionState();
149 void setOptionState(const Settings::OptionState& options);
150
151 const AssociationWidgetList associationList() const;
152 const MessageWidgetList messageList() const;
153 const UMLWidgetList widgetList() const;
154 void addWidgetCmd(UMLWidget* widget);
155 void addWidgetCmd(AssociationWidget *widget);
156
157 bool isOpen() const;
158 void setIsOpen(bool isOpen);
159
160 // End of accessors and methods that only deal with loaded/saved data
162
163 void print(QPrinter *pPrinter, QPainter & pPainter);
164
165 void hideEvent(QHideEvent *he);
166 void showEvent(QShowEvent *se);
167
168 void checkMessages(ObjectWidget * w);
169
170 UMLWidget* findWidget(Uml::ID::Type id);
171
172 AssociationWidget* findAssocWidget(Uml::ID::Type id);
173 AssociationWidget* findAssocWidget(Uml::AssociationType::Enum at,
174 UMLWidget *pWidgetA, UMLWidget *pWidgetB);
175 AssociationWidget* findAssocWidget(UMLWidget *pWidgetA,
176 UMLWidget *pWidgetB, const QString& roleNameB);
177
178 void removeWidget(UMLWidget *o);
179 void removeWidget(AssociationWidget *w);
180 void removeWidgetCmd(UMLWidget *o);
181 private:
182 void removeOwnedWidgets(UMLWidget* o);
183 public:
184
185 UMLWidgetList selectedWidgets() const;
186 AssociationWidgetList selectedAssociationWidgets() const;
187 UMLWidgetList selectedMessageWidgets() const;
188 void clearSelected();
189
190 void moveSelectedBy(qreal dX, qreal dY);
191
192 int selectedCount(bool filterText = false) const;
193
194 void selectionUseFillColor(bool useFC);
195 void selectionSetFont(const QFont &font);
196 void selectionSetLineColor(const QColor &color);
197 void selectionSetLineWidth(uint width);
198 void selectionSetFillColor(const QColor &color);
199 void selectionSetVisualProperty(ClassifierWidget::VisualProperty property, bool value);
200
201 private:
202 void unselectChildrenOfSelectedWidgets();
203 public:
204 void deleteSelection();
205 void resizeSelection();
206
207 void selectAll();
208
209 UMLWidget* widgetOnDiagram(Uml::ID::Type id);
210 UMLWidget *widgetOnDiagram(WidgetBase::WidgetType type);
211
212 bool isSavedInSeparateFile();
213
214 void setMenu(const QPoint& pos);
215
216 void resetToolbar();
217 void triggerToolbarButton(WorkToolBar::ToolBar_Buttons button);
218
219 bool getPaste() const;
220 void setPaste(bool paste);
221
222 void activate();
223
224 AssociationWidgetList selectedAssocs();
225 UMLWidgetList selectedWidgetsExt(bool filterText = true);
226
227 void activateAfterLoad(bool bUseLog = false);
228
229 void endPartialWidgetPaste();
230 void beginPartialWidgetPaste();
231
232 void removeWidgetCmd(AssociationWidget* pAssoc);
233 void removeAssociations(UMLWidget* pWidget);
234 void selectAssociations(bool bSelect);
235
236 void getWidgetAssocs(UMLObject* Obj, AssociationWidgetList & Associations);
237
238 void removeAllAssociations();
239
240 void removeAllWidgets();
241
242 void getDiagram(QPixmap & diagram, const QRectF &rect);
243 void getDiagram(QPainter &painter, const QRectF &source, const QRectF &target = QRectF());
244
245 void copyAsImage(QPixmap*& pix);
246
247 UMLViewImageExporter* getImageExporter();
248
249 bool addAssociation(AssociationWidget* pAssoc, bool isPasteOperation = false);
250
251 void removeAssocInViewAndDoc(AssociationWidget* assoc);
252
253 void addFloatingTextWidget(FloatingTextWidget* pWidget);
254
255 QPointF getPastePoint();
256 void resetPastePoint();
257
258 void setStartedCut();
259
260 void createAutoAssociations(UMLWidget * widget);
261 void createAutoAttributeAssociations(UMLWidget *widget);
262 void createAutoConstraintAssociations(UMLWidget* widget);
263 void createAutoAttributeAssociations2(UMLWidget *widget);
264
265 void updateContainment(UMLCanvasObject *self);
266
267 void setClassWidgetOptions(ClassOptionsPage * page);
268
269 WidgetBase::WidgetType getUniqueSelectionType();
270
271 void clearDiagram();
272
273 void applyLayout(const QString &actionText);
274
275 void toggleSnapToGrid();
276 void toggleSnapComponentSizeToGrid();
277 void toggleShowGrid();
278
279 void fileLoaded();
280
281 void resizeSceneToItems();
282
283 // Load/Save interface:
284
285 virtual void saveToXMI1(QDomDocument & qDoc, QDomElement & qElement);
286 virtual bool loadFromXMI1(QDomElement & qElement);
287
288 bool loadUISDiagram(QDomElement & qElement);
289 UMLWidget* loadWidgetFromXMI(QDomElement& widgetElement);
290
291 void addObject(UMLObject *object);
292
293 void selectWidgets(qreal px, qreal py, qreal qx, qreal qy);
294 void selectWidgets(UMLWidgetList &widgets);
295 void selectWidget(UMLWidget* widget, QRectF* rect = 0);
296 void selectWidgetsOfAssoc(AssociationWidget *a);
297
298 ObjectWidget * onWidgetLine(const QPointF &point) const;
299 ObjectWidget * onWidgetDestructionBox(const QPointF &point) const;
300
301 UMLWidget* getFirstMultiSelectedWidget() const;
302
303 UMLWidget* widgetAt(const QPointF& p);
304 AssociationWidget* associationAt(const QPointF& p);
305 MessageWidget* messageAt(const QPointF& p);
306
307 void setupNewWidget(UMLWidget *w, bool setPosition=true);
308
309 bool getCreateObject() const;
310 void setCreateObject(bool bCreate);
311
312 int generateCollaborationId();
313
314 UMLSceneItemList collisions(const QPointF &p, int delta = 3);
315
316 bool isClassDiagram() { return type() == Uml::DiagramType::Class; }
317 bool isUseCaseDiagram() { return type() == Uml::DiagramType::UseCase; }
318 bool isSequenceDiagram() { return type() == Uml::DiagramType::Sequence; }
319 bool isCollaborationDiagram() { return type() == Uml::DiagramType::Collaboration; }
320 bool isStateDiagram() { return type() == Uml::DiagramType::State; }
321 bool isActivityDiagram() { return type() == Uml::DiagramType::Activity; }
322 bool isComponentDiagram() { return type() == Uml::DiagramType::Component; }
323 bool isDeploymentDiagram() { return type() == Uml::DiagramType::Deployment; }
324 bool isEntityRelationshipDiagram() { return type() == Uml::DiagramType::EntityRelationship; }
325 bool isObjectDiagram() { return type() == Uml::DiagramType::Object; }
326
327 void setWidgetLink(WidgetBase *w);
328 WidgetBase *widgetLink();
329
330 protected:
331 // Methods and members related to loading/saving
332
333 bool loadWidgetsFromXMI(QDomElement & qElement);
334 bool loadMessagesFromXMI(QDomElement & qElement);
335 bool loadAssociationsFromXMI(QDomElement & qElement);
336 bool loadUisDiagramPresentation(QDomElement & qElement);
337
342 Uml::ID::Type m_nLocalID;
343
344 Uml::ID::Type m_nID;
345 Uml::DiagramType::Enum m_Type;
346 QString m_Name;
347 QString m_Documentation;
348 Settings::OptionState m_Options;
349
350 bool m_bUseSnapToGrid;
351 bool m_bUseSnapComponentSizeToGrid;
352 bool m_isOpen;
353
354 // End of methods and members related to loading/saving
356
357 void dragEnterEvent(QGraphicsSceneDragDropEvent* enterEvent);
358 void dragMoveEvent(QGraphicsSceneDragDropEvent* moveEvent);
359 void dropEvent(QGraphicsSceneDragDropEvent* dropEvent);
360
361 void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent);
362 void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent);
363 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* mouseEvent);
364 void mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent);
365 virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
366
367 QRectF diagramRect();
368
369 void makeSelected(UMLWidget* uw);
370
371 void updateComponentSizes();
372
373 void findMaxBoundingRectangle(const FloatingTextWidget* ft,
374 qreal& px, qreal& py, qreal& qx, qreal& qy);
375 void forceUpdateWidgetFontMetrics(QPainter *painter);
376
377 virtual void drawBackground(QPainter *painter, const QRectF &rect);
378
379 #if QT_VERSION >= 0x050000
380 #if !(QT_DEPRECATED_SINCE(5, 0))
381 inline QGraphicsItem *itemAt(const QPointF &position) const {
382 QList<QGraphicsItem *> itemsAtPoint = items(position);
383 return itemsAtPoint.isEmpty() ? 0 : itemsAtPoint.first();
384 }
385 #endif
386 #endif
387
388 int m_nCollaborationId;
389 QPointF m_pos;
390 bool m_bCreateObject;
391 bool m_bDrawSelectedOnly;
392 bool m_bPaste;
393 bool m_bStartedCut;
394
395 private:
396 UMLScenePrivate *m_d;
397 static const qreal defaultCanvasSize;
398 static bool m_showDocumentationIndicator;
399
400 UMLView *m_view;
401 UMLFolder *m_pFolder;
402
403 IDChangeLog * m_pIDChangesLog;
404 bool m_isActivated;
405 bool m_bPopupShowing;
406 QPointF m_PastePoint;
407 UMLDoc* m_doc;
408 UMLViewImageExporter* m_pImageExporter;
409 LayoutGrid* m_layoutGrid;
410 bool m_autoIncrementSequence;
411
412 void createAutoAttributeAssociation(UMLClassifier *type,
413 UMLAttribute *attr,
414 UMLWidget *widget);
415 void createAutoConstraintAssociation(UMLEntity* refEntity,
416 UMLForeignKeyConstraint* fkConstraint,
417 UMLWidget* widget);
418
419 public slots:
420 void slotToolBarChanged(int c);
421 void slotObjectCreated(UMLObject * o);
422 void slotObjectRemoved(UMLObject * o);
423 void slotMenuSelection(QAction* action);
424 void slotActivate();
425 void slotCutSuccessful();
426 void slotShowView();
427
428 void alignLeft();
429 void alignRight();
430 void alignTop();
431 void alignBottom();
432 void alignVerticalMiddle();
433 void alignHorizontalMiddle();
434 void alignVerticalDistribute();
435 void alignHorizontalDistribute();
436
437 signals:
438 void sigResetToolBar();
439
440 void sigFillColorChanged(Uml::ID::Type);
441 void sigGridColorChanged(Uml::ID::Type);
442 void sigLineColorChanged(Uml::ID::Type);
443 void sigTextColorChanged(Uml::ID::Type);
444 void sigLineWidthChanged(Uml::ID::Type);
445 void sigSnapToGridToggled(bool);
446 void sigSnapComponentSizeToGridToggled(bool);
447 void sigShowGridToggled(bool);
448 void sigAssociationRemoved(AssociationWidget*);
449 void sigWidgetRemoved(UMLWidget*);
450
451 friend class DiagramProxyWidget;
452 };
453
454 QDebug operator<<(QDebug dbg, UMLScene *item);
455
456 #endif // UMLSCENE_H
associationwidgetlist.h
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition: associationwidgetlist.h:19
basictypes.h
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:52
ClassOptionsPage
A dialog page to display the class related options.
Definition: classoptionspage.h:40
ClassifierWidget::VisualProperty
VisualProperty
Definition: classifierwidget.h:42
DiagramProxyWidget
Definition: diagramproxywidget.h:29
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:37
IDChangeLog
Definition: idchangelog.h:27
LayoutGrid
Definition: layoutgrid.h:36
MessageWidget
Displays a message.
Definition: messagewidget.h:41
ObjectWidget
Displays an instance of a Concept.
Definition: objectwidget.h:33
Settings::OptionState
Definition: optionstate.h:314
ToolBarStateFactory
Definition: toolbarstatefactory.h:34
ToolBarState
Definition: toolbarstate.h:70
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLCanvasObject
Non-graphical information for a UMLCanvasObject.
Definition: umlcanvasobject.h:34
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
UMLDoc
Definition: umldoc.h:75
UMLEntity
Non-graphical Information for an Entity.
Definition: entity.h:35
UMLFolder
Non-graphical management of objects and diagrams of a Folder.
Definition: folder.h:35
UMLForeignKeyConstraint
Sets up Foreign Key entity constraint information.
Definition: foreignkeyconstraint.h:33
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLScenePrivate
Definition: umlscene.cpp:116
UMLScene
Definition: umlscene.h:69
UMLScene::removeWidget
void removeWidget(UMLWidget *o)
Definition: umlscene.cpp:1289
UMLScene::alignHorizontalMiddle
void alignHorizontalMiddle()
Definition: umlscene.cpp:4305
UMLScene::createAutoAttributeAssociations
void createAutoAttributeAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2602
UMLScene::onWidgetDestructionBox
ObjectWidget * onWidgetDestructionBox(const QPointF &point) const
Definition: umlscene.cpp:1039
UMLScene::setIsOpen
void setIsOpen(bool isOpen)
Definition: umlscene.cpp:661
UMLScene::toggleSnapComponentSizeToGrid
void toggleSnapComponentSizeToGrid()
Definition: umlscene.cpp:3519
UMLScene::endPartialWidgetPaste
void endPartialWidgetPaste()
Definition: umlscene.cpp:2214
UMLScene::snapComponentSizeToGrid
bool snapComponentSizeToGrid() const
Definition: umlscene.cpp:3553
UMLScene::isDeploymentDiagram
bool isDeploymentDiagram()
Definition: umlscene.h:323
UMLScene::setPos
void setPos(const QPointF &pos)
Definition: umlscene.cpp:466
UMLScene::setSnapGridVisible
void setSnapGridVisible(bool bShow)
Definition: umlscene.cpp:3639
UMLScene::setupNewWidget
void setupNewWidget(UMLWidget *w, bool setPosition=true)
Definition: umlscene.cpp:715
UMLScene::isUseCaseDiagram
bool isUseCaseDiagram()
Definition: umlscene.h:317
UMLScene::font
QFont font() const
Definition: umlscene.cpp:3419
UMLScene::setOptionState
void setOptionState(const Settings::OptionState &options)
Definition: umlscene.cpp:579
UMLScene::alignRight
void alignRight()
Definition: umlscene.cpp:4225
UMLScene::m_showDocumentationIndicator
static bool m_showDocumentationIndicator
Status of documentation indicator.
Definition: umlscene.h:398
UMLScene::m_d
UMLScenePrivate * m_d
Definition: umlscene.h:396
UMLScene::setMenu
void setMenu(const QPoint &pos)
UMLScene::loadUISDiagram
bool loadUISDiagram(QDomElement &qElement)
Definition: umlscene.cpp:4168
UMLScene::snapY
int snapY() const
Definition: umlscene.cpp:3579
UMLScene::associationList
const AssociationWidgetList associationList() const
Definition: umlscene.cpp:589
UMLScene::triggerToolbarButton
void triggerToolbarButton(WorkToolBar::ToolBar_Buttons button)
Definition: umlscene.cpp:2946
UMLScene::snapToGrid
bool snapToGrid() const
Definition: umlscene.cpp:3536
UMLScene::checkMessages
void checkMessages(ObjectWidget *w)
Definition: umlscene.cpp:1119
UMLScene::copyAsImage
void copyAsImage(QPixmap *&pix)
Definition: umlscene.cpp:2867
UMLScene::selectWidgets
void selectWidgets(qreal px, qreal py, qreal qx, qreal qy)
Definition: umlscene.cpp:1770
UMLScene::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlscene.cpp:3828
UMLScene::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:1002
UMLScene::setShowDocumentationIndicator
void setShowDocumentationIndicator(bool bShow)
Definition: umlscene.cpp:3656
UMLScene::messageAt
MessageWidget * messageAt(const QPointF &p)
Definition: umlscene.cpp:1105
UMLScene::m_nID
Uml::ID::Type m_nID
The ID of the view. Allocated by UMLDoc.
Definition: umlscene.h:344
UMLScene::snappedX
qreal snappedX(qreal x)
Definition: umlscene.cpp:3595
UMLScene::setFolder
void setFolder(UMLFolder *folder)
Definition: umlscene.cpp:340
UMLScene::getImageExporter
UMLViewImageExporter * getImageExporter()
Definition: umlscene.cpp:1936
UMLScene::widgetOnDiagram
UMLWidget * widgetOnDiagram(Uml::ID::Type id)
Definition: umlscene.cpp:1139
UMLScene::contextMenuEvent
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Definition: umlscene.cpp:2954
UMLScene::m_bDrawSelectedOnly
bool m_bDrawSelectedOnly
Definition: umlscene.h:391
UMLScene::createAutoConstraintAssociations
void createAutoConstraintAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2732
UMLScene::m_pFolder
UMLFolder * m_pFolder
The folder in which this UMLView is contained.
Definition: umlscene.h:401
UMLScene::selectedAssociationWidgets
AssociationWidgetList selectedAssociationWidgets() const
Definition: umlscene.cpp:1423
UMLScene::setLineColor
void setLineColor(const QColor &color)
Definition: umlscene.cpp:503
UMLScene::setStartedCut
void setStartedCut()
Definition: umlscene.cpp:3411
UMLScene::autoIncrementSequence
bool autoIncrementSequence() const
Definition: umlscene.cpp:372
UMLScene::sigTextColorChanged
void sigTextColorChanged(Uml::ID::Type)
UMLScene::dragMoveEvent
void dragMoveEvent(QGraphicsSceneDragDropEvent *moveEvent)
Definition: umlscene.cpp:890
UMLScene::hideEvent
void hideEvent(QHideEvent *he)
Definition: umlscene.cpp:774
UMLScene::sigLineWidthChanged
void sigLineWidthChanged(Uml::ID::Type)
UMLScene::removeAllAssociations
void removeAllAssociations()
Definition: umlscene.cpp:2327
UMLScene::getPaste
bool getPaste() const
Definition: umlscene.cpp:2971
UMLScene::sigSnapComponentSizeToGridToggled
void sigSnapComponentSizeToGridToggled(bool)
UMLScene::snappedY
qreal snappedY(qreal y)
Definition: umlscene.cpp:3613
UMLScene::folder
UMLFolder * folder() const
Definition: umlscene.cpp:332
UMLScene::forceUpdateWidgetFontMetrics
void forceUpdateWidgetFontMetrics(QPainter *painter)
Definition: umlscene.cpp:3717
UMLScene::selectionSetLineWidth
void selectionSetLineWidth(uint width)
Definition: umlscene.cpp:1532
UMLScene::getWidgetAssocs
void getWidgetAssocs(UMLObject *Obj, AssociationWidgetList &Associations)
Definition: umlscene.cpp:2311
UMLScene::selectWidgetsOfAssoc
void selectWidgetsOfAssoc(AssociationWidget *a)
Definition: umlscene.cpp:1750
UMLScene::UMLScene
UMLScene(UMLFolder *parentFolder, UMLView *view=0)
Definition: umlscene.cpp:262
UMLScene::m_view
UMLView * m_view
The view to which this scene is related.
Definition: umlscene.h:400
UMLScene::isObjectDiagram
bool isObjectDiagram()
Definition: umlscene.h:325
UMLScene::dropEvent
void dropEvent(QGraphicsSceneDragDropEvent *dropEvent)
Definition: umlscene.cpp:898
UMLScene::fillColor
const QColor & fillColor() const
Definition: umlscene.cpp:474
UMLScene::loadUisDiagramPresentation
bool loadUisDiagramPresentation(QDomElement &qElement)
Definition: umlscene.cpp:4070
UMLScene::removeAllWidgets
void removeAllWidgets()
Definition: umlscene.cpp:2338
UMLScene::selectAssociations
void selectAssociations(bool bSelect)
Definition: umlscene.cpp:2293
UMLScene::selectionSetFillColor
void selectionSetFillColor(const QColor &color)
Definition: umlscene.cpp:1552
UMLScene::toggleSnapToGrid
void toggleSnapToGrid()
Definition: umlscene.cpp:3510
UMLScene::findWidget
UMLWidget * findWidget(Uml::ID::Type id)
Definition: umlscene.cpp:1184
UMLScene::setTextColor
void setTextColor(const QColor &color)
Definition: umlscene.cpp:541
UMLScene::type
Uml::DiagramType::Enum type() const
Definition: umlscene.cpp:426
UMLScene::setShowOpSig
void setShowOpSig(bool bShowOpSig)
Definition: umlscene.cpp:3672
UMLScene::resetToolbar
void resetToolbar()
Definition: umlscene.cpp:2941
UMLScene::isShowDocumentationIndicator
bool isShowDocumentationIndicator() const
Definition: umlscene.cpp:3648
UMLScene::selectedWidgets
UMLWidgetList selectedWidgets() const
Definition: umlscene.cpp:1406
UMLScene::createAutoAssociations
void createAutoAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2412
UMLScene::m_Type
Uml::DiagramType::Enum m_Type
The type of diagram to represent.
Definition: umlscene.h:345
UMLScene::slotCutSuccessful
void slotCutSuccessful()
Definition: umlscene.cpp:3369
UMLScene::activateAfterLoad
void activateAfterLoad(bool bUseLog=false)
Definition: umlscene.cpp:2186
UMLScene::findAssocWidget
AssociationWidget * findAssocWidget(Uml::ID::Type id)
Definition: umlscene.cpp:1213
UMLScene::m_bPaste
bool m_bPaste
Definition: umlscene.h:392
UMLScene::setFont
void setFont(QFont font, bool changeAllWidgets=false)
Definition: umlscene.cpp:3427
UMLScene::activate
void activate()
Definition: umlscene.cpp:1952
UMLScene::addWidgetCmd
void addWidgetCmd(UMLWidget *widget)
Definition: umlscene.cpp:614
UMLScene::unselectChildrenOfSelectedWidgets
void unselectChildrenOfSelectedWidgets()
Definition: umlscene.cpp:1582
UMLScene::getDiagram
void getDiagram(QPixmap &diagram, const QRectF &rect)
Definition: umlscene.cpp:1876
UMLScene::beginPartialWidgetPaste
void beginPartialWidgetPaste()
Definition: umlscene.cpp:2205
UMLScene::m_pIDChangesLog
IDChangeLog * m_pIDChangesLog
LocalID Changes Log for paste actions.
Definition: umlscene.h:403
UMLScene::alignLeft
void alignLeft()
Definition: umlscene.cpp:4207
UMLScene::setAutoIncrementSequence
void setAutoIncrementSequence(bool state)
Definition: umlscene.cpp:377
UMLScene::setType
void setType(Uml::DiagramType::Enum type)
Definition: umlscene.cpp:434
UMLScene::removeAssocInViewAndDoc
void removeAssocInViewAndDoc(AssociationWidget *assoc)
Definition: umlscene.cpp:2245
UMLScene::m_isOpen
bool m_isOpen
Flag is set to true when diagram is open, i.e. shown to the user.
Definition: umlscene.h:352
UMLScene::alignBottom
void alignBottom()
Definition: umlscene.cpp:4260
UMLScene::sigAssociationRemoved
void sigAssociationRemoved(AssociationWidget *)
UMLScene::createAutoConstraintAssociation
void createAutoConstraintAssociation(UMLEntity *refEntity, UMLForeignKeyConstraint *fkConstraint, UMLWidget *widget)
Definition: umlscene.cpp:2781
UMLScene::sigSnapToGridToggled
void sigSnapToGridToggled(bool)
UMLScene::setWidgetLink
void setWidgetLink(WidgetBase *w)
Definition: umlscene.cpp:4404
UMLScene::drawBackground
virtual void drawBackground(QPainter *painter, const QRectF &rect)
Definition: umlscene.cpp:3728
UMLScene::diagramRect
QRectF diagramRect()
Definition: umlscene.cpp:1396
UMLScene::selectWidget
void selectWidget(UMLWidget *widget, QRectF *rect=0)
Definition: umlscene.cpp:1821
UMLScene::addAssociation
bool addAssociation(AssociationWidget *pAssoc, bool isPasteOperation=false)
Definition: umlscene.cpp:2095
UMLScene::resizeSelection
void resizeSelection()
Definition: umlscene.cpp:1661
UMLScene::isComponentDiagram
bool isComponentDiagram()
Definition: umlscene.h:322
UMLScene::selectAll
void selectAll()
Definition: umlscene.cpp:1684
UMLScene::setDocumentation
void setDocumentation(const QString &doc)
Definition: umlscene.cpp:364
UMLScene::textColor
const QColor & textColor() const
Definition: umlscene.cpp:531
UMLScene::backgroundColor
const QColor & backgroundColor() const
Definition: umlscene.cpp:1370
UMLScene::snapX
int snapX() const
Definition: umlscene.cpp:3571
UMLScene::updateContainment
void updateContainment(UMLCanvasObject *self)
Definition: umlscene.cpp:2360
UMLScene::findMaxBoundingRectangle
void findMaxBoundingRectangle(const FloatingTextWidget *ft, qreal &px, qreal &py, qreal &qx, qreal &qy)
Definition: umlscene.cpp:2844
UMLScene::sigLineColorChanged
void sigLineColorChanged(Uml::ID::Type)
UMLScene::sigResetToolBar
void sigResetToolBar()
UMLScene::sigShowGridToggled
void sigShowGridToggled(bool)
UMLScene::setFillColor
void setFillColor(const QColor &color)
Definition: umlscene.cpp:484
UMLScene::selectedWidgetsExt
UMLWidgetList selectedWidgetsExt(bool filterText=true)
Definition: umlscene.cpp:2030
UMLScene::loadMessagesFromXMI
bool loadMessagesFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:3997
UMLScene::onWidgetLine
ObjectWidget * onWidgetLine(const QPointF &point) const
Definition: umlscene.cpp:1014
UMLScene::selectedAssocs
AssociationWidgetList selectedAssocs()
Definition: umlscene.cpp:2049
UMLScene::clearDiagram
void clearDiagram()
Definition: umlscene.cpp:3486
UMLScene::setSnapToGrid
void setSnapToGrid(bool bSnap)
Definition: umlscene.cpp:3544
UMLScene::setGridDotColor
void setGridDotColor(const QColor &color)
Definition: umlscene.cpp:562
UMLScene::collisions
UMLSceneItemList collisions(const QPointF &p, int delta=3)
Definition: umlscene.cpp:1727
UMLScene::name
QString name() const
Definition: umlscene.cpp:410
UMLScene::moveSelectedBy
void moveSelectedBy(qreal dX, qreal dY)
Definition: umlscene.cpp:1469
UMLScene::resizeSceneToItems
void resizeSceneToItems()
Definition: umlscene.cpp:3690
UMLScene::lineColor
const QColor & lineColor() const
Definition: umlscene.cpp:493
UMLScene::isClassDiagram
bool isClassDiagram()
Definition: umlscene.h:316
UMLScene::lineWidth
uint lineWidth() const
Definition: umlscene.cpp:512
UMLScene::isSnapGridVisible
bool isSnapGridVisible() const
Definition: umlscene.cpp:3631
UMLScene::slotShowView
void slotShowView()
Definition: umlscene.cpp:3380
UMLScene::resetPastePoint
void resetPastePoint()
Definition: umlscene.cpp:3402
UMLScene::messageList
const MessageWidgetList messageList() const
Definition: umlscene.cpp:629
UMLScene::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:949
UMLScene::deleteSelection
void deleteSelection()
Definition: umlscene.cpp:1599
UMLScene::setClassWidgetOptions
void setClassWidgetOptions(ClassOptionsPage *page)
Definition: umlscene.cpp:3441
UMLScene::m_bPopupShowing
bool m_bPopupShowing
Status of a popupmenu on view. True - a popup is on view.
Definition: umlscene.h:405
UMLScene::isCollaborationDiagram
bool isCollaborationDiagram()
Definition: umlscene.h:319
UMLScene::documentation
QString documentation() const
Definition: umlscene.cpp:356
UMLScene::sigGridColorChanged
void sigGridColorChanged(Uml::ID::Type)
UMLScene::sigWidgetRemoved
void sigWidgetRemoved(UMLWidget *)
UMLScene::m_Options
Settings::OptionState m_Options
Options used by view.
Definition: umlscene.h:348
UMLScene::setLineWidth
void setLineWidth(uint width)
Definition: umlscene.cpp:522
UMLScene::m_nLocalID
Uml::ID::Type m_nLocalID
Definition: umlscene.h:342
UMLScene::slotObjectCreated
void slotObjectCreated(UMLObject *o)
Definition: umlscene.cpp:796
UMLScene::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:966
UMLScene::isOpen
bool isOpen() const
Definition: umlscene.cpp:652
UMLScene::m_PastePoint
QPointF m_PastePoint
The offset at which to paste the clipboard.
Definition: umlscene.h:406
UMLScene::setSnapSpacing
void setSnapSpacing(int x, int y)
Definition: umlscene.cpp:3587
UMLScene::alignVerticalMiddle
void alignVerticalMiddle()
Definition: umlscene.cpp:4277
UMLScene::dragEnterEvent
void dragEnterEvent(QGraphicsSceneDragDropEvent *enterEvent)
Definition: umlscene.cpp:848
UMLScene::print
void print(QPrinter *pPrinter, QPainter &pPainter)
Definition: umlscene.cpp:669
UMLScene::showEvent
void showEvent(QShowEvent *se)
Definition: umlscene.cpp:761
UMLScene::loadWidgetsFromXMI
bool loadWidgetsFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:3950
UMLScene::m_bStartedCut
bool m_bStartedCut
Flag if view/children started cut operation.
Definition: umlscene.h:393
UMLScene::pos
QPointF pos() const
Definition: umlscene.cpp:458
UMLScene::autoIncrementSequenceValue
QString autoIncrementSequenceValue()
Definition: umlscene.cpp:385
UMLScene::setCreateObject
void setCreateObject(bool bCreate)
Definition: umlscene.cpp:753
UMLScene::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:985
UMLScene::isStateDiagram
bool isStateDiagram()
Definition: umlscene.h:320
UMLScene::slotToolBarChanged
void slotToolBarChanged(int c)
Definition: umlscene.cpp:787
UMLScene::alignTop
void alignTop()
Definition: umlscene.cpp:4242
UMLScene::isSavedInSeparateFile
bool isSavedInSeparateFile()
Definition: umlscene.cpp:1693
UMLScene::m_doc
UMLDoc * m_doc
Pointer to the UMLDoc.
Definition: umlscene.h:407
UMLScene::m_pImageExporter
UMLViewImageExporter * m_pImageExporter
Used to export the view.
Definition: umlscene.h:408
UMLScene::applyLayout
void applyLayout(const QString &actionText)
Definition: umlscene.cpp:3496
UMLScene::m_bUseSnapToGrid
bool m_bUseSnapToGrid
Flag to use snap to grid. The default is off.
Definition: umlscene.h:350
UMLScene::selectionSetFont
void selectionSetFont(const QFont &font)
Definition: umlscene.cpp:1500
UMLScene::getUniqueSelectionType
WidgetBase::WidgetType getUniqueSelectionType()
Definition: umlscene.cpp:3462
UMLScene::m_Documentation
QString m_Documentation
The documentation of the diagram.
Definition: umlscene.h:347
UMLScene::m_pos
QPointF m_pos
Definition: umlscene.h:389
UMLScene::widgetLink
WidgetBase * widgetLink()
Definition: umlscene.cpp:4409
UMLScene::createAutoAttributeAssociation
void createAutoAttributeAssociation(UMLClassifier *type, UMLAttribute *attr, UMLWidget *widget)
Definition: umlscene.cpp:2670
UMLScene::m_Name
QString m_Name
The name of the diagram.
Definition: umlscene.h:346
UMLScene::getFirstMultiSelectedWidget
UMLWidget * getFirstMultiSelectedWidget() const
Definition: umlscene.cpp:1060
UMLScene::slotActivate
void slotActivate()
Definition: umlscene.cpp:1944
UMLScene::toggleShowGrid
void toggleShowGrid()
Definition: umlscene.cpp:3528
UMLScene::getCreateObject
bool getCreateObject() const
Definition: umlscene.cpp:745
UMLScene::showOpSig
bool showOpSig() const
Definition: umlscene.cpp:3664
UMLScene::slotObjectRemoved
void slotObjectRemoved(UMLObject *o)
Definition: umlscene.cpp:832
UMLScene::m_autoIncrementSequence
bool m_autoIncrementSequence
state of auto increment sequence
Definition: umlscene.h:410
UMLScene::generateCollaborationId
int generateCollaborationId()
Definition: umlscene.cpp:643
UMLScene::~UMLScene
virtual ~UMLScene()
Definition: umlscene.cpp:308
UMLScene::setPaste
void setPaste(bool paste)
Definition: umlscene.cpp:2979
UMLScene::isEntityRelationshipDiagram
bool isEntityRelationshipDiagram()
Definition: umlscene.h:324
UMLScene::createAutoAttributeAssociations2
void createAutoAttributeAssociations2(UMLWidget *widget)
Definition: umlscene.cpp:2813
UMLScene::getPastePoint
QPointF getPastePoint()
Definition: umlscene.cpp:3391
UMLScene::sigFillColorChanged
void sigFillColorChanged(Uml::ID::Type)
UMLScene::fileLoaded
void fileLoaded()
Definition: umlscene.cpp:3681
UMLScene::addObject
void addObject(UMLObject *object)
Definition: umlscene.cpp:4061
UMLScene::useFillColor
bool useFillColor() const
Definition: umlscene.cpp:1378
UMLScene::clearSelected
void clearSelected()
Definition: umlscene.cpp:1456
UMLScene::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlscene.cpp:3753
UMLScene::m_bUseSnapComponentSizeToGrid
bool m_bUseSnapComponentSizeToGrid
Flag to use snap to grid for component size. The default is off.
Definition: umlscene.h:351
UMLScene::alignHorizontalDistribute
void alignHorizontalDistribute()
Definition: umlscene.cpp:4364
UMLScene::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: umlscene.cpp:2988
UMLScene::associationAt
AssociationWidget * associationAt(const QPointF &p)
Definition: umlscene.cpp:1090
UMLScene::makeSelected
void makeSelected(UMLWidget *uw)
Definition: umlscene.cpp:1740
UMLScene::selectedCount
int selectedCount(bool filterText=false) const
Definition: umlscene.cpp:2005
UMLScene::removeAssociations
void removeAssociations(UMLWidget *pWidget)
Definition: umlscene.cpp:2279
UMLScene::selectionSetVisualProperty
void selectionSetVisualProperty(ClassifierWidget::VisualProperty property, bool value)
Definition: umlscene.cpp:1567
UMLScene::m_nCollaborationId
int m_nCollaborationId
Used for creating unique name of collaboration messages.
Definition: umlscene.h:388
UMLScene::selectedMessageWidgets
UMLWidgetList selectedMessageWidgets() const
Definition: umlscene.cpp:1440
UMLScene::selectionUseFillColor
void selectionUseFillColor(bool useFC)
Definition: umlscene.cpp:1482
UMLScene::setUseFillColor
void setUseFillColor(bool ufc)
Definition: umlscene.cpp:1386
UMLScene::optionState
Settings::OptionState & optionState()
Definition: umlscene.cpp:571
UMLScene::m_isActivated
bool m_isActivated
True if the view was activated after the serialization(load).
Definition: umlscene.h:404
UMLScene::activeView
UMLView * activeView() const
Definition: umlscene.cpp:348
UMLScene::loadAssociationsFromXMI
bool loadAssociationsFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:4024
UMLScene::addFloatingTextWidget
void addFloatingTextWidget(FloatingTextWidget *pWidget)
Definition: umlscene.cpp:2063
UMLScene::setName
void setName(const QString &name)
Definition: umlscene.cpp:418
UMLScene::widgetAt
UMLWidget * widgetAt(const QPointF &p)
Definition: umlscene.cpp:1074
UMLScene::removeWidgetCmd
void removeWidgetCmd(UMLWidget *o)
Definition: umlscene.cpp:1309
UMLScene::widgetList
const UMLWidgetList widgetList() const
Definition: umlscene.cpp:603
UMLScene::isActivityDiagram
bool isActivityDiagram()
Definition: umlscene.h:321
UMLScene::m_bCreateObject
bool m_bCreateObject
Definition: umlscene.h:390
UMLScene::isSequenceDiagram
bool isSequenceDiagram()
Definition: umlscene.h:318
UMLScene::m_layoutGrid
LayoutGrid * m_layoutGrid
layout grid in the background
Definition: umlscene.h:409
UMLScene::alignVerticalDistribute
void alignVerticalDistribute()
Definition: umlscene.cpp:4333
UMLScene::removeOwnedWidgets
void removeOwnedWidgets(UMLWidget *o)
Definition: umlscene.cpp:1355
UMLScene::setID
void setID(Uml::ID::Type id)
Definition: umlscene.cpp:450
UMLScene::defaultCanvasSize
static const qreal defaultCanvasSize
The default size of a diagram in pixels.
Definition: umlscene.h:397
UMLScene::gridDotColor
const QColor & gridDotColor() const
Definition: umlscene.cpp:552
UMLScene::selectionSetLineColor
void selectionSetLineColor(const QColor &color)
Definition: umlscene.cpp:1514
UMLScene::updateComponentSizes
void updateComponentSizes()
Definition: umlscene.cpp:3699
UMLScene::setSnapComponentSizeToGrid
void setSnapComponentSizeToGrid(bool bSnap)
Definition: umlscene.cpp:3561
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:442
UMLScene::loadWidgetFromXMI
UMLWidget * loadWidgetFromXMI(QDomElement &widgetElement)
Definition: umlscene.cpp:3976
UMLViewImageExporterModel
Definition: umlviewimageexportermodel.h:34
UMLViewImageExporter
Definition: umlviewimageexporter.h:34
UMLView
Definition: umlview.h:35
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:111
WorkToolBar::ToolBar_Buttons
ToolBar_Buttons
Definition: worktoolbar.h:57
classifierwidget.h
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
messagewidgetlist.h
MessageWidgetList
QList< QPointer< MessageWidget > > MessageWidgetList
Definition: messagewidgetlist.h:18
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:106
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:77
Uml::DiagramType::Component
@ Component
Definition: basictypes.h:87
Uml::DiagramType::Collaboration
@ Collaboration
Definition: basictypes.h:84
Uml::DiagramType::Activity
@ Activity
Definition: basictypes.h:86
Uml::DiagramType::State
@ State
Definition: basictypes.h:85
Uml::DiagramType::Object
@ Object
Definition: basictypes.h:90
Uml::DiagramType::UseCase
@ UseCase
Definition: basictypes.h:82
Uml::DiagramType::Sequence
@ Sequence
Definition: basictypes.h:83
Uml::DiagramType::Class
@ Class
Definition: basictypes.h:81
Uml::DiagramType::EntityRelationship
@ EntityRelationship
Definition: basictypes.h:89
Uml::DiagramType::Deployment
@ Deployment
Definition: basictypes.h:88
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
optionstate.h
a
QString a
Definition: petalnode.cpp:18
umlobject.h
umlobjectlist.h
UMLSceneItemList
QList< QGraphicsItem * > UMLSceneItemList
Definition: umlscene.h:58
operator<<
QDebug operator<<(QDebug dbg, UMLScene *item)
Definition: umlscene.cpp:4395
umlwidgetlist.h
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition: umlwidgetlist.h:17
widgetbase.h
worktoolbar.h