umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Public Types | Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
UMLWidget Class Reference

The base class for graphical UML objects. More...

#include <umlwidget.h>

Inheritance diagram for UMLWidget:
Collaboration diagram for UMLWidget:

Public Types

enum  FontType {
  FT_NORMAL = 0 , FT_BOLD = 1 , FT_ITALIC = 2 , FT_UNDERLINE = 3 ,
  FT_BOLD_ITALIC = 4 , FT_BOLD_UNDERLINE = 5 , FT_ITALIC_UNDERLINE = 6 , FT_BOLD_ITALIC_UNDERLINE = 7 ,
  FT_INVALID = 8
}
 
enum  AddWidgetOption {
  NoOption = 0 , SetupSize = 1 , SwitchDirection = 2 , ShowProperties = 4 ,
  Default = SetupSize | ShowProperties
}
 
- Public Types inherited from WidgetBase
enum  WidgetType {
  wt_Min = 299 , wt_UMLWidget , wt_Actor , wt_UseCase ,
  wt_Class , wt_Interface , wt_Datatype , wt_Enum ,
  wt_Entity , wt_Package , wt_Object , wt_Note ,
  wt_Box , wt_Message , wt_Text , wt_State ,
  wt_Activity , wt_Component , wt_Artifact , wt_Node ,
  wt_Association , wt_ForkJoin , wt_Precondition , wt_CombinedFragment ,
  wt_FloatingDashLine , wt_Signal , wt_Pin , wt_ObjectNode ,
  wt_Region , wt_Category , wt_Port , wt_Instance ,
  wt_Max
}
 

Public Slots

virtual void updateWidget ()
 
virtual void slotMenuSelection (QAction *action)
 
virtual void slotWidgetMoved (Uml::ID::Type id)
 
virtual void slotFillColorChanged (Uml::ID::Type viewID)
 
virtual void slotLineColorChanged (Uml::ID::Type viewID)
 
virtual void slotTextColorChanged (Uml::ID::Type viewID)
 
virtual void slotLineWidthChanged (Uml::ID::Type viewID)
 
void slotSnapToGrid ()
 
- Public Slots inherited from WidgetBase
virtual void slotMenuSelection (QAction *trigger)
 

Signals

void sigWidgetMoved (Uml::ID::Type id)
 

Public Member Functions

 UMLWidget (UMLScene *scene, WidgetType type=wt_UMLWidget, UMLObject *o=0)
 
 UMLWidget (UMLScene *scene, WidgetType type=wt_UMLWidget, Uml::ID::Type id=Uml::ID::None)
 
virtual ~UMLWidget ()
 
UMLWidgetoperator= (const UMLWidget &other)
 
bool operator== (const UMLWidget &other) const
 
virtual QSizeF minimumSize () const
 
void setMinimumSize (const QSizeF &size)
 
virtual QSizeF maximumSize ()
 
void setMaximumSize (const QSizeF &size)
 
virtual void setUseFillColor (bool fc)
 
void setUseFillColorCmd (bool fc)
 
virtual void setTextColor (const QColor &color)
 
void setTextColorCmd (const QColor &color)
 
virtual void setLineColor (const QColor &color)
 
virtual void setLineColorCmd (const QColor &color)
 
virtual void setLineWidth (uint width)
 
void setLineWidthCmd (uint width)
 
virtual void setFillColor (const QColor &color)
 
void setFillColorCmd (const QColor &color)
 
void setSelectedFlag (bool _select)
 
virtual void setSelected (bool _select)
 
void setScene (UMLScene *scene)
 
virtual bool activate (IDChangeLog *changeLog=0)
 
void setPenFromSettings (QPainter &p)
 
void setPenFromSettings (QPainter *p)
 
virtual void setFont (const QFont &font)
 
void setFontCmd (const QFont &font)
 
bool getStartMove () const
 
virtual qreal getX () const
 
virtual qreal getY () const
 
virtual QPointF getPos () const
 
virtual void setX (qreal x)
 
virtual void setY (qreal y)
 
qreal height () const
 
qreal width () const
 
void setSize (qreal width, qreal height)
 
void setSize (const QSizeF &size)
 
virtual void resizeWidget (qreal newW, qreal newH)
 
virtual void notifyParentResize ()
 
bool getIgnoreSnapToGrid () const
 
void setIgnoreSnapToGrid (bool to)
 
virtual bool isLocatedIn (const UMLWidget *other) const
 
void moveByLocal (qreal dx, qreal dy)
 
virtual void removeAssoc (AssociationWidget *pAssoc)
 
virtual void addAssoc (AssociationWidget *pAssoc)
 
AssociationWidgetListassociationWidgetList () const
 
bool isInstance () const
 
void setIsInstance (bool isInstance)
 
void setInstanceName (const QString &instanceName)
 
QString instanceName () const
 
Uml::ShowStereoType::Enum showStereotype () const
 
virtual void setShowStereotype (Uml::ShowStereoType::Enum flag)
 
QString tags () const
 
virtual bool showPropertiesDialog ()
 
virtual void adjustAssocs (qreal dx, qreal dy)
 
virtual void adjustUnselectedAssocs (qreal dx, qreal dy)
 
bool isActivated () const
 
void setActivated (bool active=true)
 
virtual void cleanup ()
 
void updateGeometry (bool withAssocs=true)
 
void clipSize ()
 
void forceUpdateFontMetrics (QPainter *painter)
 
void forceUpdateFontMetrics (QFont &font, QPainter *painter)
 
virtual bool loadFromXMI (QDomElement &qElement)
 
virtual void saveToXMI (QXmlStreamWriter &writer)
 
QPointF startMovePosition () const
 
void setStartMovePosition (const QPointF &position)
 
QSizeF startResizeSize () const
 
virtual QSizeF calculateSize (bool withExtensions=true) const
 
void resize ()
 
bool fixedAspectRatio () const
 
void setFixedAspectRatio (bool state)
 
bool resizable () const
 
void setResizable (bool state)
 
virtual void setDefaultFontMetrics (QFont &font, UMLWidget::FontType fontType)
 
virtual void setDefaultFontMetrics (QFont &font, UMLWidget::FontType fontType, QPainter &painter)
 
QFontMetrics & getFontMetrics (UMLWidget::FontType fontType) const
 
void setFontMetrics (UMLWidget::FontType fontType, QFontMetrics fm)
 
void setupFontType (QFont &font, UMLWidget::FontType fontType)
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 
- Public Member Functions inherited from WidgetBase
 WidgetBase (UMLScene *scene, WidgetType type=wt_UMLWidget, Uml::ID::Type id=Uml::ID::None)
 
virtual ~WidgetBase ()
 
UMLObjectumlObject () const
 
