umbrello/umbrello
umlwidget.h
Go to the documentation of this file.
51 explicit UMLWidget(UMLScene *scene, WidgetType type = wt_UMLWidget, Uml::ID::Type id = Uml::ID::None);
238 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void setScene(UMLScene *scene)
Clears the selection, resets the toolbar and deselects the widget.
Definition: umlwidget.cpp:1349
Definition: umlwidget.h:223
void selectMultiple(QGraphicsSceneMouseEvent *me)
Selects the widget and adds it to the list of selected widgets.
Definition: umlwidget.cpp:1317
static bool widgetHasUMLObject(WidgetBase::WidgetType type)
Returns whether the widget type has an associated UMLObject.
Definition: umlwidget.cpp:1412
virtual QCursor resizeCursor() const
Returns the cursor to be shown when resizing the widget.
Definition: umlwidget.cpp:1120
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
virtual void slotTextColorChanged(Uml::ID::Type viewID)
Captures a text color change signal.
Definition: umlwidget.cpp:764
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
virtual void slotLineColorChanged(Uml::ID::Type viewID)
Captures a line color change signal.
Definition: umlwidget.cpp:779
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse move event.
Definition: umlwidget.cpp:334
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1565
virtual void constrain(qreal &width, qreal &height)
Apply possible constraints to the given candidate width and height.
Definition: umlwidget.cpp:617
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
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse release event.
Definition: umlwidget.cpp:498
virtual void showPropertiesDialog()
Show a properties dialog for a UMLWidget.
Definition: umlwidget.cpp:1047
void setTextColorcmd(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:822
virtual QSizeF minimumSize()
Compute the minimum possible width and height.
Definition: umlwidget.cpp:185
AssociationWidgetList & associationWidgetList()
Returns the list of associations connected to this widget.
Definition: umlwidget.h:149
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
Definition: umlwidget.h:220
void setSelectionBounds()
Fills m_selectedWidgetsList and sets the selection bounds ((m_min/m_max)X/Y attributes).
Definition: umlwidget.cpp:1240
virtual void slotLineWidthChanged(Uml::ID::Type viewID)
Captures a linewidth change signal.
Definition: umlwidget.cpp:796
virtual void setSelected(bool _select)
Sets the state of whether the widget is selected.
Definition: umlwidget.cpp:1253
virtual QSizeF calculateSize()
calculate content related size of widget.
Definition: umlwidget.cpp:1161
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType)
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition: umlwidget.cpp:1619
void moveByLocal(qreal dx, qreal dy)
Move the widget by an X and Y offset relative to the current position.
Definition: umlwidget.cpp:1089
bool m_ignoreSnapComponentSizeToGrid
Definition: umlwidget.h:314
UMLWidget(UMLScene *scene, WidgetType type=wt_UMLWidget, UMLObject *o=0)
Creates a UMLWidget object.
Definition: umlwidget.cpp:55
Definition: umlwidget.h:226
bool isSelected() const
Returns the state of whether the widget is selected.
Definition: umlwidget.h:87
void setLineColorcmd(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:840
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
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
QPointF m_oldPos
The X/Y position the widget had when the movement started.
Definition: umlwidget.h:334
This class represents an association inside a diagram.
Definition: associationwidget.h:50
bool isActivated() const
Returns true if the Activate method has been called for this instance.
Definition: umlwidget.cpp:957
bool m_activated
true if the activate function has been called for this class instance
Definition: umlwidget.h:308
virtual void updateWidget()
When a widget changes this slot captures that signal.
Definition: umlwidget.cpp:591
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Event handler for mouse double click events.
Definition: umlwidget.cpp:538
void forceUpdateFontMetrics(QPainter *painter)
Definition: umlwidget.cpp:1657
virtual void setTextColor(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:831
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Event handler for context menu events.
Definition: umlwidget.cpp:225
virtual void setFillColor(const QColor &color)
Sets the background fill color.
Definition: umlwidget.cpp:868
bool m_shiftPressed
If shift or control button were pressed in mouse press event.
Definition: umlwidget.h:340
void selectSingle(QGraphicsSceneMouseEvent *me)
Selects the widget and clears the other selected widgets, if any.
Definition: umlwidget.cpp:1303
virtual bool activate(IDChangeLog *ChangeLog=0)
Activate the object after serializing it from a QDataStream.
Definition: umlwidget.cpp:890
void setActivated(bool active=true)
Set the m_activated flag of a widget but does not perform the Activate method.
Definition: umlwidget.cpp:967
UMLWidgetList m_selectedWidgetsList
A list containing the selected widgets.
Definition: umlwidget.h:324
Definition: umlwidget.h:222
void setFontMetrics(UMLWidget::FontType fontType, QFontMetrics fm)
Set the font metric to use.
Definition: umlwidget.cpp:1630
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
virtual void moveEvent(QGraphicsSceneMouseEvent *event)
Overrides the standard operation.
Definition: umlwidget.cpp:1703
QPointF startMovePosition() const
Return the start position of the move action.
Definition: umlwidget.cpp:558
void setMaximumSize(const QSizeF &size)
This method is used to set the maximum size variable for this widget.
Definition: umlwidget.cpp:217
virtual void setDefaultFontMetrics(UMLWidget::FontType fontType)
Template Method, override this to set the default font metric.
Definition: umlwidget.cpp:1512
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
virtual void setLineWidth(uint width)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:857
void sigWidgetMoved(Uml::ID::Type id)
Emit when the widget moves its' position.
QRectF rect() const
return drawing rectangle of widget in local coordinates
Definition: widgetbase.cpp:600
virtual void slotFillColorChanged(Uml::ID::Type viewID)
Captures a color change signal.
Definition: umlwidget.cpp:744
Definition: umlwidget.h:228
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1391
void setInstanceName(const QString &instanceName)
Write property of m_instanceName.
Definition: umlwidget.h:170
bool getIgnoreSnapToGrid() const
Return the value of m_ignoreSnapToGrid.
Definition: umlwidget.cpp:1442
void slotClearAllSelected()
Captures a sigClearAllSelected signal sent by UMLView.
Definition: umlwidget.cpp:1293
Definition: widgetbase.h:43
Definition: umlwidget.h:221
virtual void setLineColor(const QColor &color)
Overrides the method from WidgetBase.
Definition: umlwidget.cpp:849
void adjustUnselectedAssocs(qreal dx, qreal dy)
Adjusts all unselected associations with the given co-ordinates.
Definition: umlwidget.cpp:1030
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
void removeAssoc(AssociationWidget *pAssoc)
Removes an already created association from the list of associations that include this UMLWidget...
Definition: umlwidget.cpp:987
Definition: umlwidget.h:225
QSizeF startResizeSize() const
Return the start size of the resize action.
Definition: umlwidget.cpp:567
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
void deselect(QGraphicsSceneMouseEvent *me)
Deselects the widget and removes it from the list of selected widgets.
Definition: umlwidget.cpp:1328
bool showStereotype() const
Returns the status of whether to show Stereotype.
Definition: umlwidget.cpp:1693
QList< AssociationWidget * > AssociationWidgetList
Definition: associationwidgetlist.h:18
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Handles a mouse press event.
Definition: umlwidget.cpp:416
virtual void setFont(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1641
A popup menu that depending on what type is set to will display a different menu. ...
Definition: listpopupmenu.h:40
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
void addAssoc(AssociationWidget *pAssoc)
Adds an already created association to the list of associations that include this UMLWidget...
Definition: umlwidget.cpp:976
Arrow tool for select, move and resize widgets and associations.
Definition: toolbarstatearrow.h:30
void setupFontType(QFont &font, UMLWidget::FontType fontType)
Definition: umlwidget.cpp:1518
void clipSize()
clip the size of this widget against the minimal and maximal limits.
Definition: umlwidget.cpp:1501
Definition: umlwidget.h:224
virtual void setShowStereotype(bool flag)
Set the status of whether to show Stereotype.
Definition: umlwidget.cpp:1681
virtual QSizeF maximumSize()
Compute the maximum possible width and height.
Definition: umlwidget.cpp:206
bool m_isInstance
holds whether this widget is a component instance (i.e. on a deployment diagram)
Definition: umlwidget.h:292
virtual void adjustAssocs(qreal dx, qreal dy)
Adjusts associations with the given co-ordinates.
Definition: umlwidget.cpp:1000
QString m_oldStatusBarMsg
The text in the status bar when the cursor was pressed.
Definition: umlwidget.h:327
AssociationWidgetList m_Assocs
A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram.
Definition: umlwidget.h:289
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
bool m_moved
If the widget was selected/moved/resized in the press and release cycle.
Definition: umlwidget.h:353
void setFillColorcmd(const QColor &color)
Sets the background fill color.
Definition: umlwidget.cpp:878
void setMinimumSize(const QSizeF &size)
This method is used to set the minimum size variable for this widget.
Definition: umlwidget.cpp:196
virtual QFont font() const
Returns the font used for diaplaying any text.
Definition: widgetbase.cpp:431
bool getStartMove() const
Returns whether we triggered the update of position movement.
Definition: umlwidget.h:112
virtual void slotWidgetMoved(Uml::ID::Type id)
Captures when another widget moves if this widget is linked to it.
Definition: umlwidget.cpp:735
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
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.