virtual void setUMLObject (UMLObject *obj)
 
Uml::ID::Type id () const
 
void setID (Uml::ID::Type id)
 
void setLocalID (Uml::ID::Type id)
 
Uml::ID::Type localID () const
 
virtual UMLWidgetwidgetWithID (Uml::ID::Type id)
 
WidgetType baseType () const
 
void setBaseType (const WidgetType &baseType)
 
QLatin1String baseTypeStr () const
 
QString baseTypeStrWithoutPrefix () const
 
UMLSceneumlScene () const
 
UMLDocumlDoc () const
 
QString documentation () const
 
bool hasDocumentation () const
 
virtual void setDocumentation (const QString &doc)
 
QString name () const
 
virtual void setName (const QString &strName)
 
QColor lineColor () const
 
uint lineWidth () const
 
QColor textColor () const
 
QColor fillColor () const
 
bool usesDiagramLineColor () const
 
void setUsesDiagramLineColor (bool state)
 
bool usesDiagramLineWidth () const
 
void setUsesDiagramLineWidth (bool state)
 
bool useFillColor () const
 
bool usesDiagramTextColor () const
 
void setUsesDiagramTextColor (bool state)
 
bool usesDiagramFillColor () const
 
void setUsesDiagramFillColor (bool state)
 
bool usesDiagramUseFillColor () const
 
void setUsesDiagramUseFillColor (bool state)
 
virtual QFont font () const
 
bool autoResize () const
 
void setAutoResize (bool state)
 
bool changesShape () const
 
void setChangesShape (bool state)
 
WidgetBaseoperator= (const WidgetBase &other)
 
QRectF rect () const
 
void setRect (const QRectF &rect)
 
void setRect (qreal x, qreal y, qreal width, qreal height)
 
virtual QRectF boundingRect () const
 
virtual UMLWidgetonWidget (const QPointF &p)
 
bool isActivityWidget () const
 
bool isActorWidget () const
 
bool isArtifactWidget () const
 
bool isAssociationWidget () const
 
bool isBoxWidget () const
 
bool isCategoryWidget () const
 
bool isClassWidget () const
 
bool isCombinedFragmentWidget () const
 
bool isComponentWidget () const
 
bool isDatatypeWidget () const
 
bool isEntityWidget () const
 
bool isEnumWidget () const
 
bool isFloatingDashLineWidget () const
 
bool isForkJoinWidget () const
 
bool isInterfaceWidget () const
 
bool isMessageWidget () const
 
bool isNodeWidget () const
 
bool isNoteWidget () const
 
bool isObjectNodeWidget () const
 
bool isObjectWidget () const
 
bool isPackageWidget () const
 
bool isPinWidget () const
 
bool isPortWidget () const
 
bool isPreconditionWidget () const
 
bool isRegionWidget () const
 
bool isSignalWidget () const
 
bool isStateWidget () const
 
bool isTextWidget () const
 
bool isUseCaseWidget () const
 
ActivityWidgetasActivityWidget ()
 
ActorWidgetasActorWidget ()
 
ArtifactWidgetasArtifactWidget ()
 
AssociationWidgetasAssociationWidget ()
 
BoxWidgetasBoxWidget ()
 
CategoryWidgetasCategoryWidget ()
 
ClassifierWidgetasClassifierWidget ()
 
CombinedFragmentWidgetasCombinedFragmentWidget ()
 
ComponentWidgetasComponentWidget ()
 
DatatypeWidgetasDatatypeWidget ()
 
EntityWidgetasEntityWidget ()
 
EnumWidgetasEnumWidget ()
 
FloatingDashLineWidgetasFloatingDashLineWidget ()
 
ForkJoinWidgetasForkJoinWidget ()
 
InterfaceWidgetasInterfaceWidget ()
 
MessageWidgetasMessageWidget ()
 
NodeWidgetasNodeWidget ()
 
NoteWidgetasNoteWidget ()
 
ObjectNodeWidgetasObjectNodeWidget ()
 
ObjectWidgetasObjectWidget ()
 
PackageWidgetasPackageWidget ()
 
PinWidgetasPinWidget ()
 
PinPortBaseasPinPortBase ()
 
PortWidgetasPortWidget ()
 
PreconditionWidgetasPreconditionWidget ()
 
RegionWidgetasRegionWidget ()
 
SignalWidgetasSignalWidget ()
 
StateWidgetasStateWidget ()
 
FloatingTextWidgetasFloatingTextWidget ()
 
UseCaseWidgetasUseCaseWidget ()
 
UMLWidgetasUMLWidget ()
 
const ActivityWidgetasActivityWidget () const
 
const ActorWidgetasActorWidget () const
 
const ArtifactWidgetasArtifactWidget () const
 
const AssociationWidgetasAssociationWidget () const
 
const BoxWidgetasBoxWidget () const
 
const CategoryWidgetasCategoryWidget () const
 
const ClassifierWidgetasClassifierWidget () const
 
const CombinedFragmentWidgetasCombinedFragmentWidget () const
 
const ComponentWidgetasComponentWidget () const
 
const DatatypeWidgetasDatatypeWidget () const
 
const EntityWidgetasEntityWidget () const
 
const EnumWidgetasEnumWidget () const
 
const FloatingDashLineWidgetasFloatingDashLineWidget () const
 
const ForkJoinWidgetasForkJoinWidget () const
 
const InterfaceWidgetasInterfaceWidget () const
 
const MessageWidgetasMessageWidget () const
 
const NodeWidgetasNodeWidget () const
 
const NoteWidgetasNoteWidget () const
 
const ObjectNodeWidgetasObjectNodeWidget () const
 
const ObjectWidgetasObjectWidget () const
 
const PackageWidgetasPackageWidget () const
 
const PinWidgetasPinWidget () const
 
const PinPortBaseasPinPortBase () const
 
const PortWidgetasPortWidget () const
 
const PreconditionWidgetasPreconditionWidget () const
 
const RegionWidgetasRegionWidget () const
 
const SignalWidgetasSignalWidget () const
 
const StateWidgetasStateWidget () const
 
const FloatingTextWidgetasFloatingTextWidget () const
 
const UseCaseWidgetasUseCaseWidget () const
 
const UMLWidgetasUMLWidget () const
 
- Public Member Functions inherited from DiagramProxyWidget
 DiagramProxyWidget (UMLWidget *widget, qreal borderWidth=5)
 
virtual ~DiagramProxyWidget ()
 
Uml::ID::Type diagramLink () const
 
UMLScenelinkedDiagram () const
 
bool setDiagramLink (const Uml::ID::Type &id)
 
const QRectF & clientRect () const
 
const QRectF & sceneRect () const
 
void setClientRect (const QRectF &rect)
 
bool isProxyWidget () const
 
UMLWidgetgetProxiedWidget (const QPointF &p) const
 
QPointF mapFromClient (const QPointF &p) const
 
QRectF mapFromClient (const QRectF &r) const
 
QPointF mapToClient (const QPointF &pos) const
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 
bool showLinkedDiagram () const
 
void setShowLinkedDiagram (bool showLinkedDiagram)
 
QRectF iconRect () const
 
void setIconRect (const QRectF &iconRect)
 

Static Public Attributes

static const QSizeF DefaultMinimumSize
 
static const QSizeF DefaultMaximumSize
 
static const int defaultMargin = 5
 
static const int selectionMarkerSize = 4
 
static const int resizeMarkerLineCount = 3
 

Protected Member Functions

virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 
virtual void moveEvent (QGraphicsSceneMouseEvent *event)
 
virtual void moveWidgetBy (qreal diffX, qreal diffY)
 
virtual void constrainMovementForAllWidgets (qreal &diffX, qreal &diffY)
 
virtual void constrain (qreal &width, qreal &height)
 
virtual bool isInResizeArea (QGraphicsSceneMouseEvent *me)
 
virtual QCursor resizeCursor () const
 
void selectSingle (QGraphicsSceneMouseEvent *me)
 
void selectMultiple (QGraphicsSceneMouseEvent *me)
 
void deselect (QGraphicsSceneMouseEvent *me)
 
void setSelectionBounds ()
 
void resize (QGraphicsSceneMouseEvent *me)
 
bool wasSizeChanged ()
 
bool wasPositionChanged ()
 
virtual void toForeground ()
 
void addConnectedWidget (UMLWidget *widget, Uml::AssociationType::Enum type=Uml::AssociationType::Association, AddWidgetOptions options=Default)
 
void addConnectedUMLObject (UMLObject::ObjectType otype, Uml::AssociationType::Enum type)
 
void addWidget (UMLWidget *widget, bool showProperties=true)
 
- Protected Member Functions inherited from QGraphicsObjectWrapper
QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 
- Protected Member Functions inherited from DiagramProxyWidget
DiagramProxyWidgetoperator= (const DiagramProxyWidget &other)
 
bool activate (IDChangeLog *changeLog=0)
 
bool loadFromXMI (QDomElement &qElement)
 
void saveToXMI (QXmlStreamWriter &writer)
 
void setupEvent (QGraphicsSceneMouseEvent &e, const QGraphicsSceneMouseEvent *event, const QPointF &pos) const
 
void setupEvent (QGraphicsSceneContextMenuEvent &e, const QGraphicsSceneContextMenuEvent *event, const QPointF &pos) const
 
void slotMenuSelection (QAction *action)
 

Protected Attributes

QString m_instanceName
 instance name (used if on a deployment diagram) More...
 
bool m_isInstance
 holds whether this widget is a component instance (i.e. on a deployment diagram) More...
 
Uml::ShowStereoType::Enum m_showStereotype
 if and how the stereotype should be displayed More...
 
bool m_startMove
 
QPointF m_startMovePostion
 
QSizeF m_startResizeSize
 
int m_nPosX
 
UMLDocm_doc
 shortcut for UMLApp::app()->document() More...
 
bool m_resizable
 
QFontMetrics * m_pFontMetrics [FT_INVALID]
 
QSizeF m_minimumSize
 
QSizeF m_maximumSize
 
bool m_activated
 true if the activate function has been called for this class instance More...
 
bool m_ignoreSnapToGrid
 
bool m_ignoreSnapComponentSizeToGrid
 
bool m_fixedAspectRatio
 
QString m_oldStatusBarMsg
 The text in the status bar when the cursor was pressed. More...
 
QPointF m_pressOffset
 
QPointF m_oldPos
 The X/Y position the widget had when the movement started. More...
 
qreal m_oldW
 The width/height the widget had when the resize started. More...
 
qreal m_oldH
 
bool m_shiftPressed
 If shift or control button were pressed in mouse press event. More...
 
bool m_inMoveArea
 
bool m_inResizeArea
 
bool m_moved
 
bool m_resized
 
- Protected Attributes inherited from WidgetBase
UMLScenem_scene
 
QPointer< UMLObjectm_umlObject
 
QString m_Doc
 Only used if m_umlObject is not set. More...
 
QString m_Text
 
QRectF m_rect
 Widget size. In this rectangle, the x and y coordinates are always 0. More...
 
Uml::ID::Type m_nId
 
Uml::ID::Type m_nLocalID
 
QColor m_textColor
 Color of the text of the widget. Is saved to XMI. More...
 
QColor m_lineColor
 Color of the lines of the widget. Is saved to XMI. More...
 
QColor m_fillColor
 color of the background of the widget More...
 
QBrush m_brush
 
QFont m_font
 
uint m_lineWidth
 Width of the lines of the widget. Is saved to XMI. More...
 
bool m_useFillColor
 flag indicates if the UMLWidget uses the Diagram FillColour More...
 
bool m_usesDiagramFillColor
 
bool m_usesDiagramLineColor
 
bool m_usesDiagramLineWidth
 
bool m_usesDiagramTextColor
 
bool m_usesDiagramUseFillColor
 
bool m_autoResize
 
bool m_changesShape
 The widget changes its shape when the number of connections or their positions are changed. More...
 
- Protected Attributes inherited from QGraphicsObjectWrapper
bool m_calledFromItemChange {false}
 

Private Member Functions

void init ()
 

Private Attributes

AssociationWidgetList m_Assocs
 A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram. More...
 

Friends

class ToolBarStateArrow
 

Additional Inherited Members

- Static Public Member Functions inherited from WidgetBase
static QString toString (WidgetType wt)
 
static QString toI18nString (WidgetType wt)
 
static Icon_Utils::IconType toIcon (WidgetType wt)
 
static bool widgetHasUMLObject (WidgetBase::WidgetType type)
 

Detailed Description

The base class for graphical UML objects.

This is the base class for nearly all graphical widgets.

Author
Paul Hensgen phens.nosp@m.gen@.nosp@m.techi.nosp@m.e.co.nosp@m.m Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

Member Enumeration Documentation

◆ AddWidgetOption

Enumerator
NoOption 
SetupSize 
SwitchDirection 
ShowProperties 
Default 

◆ FontType

Enumerator
FT_NORMAL 
FT_BOLD 
FT_ITALIC 
FT_UNDERLINE 
FT_BOLD_ITALIC 
FT_BOLD_UNDERLINE 
FT_ITALIC_UNDERLINE 
FT_BOLD_ITALIC_UNDERLINE 
FT_INVALID 

Constructor & Destructor Documentation

◆ UMLWidget() [1/2]

UMLWidget::UMLWidget ( UMLScene scene,
WidgetType  type = wt_UMLWidget,
UMLObject o = 0 
)
explicit

Creates a UMLWidget object.

Parameters
sceneThe view to be displayed on.
typeThe WidgetType to construct. This must be set to the appropriate value by the constructors of inheriting classes.
oThe UMLObject to represent.
Note
Although a pointer to the scene is required, the widget is not added to the scene by default.
Here is the call graph for this function:

◆ UMLWidget() [2/2]

UMLWidget::UMLWidget ( UMLScene scene,
WidgetType  type = wt_UMLWidget,
Uml::ID::Type  id = Uml::ID::None 
)
explicit

Creates a UMLWidget object.

Parameters
sceneThe view to be displayed on.
typeThe WidgetType to construct. This must be set to the appropriate value by the constructors of inheriting classes.
idThe id of the widget. The default value (id_None) will prompt generation of a new ID.
Here is the call graph for this function:

◆ ~UMLWidget()

UMLWidget::~UMLWidget ( )
virtual

Destructor.

Here is the call graph for this function:

Member Function Documentation

◆ activate()

bool UMLWidget::activate ( IDChangeLog changeLog = 0)
virtual

Reimplemented from WidgetBase

Reimplemented from WidgetBase.

Reimplemented in CombinedFragmentWidget, FloatingTextWidget, ObjectWidget, PinPortBase, MessageWidget, and PreconditionWidget.

Here is the call graph for this function:

◆ addAssoc()

void UMLWidget::addAssoc ( AssociationWidget pAssoc)
virtual

Reimplemented from class WidgetBase

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ addConnectedUMLObject()

void UMLWidget::addConnectedUMLObject ( UMLObject::ObjectType  otype,
Uml::AssociationType::Enum  type 
)
protected

◆ addConnectedWidget()

void UMLWidget::addConnectedWidget ( UMLWidget widget,
Uml::AssociationType::Enum  type = Uml::AssociationType::Association,
AddWidgetOptions  options = Default 
)
protected

Adds a widget to the diagram, which is connected to the current widget

Parameters
widgetwidget instance to add to diagram
typeassociation type
optionswidget options
Here is the call graph for this function:

◆ addWidget()

void UMLWidget::addWidget ( UMLWidget widget,
bool  showProperties = true 
)
protected

Adds a widget to the diagram, which is connected to the current widget

Parameters
widgetwidget instance to add to diagram
showPropertieswhether to show properties of the widget
Here is the call graph for this function:

◆ adjustAssocs()

void UMLWidget::adjustAssocs ( qreal  dx,
qreal  dy 
)
virtual

Adjusts associations with the given co-ordinates

Parameters
dxThe amount by which the widget moved in X direction.
dyThe amount by which the widget moved in Y direction.
Todo:
avoid trigger of this event during load

Reimplemented in ComponentWidget.

Here is the call graph for this function:

◆ adjustUnselectedAssocs()

void UMLWidget::adjustUnselectedAssocs ( qreal  dx,
qreal  dy 
)
virtual

Adjusts all unselected associations with the given co-ordinates

Parameters
dxThe amount by which the widget moved in X direction.
dyThe amount by which the widget moved in Y direction.

Reimplemented in ComponentWidget.

Here is the call graph for this function:

◆ associationWidgetList()

AssociationWidgetList & UMLWidget::associationWidgetList ( ) const

Returns the list of associations connected to this widget.

◆ calculateSize()

QSizeF UMLWidget::calculateSize ( bool  withExtensions = true) const
virtual

calculate content related size of widget.

Returns
calculated widget size

Reimplemented in ClassifierWidget, EntityWidget, and NoteWidget.

Here is the call graph for this function:

◆ cleanup()

void UMLWidget::cleanup ( )
virtual

Used to cleanup any other widget it may need to delete. Used by child classes. This should be called before deleting a widget of a diagram.

Reimplemented in CombinedFragmentWidget, MessageWidget, and ObjectWidget.

◆ clipSize()

void UMLWidget::clipSize ( )

clip the size of this widget against the minimal and maximal limits.

Here is the call graph for this function:

◆ constrain()

void UMLWidget::constrain ( qreal &  width,
qreal &  height 
)
protectedvirtual

Apply possible constraints to the given candidate width and height. The default implementation limits input values to the bounds returned by minimumSize()/maximumSize().

Parameters
widthinput value, may be modified by the constraint
heightinput value, may be modified by the constraint

Reimplemented in ActivityWidget, and ForkJoinWidget.

Here is the call graph for this function:

◆ constrainMovementForAllWidgets()

void UMLWidget::constrainMovementForAllWidgets ( qreal &  diffX,
qreal &  diffY 
)
protectedvirtual

Modifies the value of the diffX and diffY variables used to move the widgets.

It can be overridden to constrain movement of all the selected widgets only in one axis even when the user isn't constraining the movement with shift or control buttons, for example. The difference with moveWidgetBy is that the diff positions used here are applied to all the selected widgets instead of only to m_widget, and that moveWidgetBy, in fact, moves the widget, and here simply the diff positions are modified.

Default behaviour is do nothing.

See also
moveWidgetBy
Parameters
diffXThe difference between current X position and new X position.
diffYThe difference between current Y position and new Y position.

Reimplemented in FloatingTextWidget, MessageWidget, and ObjectWidget.

◆ contextMenuEvent()

void UMLWidget::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protectedvirtual

Event handler for context menu events.

Reimplemented from DiagramProxyWidget.

Reimplemented in StateWidget.

Here is the call graph for this function:

◆ deselect()

void UMLWidget::deselect ( QGraphicsSceneMouseEvent *  me)
protected

Deselects the widget and removes it from the list of selected widgets.

Parameters
meThe QGraphicsSceneMouseEvent which made the selection.
Here is the call graph for this function:

◆ fixedAspectRatio()

bool UMLWidget::fixedAspectRatio ( ) const
inline

◆ forceUpdateFontMetrics() [1/2]

void UMLWidget::forceUpdateFontMetrics ( QFont &  font,
QPainter *  painter 
)
Note
For performance Reasons, only FontMetrics for already used font types are updated. Not yet used font types will not get a font metric and will get the same font metric as if painter was zero. This behaviour is acceptable, because diagrams will always be shown on Display first before a special painter like a printer device is used.
Here is the call graph for this function:

◆ forceUpdateFontMetrics() [2/2]

void UMLWidget::forceUpdateFontMetrics ( QPainter *  painter)

Updates font metrics for widgets current m_font

Here is the call graph for this function:

◆ getFontMetrics()

QFontMetrics & UMLWidget::getFontMetrics ( UMLWidget::FontType  fontType) const

Returns the font metric used by this object for Text which uses bold/italic fonts.

◆ getIgnoreSnapToGrid()

bool UMLWidget::getIgnoreSnapToGrid ( ) const

Return the value of m_ignoreSnapToGrid.

◆ getPos()

QPointF UMLWidget::getPos ( ) const
virtual

Gets the position. Currently, the only class that reimplements this method is PinPortBase.

Returns
The QGraphicsObject position.

Reimplemented in PinPortBase.

◆ getStartMove()

bool UMLWidget::getStartMove ( ) const
inline

Returns whether we triggered the update of position movement. If so, you probably don't want to move it.

Returns
The moving state.

◆ getX()

qreal UMLWidget::getX ( ) const
virtual

Gets the x-coordinate. Currently, the only class that reimplements this method is PinPortBase.

Returns
The x-coordinate.

Reimplemented in PinPortBase.

◆ getY()

qreal UMLWidget::getY ( ) const
virtual

Gets the y-coordinate. Currently, the only class that reimplements this method is PinPortBase.

Returns
The y-coordinate.

Reimplemented in PinPortBase.

◆ height()

qreal UMLWidget::height ( ) const
inline

Returns the height of widget.

Here is the call graph for this function:

◆ init()

void UMLWidget::init ( )
private

Initializes key attributes of the class.

Here is the call graph for this function:

◆ instanceName()

QString UMLWidget::instanceName ( ) const
inline

Read property of m_instanceName

◆ isActivated()

bool UMLWidget::isActivated ( ) const

Returns true if the Activate method has been called for this instance

Returns
The activate status.

◆ isInResizeArea()

bool UMLWidget::isInResizeArea ( QGraphicsSceneMouseEvent *  me)
protectedvirtual

Checks if the mouse is in resize area (right bottom corner), and sets the cursor depending on that. The cursor used when resizing is gotten from resizeCursor().

Parameters
meThe QMouseEVent to check.
Returns
true if the mouse is in resize area, false otherwise.

Reimplemented in MessageWidget.

Here is the call graph for this function:

◆ isInstance()

bool UMLWidget::isInstance ( ) const
inline

Read property of bool m_isInstance

◆ isLocatedIn()

bool UMLWidget::isLocatedIn ( const UMLWidget other) const
virtual

Return true if `this' is located in the bounding rectangle of `other'.

Here is the call graph for this function:

◆ loadFromXMI()

bool UMLWidget::loadFromXMI ( QDomElement &  qElement)
virtual

A virtual method to load the properties of this widget from a QDomElement into this widget.

Subclasses should reimplement this to load additional properties required, calling this base method to load the basic properties of the widget.

Parameters
qElementA QDomElement which contains xml info for this widget.
Todo:
Add support to load older version.

Reimplemented from WidgetBase.

Reimplemented in ActivityWidget, ClassifierWidget, CombinedFragmentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, and StateWidget.

Here is the call graph for this function:

◆ maximumSize()

QSizeF UMLWidget::maximumSize ( )
virtual

Compute the maximum possible width and height.

Returns
maximum size

Reimplemented in ActivityWidget, and StateWidget.

◆ minimumSize()

QSizeF UMLWidget::minimumSize ( ) const
virtual

◆ mouseDoubleClickEvent()

void UMLWidget::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Event handler for mouse double click events.

Parameters
eventthe QGraphicsSceneMouseEvent event.

Reimplemented from DiagramProxyWidget.

Reimplemented in ClassifierWidget, NoteWidget, and StateWidget.

Here is the call graph for this function:

◆ mouseMoveEvent()

void UMLWidget::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Handles a mouse move event. It resizes or moves the widget, depending on where the cursor is pressed on the widget. Go on reading for more info about this.

If resizing, the widget is resized using UMLWidget::resizeWidget (where specific widget resize constraint can be applied), and then the associations are adjusted. The resizing can be constrained also to a specific axis using control and shift buttons. If one or another is pressed, it's constrained to X axis. If both are pressed, it's constrained to Y axis.

If not resizing, the widget is being moved. If the move is being started, the selection bounds are set (which includes updating the list of selected widgets). The difference between the previous position of the selection and the new one is calculated (taking in account the selection bounds so widgets don't go beyond the scene limits). Then, it's constrained to X or Y axis depending on shift and control buttons. A further constraint is made using constrainMovementForAllWidgets (for example, if the widget that receives the event can only be moved in Y axis, with this method the movement of all the widgets in the selection can be constrained to be moved only in Y axis). Then, all the selected widgets are moved using moveWidgetBy (where specific widget movement constraint can be applied) and, if a certain amount of time passed from the last move event, the associations are also updated (they're not updated always to be easy on the CPU). Finally, the scene is resized, and selection bounds updated.

Parameters
eventThe QGraphicsSceneMouseEvent event.

Reimplemented from DiagramProxyWidget.

Reimplemented in StateWidget, ObjectWidget, and SignalWidget.

Here is the call graph for this function:

◆ mousePressEvent()

void UMLWidget::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Handles a mouse press event. It'll select the widget (or mark it to be deselected) and prepare it to be moved or resized. Go on reading for more info about this.

Widget values and message bar status are saved.

If shift or control buttons are pressed, we're in move area no matter where the button was pressed in the widget. Moreover, if the widget wasn't already selected, it's added to the selection. If already selected, it's marked to be deselected when releasing the button (provided it isn't moved). Also, if the widget is already selected with other widgets but shift nor control buttons are pressed, we're in move area. If finally we don't move the widget, it's selected and the other widgets deselected when releasing the left button.

If shift nor control buttons are pressed, we're facing a single selection. Depending on the position of the cursor, we're in move or in resize area. If the widget wasn't selected (both when there are no widgets selected, or when there're other widgets selected but not the one receiving the press event) it's selected and the others deselected, if any. If already selected, it's marked to be deselected when releasing the button (provided it wasn't moved or resized).

Parameters
eventThe QGraphicsSceneMouseEvent event.

Reimplemented from DiagramProxyWidget.

Reimplemented in StateWidget, and ObjectWidget.

Here is the call graph for this function:

◆ mouseReleaseEvent()

void UMLWidget::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Handles a mouse release event. It selects or deselects the widget and cancels or confirms the move or resize. Go on reading for more info about this. No matter which tool is selected, Z position of widget is updated.

Middle button release resets the selection. Left button release, if it wasn't moved nor resized, selects the widget and deselect the others if it wasn't selected and there were other widgets selected. If the widget was marked to be deselected, deselects it. If it was moved or resized, the document is set to modified if position or size changed. Also, if moved, all the associations are adjusted because the timer could have prevented the adjustment in the last move event before the release. If mouse was pressed in resize area, cursor is set again to normal cursor Right button release if right button was pressed shows the pop up menu for the widget. If left button was pressed, it cancels the move or resize with a mouse move event at the same position than the cursor was when pressed. Another left button release is also sent.

Parameters
eventThe QGraphicsSceneMouseEvent event.

Reimplemented from DiagramProxyWidget.

Reimplemented in StateWidget.

Here is the call graph for this function:

◆ moveByLocal()

void UMLWidget::moveByLocal ( qreal  dx,
qreal  dy 
)

Move the widget by an X and Y offset relative to the current position.

Here is the call graph for this function:

◆ moveEvent()

void UMLWidget::moveEvent ( QGraphicsSceneMouseEvent *  me)
protectedvirtual

Overrides the standard operation.

Parameters
meThe move event.

Reimplemented in ObjectWidget.

◆ moveWidgetBy()

void UMLWidget::moveWidgetBy ( qreal  diffX,
qreal  diffY 
)
protectedvirtual

Moves the widget to a new position using the difference between the current position and the new position. This method doesn't adjust associations. It only moves the widget.

It can be overridden to constrain movement only in one axis even when the user isn't constraining the movement with shift or control buttons, for example. The movement policy set here is applied whenever the widget is moved, being it moving it explicitly, or as a part of a selection but not receiving directly the mouse events.

Default behaviour is move the widget to the new position using the diffs.

See also
constrainMovementForAllWidgets
Parameters
diffXThe difference between current X position and new X position.
diffYThe difference between current Y position and new Y position.

Reimplemented in ActivityWidget, ComponentWidget, FloatingTextWidget, MessageWidget, ObjectWidget, and PinPortBase.

Here is the call graph for this function:

◆ notifyParentResize()

void UMLWidget::notifyParentResize ( )
virtual

Notify child widget about parent resizes. Child widgets can override this function to move when their parent is resized.

Reimplemented in PinPortBase.

◆ operator=()

UMLWidget & UMLWidget::operator= ( const UMLWidget other)

Assignment operator

Here is the call graph for this function:

◆ operator==()

bool UMLWidget::operator== ( const UMLWidget other) const

Overload '==' operator

Here is the call graph for this function:

◆ paint()

void UMLWidget::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtual

Draws the UMLWidget on the given paint device

Parameters
painterThe painter for the drawing device
optionPainting related options
widgetBackground widget on which to paint (optional)

Reimplemented from WidgetBase.

Reimplemented in ActivityWidget, ActorWidget, ArtifactWidget, BoxWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, UseCaseWidget, and FloatingDashLineWidget.

Here is the call graph for this function:

◆ removeAssoc()

void UMLWidget::removeAssoc ( AssociationWidget pAssoc)
virtual

Reimplemented from class WidgetBase

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ resizable()

bool UMLWidget::resizable ( ) const
inline

◆ resize() [1/2]

void UMLWidget::resize ( )

Resize widget to minimum size.

Here is the call graph for this function:

◆ resize() [2/2]

void UMLWidget::resize ( QGraphicsSceneMouseEvent *  me)
protected

Resizes the widget and adjusts the associations. It's called when a mouse move event happens and the cursor was in resize area when pressed. Resizing can be constrained to an specific axis using control and shift buttons.

Parameters
meThe QGraphicsSceneMouseEvent to get the values from.
Here is the call graph for this function:

◆ resizeCursor()

QCursor UMLWidget::resizeCursor ( ) const
protectedvirtual

Returns the cursor to be shown when resizing the widget. Default cursor is KCursor::sizeFDiagCursor().

Returns
The cursor to be shown when resizing the widget.

Reimplemented in ObjectWidget.

◆ resizeWidget()

void UMLWidget::resizeWidget ( qreal  newW,
qreal  newH 
)
virtual

Resizes the widget. It's called from resize, after the values are constrained and before the associations are adjusted.

Default behaviour is resize the widget using the new size values.

See also
resize
Parameters
newWThe new width for the widget.
newHThe new height for the widget.

Reimplemented in MessageWidget, and ObjectWidget.

Here is the call graph for this function:

◆ saveToXMI()

void UMLWidget::saveToXMI ( QXmlStreamWriter &  writer)
virtual

A virtual method to save the properties of this widget into a QXmlStreamWriter i.e. XML.

Subclasses should first create a new dedicated element as the child of qElement parameter passed. Then this base method should be called to save basic widget properties.

Parameters
writerThe QXmlStreamWriter to write to.

Reimplemented from WidgetBase.

Reimplemented in ActivityWidget, ActorWidget, ArtifactWidget, BoxWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, and UseCaseWidget.

Here is the call graph for this function:

◆ selectMultiple()

void UMLWidget::selectMultiple ( QGraphicsSceneMouseEvent *  me)
protected

Selects the widget and adds it to the list of selected widgets.

Parameters
meThe QGraphicsSceneMouseEvent which made the selection.
Here is the call graph for this function:

◆ selectSingle()

void UMLWidget::selectSingle ( QGraphicsSceneMouseEvent *  me)
protected

Selects the widget and clears the other selected widgets, if any.

Parameters
meThe QGraphicsSceneMouseEvent which made the selection.
Here is the call graph for this function:

◆ setActivated()

void UMLWidget::setActivated ( bool  active = true)

Set the m_activated flag of a widget but does not perform the Activate method

Parameters
activeStatus of activation is to be set.

◆ setDefaultFontMetrics() [1/2]

void UMLWidget::setDefaultFontMetrics ( QFont &  font,
UMLWidget::FontType  fontType 
)
virtual

Template Method, override this to set the default font metric.

Here is the call graph for this function:

◆ setDefaultFontMetrics() [2/2]

void UMLWidget::setDefaultFontMetrics ( QFont &  font,
UMLWidget::FontType  fontType,
QPainter &  painter 
)
virtual

Template Method, override this to set the default font metric.

Here is the call graph for this function:

◆ setFillColor()

void UMLWidget::setFillColor ( const QColor &  color)
virtual

Sets the background fill color

Parameters
colorthe new fill color

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setFillColorCmd()

void UMLWidget::setFillColorCmd ( const QColor &  color)

Sets the background fill color

Parameters
colorthe new fill color
Here is the call graph for this function:

◆ setFixedAspectRatio()

void UMLWidget::setFixedAspectRatio ( bool  state)
inline

◆ setFont()

void UMLWidget::setFont ( const QFont &  font)
virtual

Sets the font the widget is to use.

Parameters
fontFont to be set.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setFontCmd()

void UMLWidget::setFontCmd ( const QFont &  font)

Sets the font the widget is to use.

Parameters
fontFont to be set.
Here is the call graph for this function:

◆ setFontMetrics()

void UMLWidget::setFontMetrics ( UMLWidget::FontType  fontType,
QFontMetrics  fm 
)

Set the font metric to use.

◆ setIgnoreSnapToGrid()

void UMLWidget::setIgnoreSnapToGrid ( bool  to)

Set m_ignoreSnapToGrid.

◆ setInstanceName()

void UMLWidget::setInstanceName ( const QString &  instanceName)
inline

Write property of m_instanceName

Here is the call graph for this function:

◆ setIsInstance()

void UMLWidget::setIsInstance ( bool  isInstance)
inline

Write property of bool m_isInstance

Here is the call graph for this function:

◆ setLineColor()

void UMLWidget::setLineColor ( const QColor &  color)
virtual

Overrides the method from WidgetBase.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setLineColorCmd()

void UMLWidget::setLineColorCmd ( const QColor &  color)
virtual

Overrides the method from WidgetBase.

Reimplemented in ObjectWidget.

Here is the call graph for this function:

◆ setLineWidth()

void UMLWidget::setLineWidth ( uint  width)
virtual

Overrides the method from WidgetBase, execute CmdChangeLineWidth

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setLineWidthCmd()

void UMLWidget::setLineWidthCmd ( uint  width)

Overrides the method from WidgetBase.

Here is the call graph for this function:

◆ setMaximumSize()

void UMLWidget::setMaximumSize ( const QSizeF &  newSize)

This method is used to set the maximum size variable for this widget.

Parameters
newSizeThe size being set as maximum.

◆ setMinimumSize()

void UMLWidget::setMinimumSize ( const QSizeF &  newSize)

This method is used to set the minimum size variable for this widget.

Parameters
newSizeThe size being set as minimum.

◆ setPenFromSettings() [1/2]

void UMLWidget::setPenFromSettings ( QPainter &  p)

Set the pen.

◆ setPenFromSettings() [2/2]

void UMLWidget::setPenFromSettings ( QPainter *  p)

Set the pen.

◆ setResizable()

void UMLWidget::setResizable ( bool  state)
inline

◆ setScene()

void UMLWidget::setScene ( UMLScene scene)

Clears the selection, resets the toolbar and deselects the widget.

Sets the view the widget is on.

Parameters
sceneThe UMLScene the widget is on.
Here is the call graph for this function:

◆ setSelected()

void UMLWidget::setSelected ( bool  _select)
virtual

Sets the state of whether the widget is selected.

Parameters
_selectThe state of whether the widget is selected.

Reimplemented from WidgetBase.

Reimplemented in MessageWidget, and ObjectWidget.

Here is the call graph for this function:

◆ setSelectedFlag()

void UMLWidget::setSelectedFlag ( bool  _select)
Here is the call graph for this function:

◆ setSelectionBounds()

void UMLWidget::setSelectionBounds ( )
protected

Fills m_selectedWidgetsList and sets the selection bounds ((m_min/m_max)X/Y attributes).

◆ setShowStereotype()

void UMLWidget::setShowStereotype ( Uml::ShowStereoType::Enum  flag)
virtual

Set the status of whether to show Stereotype.

Parameters
flagValue of type Uml::ShowStereoType::Enum

Reimplemented in ClassifierWidget.

Here is the call graph for this function:

◆ setSize() [1/2]

void UMLWidget::setSize ( const QSizeF &  size)

Sets the size with another size.

Here is the call graph for this function:

◆ setSize() [2/2]

void UMLWidget::setSize ( qreal  width,
qreal  height 
)

Sets the size. If m_scene->snapComponentSizeToGrid() is true then set the next larger size that snaps to the grid.

Here is the call graph for this function:

◆ setStartMovePosition()

void UMLWidget::setStartMovePosition ( const QPointF &  position)

Set the start position of the move action.

Parameters
positionpoint where the move began

◆ setTextColor()

void UMLWidget::setTextColor ( const QColor &  color)
virtual

Overrides the method from WidgetBase.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setTextColorCmd()

void UMLWidget::setTextColorCmd ( const QColor &  color)

Overrides the method from WidgetBase.

Here is the call graph for this function:

◆ setupFontType()

void UMLWidget::setupFontType ( QFont &  font,
UMLWidget::FontType  fontType 
)
Here is the call graph for this function:

◆ setUseFillColor()

void UMLWidget::setUseFillColor ( bool  fc)
virtual

Set the status of using fill color (undo action)

Parameters
fcthe status of using fill color.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setUseFillColorCmd()

void UMLWidget::setUseFillColorCmd ( bool  fc)

Set the status of using fill color.

Parameters
fcthe status of using fill color.
Here is the call graph for this function:

◆ setX()

void UMLWidget::setX ( qreal  x)
virtual

Sets the x-coordinate. Currently, the only class that reimplements this method is ObjectWidget.

Parameters
xThe x-coordinate to be set.

Reimplemented in SignalWidget, and ObjectWidget.

Here is the call graph for this function:

◆ setY()

void UMLWidget::setY ( qreal  y)
virtual

Sets the y-coordinate. Currently, the only class that reimplements this method is ObjectWidget.

Parameters
yThe y-coordinate to be set.

Reimplemented in SignalWidget, FloatingDashLineWidget, MessageWidget, and ObjectWidget.

Here is the call graph for this function:

◆ showPropertiesDialog()

bool UMLWidget::showPropertiesDialog ( )
virtual

Show a properties dialog for a UMLWidget.

Reimplemented from WidgetBase.

Reimplemented in ActivityWidget, BoxWidget, ClassifierWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, SignalWidget, and StateWidget.

Here is the call graph for this function:

◆ showStereotype()

Uml::ShowStereoType::Enum UMLWidget::showStereotype ( ) const

Returns the status of whether to show Stereotype.

Returns
True if stereotype is shown.

◆ sigWidgetMoved

void UMLWidget::sigWidgetMoved ( Uml::ID::Type  id)
signal

Emit when the widget moves its' position.

Parameters
idThe id of the object behind the widget.

◆ slotFillColorChanged

void UMLWidget::slotFillColorChanged ( Uml::ID::Type  viewID)
virtualslot

Captures a color change signal.

Parameters
viewIDThe id of the UMLScene behind the widget.
Here is the call graph for this function:

◆ slotLineColorChanged

void UMLWidget::slotLineColorChanged ( Uml::ID::Type  viewID)
virtualslot

Captures a line color change signal.

Parameters
viewIDThe id of the UMLScene behind the widget.
Here is the call graph for this function:

◆ slotLineWidthChanged

void UMLWidget::slotLineWidthChanged ( Uml::ID::Type  viewID)
virtualslot

Captures a linewidth change signal.

Parameters
viewIDThe id of the UMLScene behind the widget.
Here is the call graph for this function:

◆ slotMenuSelection

void UMLWidget::slotMenuSelection ( QAction *  trigger)
virtualslot

This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMenu which can be used to get the type of action of trigger.

Note
Subclasses can reimplement to handle specific actions and leave the rest to WidgetBase::slotMenuSelection.

Reimplemented in FloatingDashLineWidget.

Here is the call graph for this function:

◆ slotSnapToGrid

void UMLWidget::slotSnapToGrid ( )
slot

Tells the widget to snap to grid. Will use the grid settings of the UMLView it belongs to.

Here is the call graph for this function:

◆ slotTextColorChanged

void UMLWidget::slotTextColorChanged ( Uml::ID::Type  viewID)
virtualslot

Captures a text color change signal.

Parameters
viewIDThe id of the UMLScene behind the widget.
Here is the call graph for this function:

◆ slotWidgetMoved

void UMLWidget::slotWidgetMoved ( Uml::ID::Type  id)
virtualslot

Captures when another widget moves if this widget is linked to it.

See also
sigWidgetMoved
Parameters
idThe id of object behind the widget.

◆ startMovePosition()

QPointF UMLWidget::startMovePosition ( ) const

Return the start position of the move action.

Returns
point where the move began

◆ startResizeSize()

QSizeF UMLWidget::startResizeSize ( ) const

Return the start size of the resize action.

Returns
size where the resize began

◆ tags()

QString UMLWidget::tags ( ) const

Return stereotype concrete attributes concatenated into single string with the attribute name given before each value and delimited by "{" at start and "}" at end. Example: For a stereotype with attribute 'foo' of type Double and attribute 'bar' of type String and concrete values 1.0 for 'foo' and "hello" for 'bar', the result is: {foo=1.0,bar="hello"}

Here is the call graph for this function:

◆ toForeground()

void UMLWidget::toForeground ( )
protectedvirtual

Bring the widget at the pressed position to the foreground.

Reimplemented in BoxWidget, and CombinedFragmentWidget.

Here is the call graph for this function:

◆ updateGeometry()

void UMLWidget::updateGeometry ( bool  withAssocs = true)

Update the size of this widget.

Parameters
withAssocstrue - update associations too
Here is the call graph for this function:

◆ updateWidget

void UMLWidget::updateWidget ( )
virtualslot

When a widget changes this slot captures that signal.

Reimplemented in PinPortBase.

Here is the call graph for this function:

◆ wasPositionChanged()

bool UMLWidget::wasPositionChanged ( )
protected

Checks if the position of the widget changed respect to the position that it had when press event was fired.

Returns
true if was moved, false otherwise.

◆ wasSizeChanged()

bool UMLWidget::wasSizeChanged ( )
protected

Checks if the size of the widget changed respect to the size that it had when press event was fired.

Returns
true if was resized, false otherwise.
Here is the call graph for this function:

◆ width()

qreal UMLWidget::width ( ) const
inline

Returns the width of the widget.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ToolBarStateArrow

friend class ToolBarStateArrow
friend

Member Data Documentation

◆ defaultMargin

const int UMLWidget::defaultMargin = 5
static

◆ DefaultMaximumSize

const QSizeF UMLWidget::DefaultMaximumSize
static

◆ DefaultMinimumSize

const QSizeF UMLWidget::DefaultMinimumSize
static

◆ m_activated

bool UMLWidget::m_activated
protected

true if the activate function has been called for this class instance

◆ m_Assocs

AssociationWidgetList UMLWidget::m_Assocs
mutableprivate

A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram.

◆ m_doc

UMLDoc* UMLWidget::m_doc
protected

shortcut for UMLApp::app()->document()

◆ m_fixedAspectRatio

bool UMLWidget::m_fixedAspectRatio
protected

◆ m_ignoreSnapComponentSizeToGrid

bool UMLWidget::m_ignoreSnapComponentSizeToGrid
protected

◆ m_ignoreSnapToGrid

bool UMLWidget::m_ignoreSnapToGrid
protected

Change Widget Behaviour

◆ m_inMoveArea

bool UMLWidget::m_inMoveArea
protected

If cursor was in move/resize area when left button was pressed (and no other widgets were selected).

◆ m_inResizeArea

bool UMLWidget::m_inResizeArea
protected

◆ m_instanceName

QString UMLWidget::m_instanceName
protected

instance name (used if on a deployment diagram)

◆ m_isInstance

bool UMLWidget::m_isInstance
protected

holds whether this widget is a component instance (i.e. on a deployment diagram)

◆ m_maximumSize

QSizeF UMLWidget::m_maximumSize
protected

◆ m_minimumSize

QSizeF UMLWidget::m_minimumSize
protected

◆ m_moved

bool UMLWidget::m_moved
protected

If the widget was selected/moved/resized in the press and release cycle. Moved/resized is true if the widget was moved/resized even if the final position/size is the same as the starting one.

◆ m_nPosX

int UMLWidget::m_nPosX
protected

◆ m_oldH

qreal UMLWidget::m_oldH
protected

◆ m_oldPos

QPointF UMLWidget::m_oldPos
protected

The X/Y position the widget had when the movement started.

◆ m_oldStatusBarMsg

QString UMLWidget::m_oldStatusBarMsg
protected

The text in the status bar when the cursor was pressed.

◆ m_oldW

qreal UMLWidget::m_oldW
protected

The width/height the widget had when the resize started.

◆ m_pFontMetrics

QFontMetrics* UMLWidget::m_pFontMetrics[FT_INVALID]
protected

◆ m_pressOffset

QPointF UMLWidget::m_pressOffset
protected

The X/Y offset from the position of the cursor when it was pressed to the upper left corner of the widget.

◆ m_resizable

bool UMLWidget::m_resizable
protected

◆ m_resized

bool UMLWidget::m_resized
protected

◆ m_shiftPressed

bool UMLWidget::m_shiftPressed
protected

If shift or control button were pressed in mouse press event.

◆ m_showStereotype

Uml::ShowStereoType::Enum UMLWidget::m_showStereotype
protected

if and how the stereotype should be displayed

◆ m_startMove

bool UMLWidget::m_startMove
protected

◆ m_startMovePostion

QPointF UMLWidget::m_startMovePostion
protected

◆ m_startResizeSize

QSizeF UMLWidget::m_startResizeSize
protected

◆ resizeMarkerLineCount

const int UMLWidget::resizeMarkerLineCount = 3
static

◆ selectionMarkerSize

const int UMLWidget::selectionMarkerSize = 4
static

The documentation for this class was generated from the following files: