umbrello/umbrello
#include <umlwidget.h>
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 } |
Public Types inherited from WidgetBase | |
enum | WidgetType { wt_UMLWidget = 300, 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 } |
Public Slots | |
void | slotClearAllSelected () |
virtual void | slotFillColorChanged (Uml::ID::Type viewID) |
virtual void | slotLineColorChanged (Uml::ID::Type viewID) |
virtual void | slotLineWidthChanged (Uml::ID::Type viewID) |
virtual void | slotMenuSelection (QAction *action) |
void | slotSnapToGrid () |
virtual void | slotTextColorChanged (Uml::ID::Type viewID) |
virtual void | slotWidgetMoved (Uml::ID::Type id) |
virtual void | updateWidget () |
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 () |
virtual bool | activate (IDChangeLog *ChangeLog=0) |
void | addAssoc (AssociationWidget *pAssoc) |
virtual void | adjustAssocs (qreal dx, qreal dy) |
void | adjustUnselectedAssocs (qreal dx, qreal dy) |
AssociationWidgetList & | associationWidgetList () |
virtual QSizeF | calculateSize () |
virtual void | cleanup () |
void | clipSize () |
bool | fixedAspectRatio () const |
void | forceUpdateFontMetrics (QPainter *painter) |
QFontMetrics & | getFontMetrics (UMLWidget::FontType fontType) |
bool | getIgnoreSnapToGrid () const |
bool | getStartMove () const |
qreal | height () const |
QString | instanceName () const |
bool | isActivated () const |
bool | isInstance () const |
bool | isSelected () const |
virtual bool | loadFromXMI (QDomElement &qElement) |
virtual QSizeF | maximumSize () |
virtual QSizeF | minimumSize () |
void | moveByLocal (qreal dx, qreal dy) |
virtual qreal | onWidget (const QPointF &p) |
UMLWidget & | operator= (const UMLWidget &other) |
bool | operator== (const UMLWidget &other) const |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
void | removeAssoc (AssociationWidget *pAssoc) |
void | resize () |
virtual void | resizeWidget (qreal newW, qreal newH) |
virtual void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
void | setActivated (bool active=true) |
virtual void | setDefaultFontMetrics (UMLWidget::FontType fontType) |
virtual void | setDefaultFontMetrics (UMLWidget::FontType fontType, QPainter &painter) |
virtual void | setFillColor (const QColor &color) |
void | setFillColorcmd (const QColor &color) |
void | setFixedAspectRatio (bool state) |
virtual void | setFont (const QFont &font) |
void | setFontMetrics (UMLWidget::FontType fontType, QFontMetrics fm) |
void | setIgnoreSnapToGrid (bool to) |
void | setInstanceName (const QString &instanceName) |
void | setIsInstance (bool isInstance) |
virtual void | setLineColor (const QColor &color) |
void | setLineColorcmd (const QColor &color) |
virtual void | setLineWidth (uint width) |
void | setMaximumSize (const QSizeF &size) |
void | setMinimumSize (const QSizeF &size) |
void | setPenFromSettings (QPainter &p) |
void | setPenFromSettings (QPainter *p) |
void | setScene (UMLScene *scene) |
virtual void | setSelected (bool _select) |
void | setSelectedFlag (bool _select) |
virtual void | setShowStereotype (bool flag) |
void | setSize (qreal width, qreal height) |
void | setSize (const QSizeF &size) |
virtual void | setTextColor (const QColor &color) |
void | setTextColorcmd (const QColor &color) |
void | setupFontType (QFont &font, UMLWidget::FontType fontType) |
void | setUseFillColor (bool fc) |
virtual void | setX (qreal x) |
virtual void | setY (qreal y) |
virtual void | showPropertiesDialog () |
bool | showStereotype () const |
QPointF | startMovePosition () const |
QSizeF | startResizeSize () const |
void | updateGeometry () |
qreal | width () const |
Public Member Functions inherited from WidgetBase | |
WidgetBase (UMLScene *scene, WidgetType type=wt_UMLWidget) | |
virtual | ~WidgetBase () |
WidgetType | baseType () const |
QLatin1String | baseTypeStr () const |
virtual QRectF | boundingRect () const |
QString | documentation () const |
QColor | fillColor () const |
virtual QFont | font () const |
bool | hasDocumentation () |
Uml::ID::Type | id () const |
QColor | lineColor () const |
uint | lineWidth () const |
QString | name () const |
WidgetBase & | operator= (const WidgetBase &other) |
QRectF | rect () const |
void | setDocumentation (const QString &doc) |
void | setID (Uml::ID::Type id) |
void | setName (const QString &strName) |
void | setRect (const QRectF &rect) |
void | setRect (qreal x, qreal y, qreal width, qreal height) |
virtual void | setUMLObject (UMLObject *obj) |
void | setUseFillColor (bool state) |
void | setUsesDiagramFillColor (bool state) |
void | setUsesDiagramLineColor (bool state) |
void | setUsesDiagramLineWidth (bool state) |
void | setUsesDiagramTextColor (bool state) |
void | setUsesDiagramUseFillColor (bool state) |
QColor | textColor () const |
UMLDoc * | umlDoc () const |
UMLObject * | umlObject () const |
UMLScene * | umlScene () const |
bool | useFillColor () |
bool | usesDiagramFillColor () const |
bool | usesDiagramLineColor () const |
bool | usesDiagramLineWidth () const |
bool | usesDiagramTextColor () const |
bool | usesDiagramUseFillColor () const |
Static Public Member Functions | |
static bool | widgetHasUMLObject (WidgetBase::WidgetType type) |
Static Public Member Functions inherited from WidgetBase | |
static QString | toString (WidgetType wt) |
Static Public Attributes | |
static const QSizeF | DefaultMaximumSize |
static const QSizeF | DefaultMinimumSize |
Protected Member Functions | |
virtual void | constrain (qreal &width, qreal &height) |
virtual void | constrainMovementForAllWidgets (qreal &diffX, qreal &diffY) |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
void | deselect (QGraphicsSceneMouseEvent *me) |
virtual bool | isInResizeArea (QGraphicsSceneMouseEvent *me) |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
virtual void | moveEvent (QGraphicsSceneMouseEvent *event) |
virtual void | moveWidgetBy (qreal diffX, qreal diffY) |
void | resize (QGraphicsSceneMouseEvent *me) |
virtual QCursor | resizeCursor () const |
void | selectMultiple (QGraphicsSceneMouseEvent *me) |
void | selectSingle (QGraphicsSceneMouseEvent *me) |
void | setSelectionBounds () |
bool | wasPositionChanged () |
bool | wasSizeChanged () |
Protected Member Functions inherited from WidgetBase | |
virtual void | setupContextMenuActions (ListPopupMenu &menu) |
Detailed Description
This is the base class for nearly all graphical widgets.
The base class for graphical UML objects.
Definition at line 40 of file umlwidget.h.
Member Enumeration Documentation
enum UMLWidget::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 |
Definition at line 219 of file umlwidget.h.
Constructor & Destructor Documentation
|
explicit |
Creates a UMLWidget object.
- Parameters
-
scene The view to be displayed on. o The UMLObject to represent.
Definition at line 55 of file umlwidget.cpp.
|
explicit |
Creates a UMLWidget object.
- Parameters
-
scene The view to be displayed on. id The id of the widget. The default value (id_None) will prompt generation of a new ID.
Definition at line 73 of file umlwidget.cpp.
|
virtual |
Destructor.
Definition at line 86 of file umlwidget.cpp.
Member Function Documentation
|
virtual |
Activate the object after serializing it from a QDataStream.
- Parameters
-
ChangeLog
- Returns
- true for success
Reimplemented in MessageWidget, FloatingTextWidget, ObjectWidget, and PreconditionWidget.
Definition at line 890 of file umlwidget.cpp.
void UMLWidget::addAssoc | ( | AssociationWidget * | pAssoc | ) |
Adds an already created association to the list of associations that include this UMLWidget.
Definition at line 976 of file umlwidget.cpp.
|
virtual |
Adjusts associations with the given co-ordinates.
- Parameters
-
x The x-coordinate. y The y-coordinate.
- Todo:
- avoid trigger of this event during load
Definition at line 1000 of file umlwidget.cpp.
void UMLWidget::adjustUnselectedAssocs | ( | qreal | dx, |
qreal | dy | ||
) |
Adjusts all unselected associations with the given co-ordinates.
- Parameters
-
x The x-coordinate. y The y-coordinate.
Definition at line 1030 of file umlwidget.cpp.
|
inline |
Returns the list of associations connected to this widget.
Definition at line 149 of file umlwidget.h.
|
virtual |
calculate content related size of widget.
- Returns
- calculated widget size
Reimplemented in NoteWidget.
Definition at line 1161 of file umlwidget.cpp.
|
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 MessageWidget, and ObjectWidget.
Definition at line 1391 of file umlwidget.cpp.
void UMLWidget::clipSize | ( | ) |
clip the size of this widget against the minimal and maximal limits.
Definition at line 1501 of file umlwidget.cpp.
|
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
-
width input value, may be modified by the constraint height input value, may be modified by the constraint
Reimplemented in ActivityWidget, and ForkJoinWidget.
Definition at line 617 of file umlwidget.cpp.
|
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
-
diffX The difference between current X position and new X position. diffY The difference between current Y position and new Y position.
Reimplemented in MessageWidget, ObjectWidget, and FloatingTextWidget.
Definition at line 270 of file umlwidget.cpp.
|
protectedvirtual |
Event handler for context menu events.
Reimplemented from WidgetBase.
Definition at line 225 of file umlwidget.cpp.
|
protected |
Deselects the widget and removes it from the list of selected widgets.
- Parameters
-
me The QGraphicsSceneMouseEvent which made the selection.
Definition at line 1328 of file umlwidget.cpp.
|
inline |
Definition at line 211 of file umlwidget.h.
void UMLWidget::forceUpdateFontMetrics | ( | 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 showed on Display first before a special painter like a printer device is used.
Definition at line 1657 of file umlwidget.cpp.
QFontMetrics & UMLWidget::getFontMetrics | ( | UMLWidget::FontType | fontType | ) |
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition at line 1619 of file umlwidget.cpp.
bool UMLWidget::getIgnoreSnapToGrid | ( | ) | const |
Return the value of m_ignoreSnapToGrid.
Definition at line 1442 of file umlwidget.cpp.
|
inline |
Returns whether we triggered the update of position movement.
If so, you probably don't want to move it.
- Returns
- The moving state.
Definition at line 112 of file umlwidget.h.
|
inline |
Returns the height of widget.
Definition at line 122 of file umlwidget.h.
|
inline |
Read property of m_instanceName.
Definition at line 177 of file umlwidget.h.
bool UMLWidget::isActivated | ( | ) | const |
Returns true if the Activate method has been called for this instance.
- Returns
- The activate status.
Definition at line 957 of file umlwidget.cpp.
|
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
-
me The QMouseEVent to check.
- Returns
- true if the mouse is in resize area, false otherwise.
Definition at line 1133 of file umlwidget.cpp.
|
inline |
Read property of bool m_isInstance.
Definition at line 156 of file umlwidget.h.
|
inline |
Returns the state of whether the widget is selected.
- Returns
- Returns the state of whether the widget is selected.
Definition at line 87 of file umlwidget.h.
|
virtual |
A virtual method to load the properties of this widget from a QDomElement into this widget.
Subclasses should reimplement this to load addtional properties required, calling this base method to load the basic properties of the widget.
- Parameters
-
qElement A QDomElement which contains xml info for this widget.
- Todo:
- Add support to load older version.
Reimplemented from WidgetBase.
Reimplemented in MessageWidget, ClassifierWidget, ObjectWidget, StateWidget, FloatingTextWidget, CombinedFragmentWidget, ActivityWidget, NoteWidget, ObjectNodeWidget, SignalWidget, FloatingDashLineWidget, PreconditionWidget, PinWidget, EnumWidget, DatatypeWidget, ForkJoinWidget, and RegionWidget.
Definition at line 1726 of file umlwidget.cpp.
|
virtual |
Compute the maximum possible width and height.
- Returns
- maximum size
Reimplemented in StateWidget, and ActivityWidget.
Definition at line 206 of file umlwidget.cpp.
|
virtual |
Compute the minimum possible width and height.
- Returns
- QSizeF(mininum_width, minimum_height)
Reimplemented in ObjectWidget, StateWidget, FloatingTextWidget, CombinedFragmentWidget, ActivityWidget, NoteWidget, SignalWidget, ObjectNodeWidget, UseCaseWidget, PreconditionWidget, ActorWidget, CategoryWidget, EnumWidget, EntityWidget, ForkJoinWidget, DatatypeWidget, ArtifactWidget, ComponentWidget, PackageWidget, NodeWidget, and RegionWidget.
Definition at line 185 of file umlwidget.cpp.
|
protectedvirtual |
Event handler for mouse double click events.
- Parameters
-
event the QGraphicsSceneMouseEvent event.
Reimplemented in MessageWidget, and NoteWidget.
Definition at line 538 of file umlwidget.cpp.
|
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 constrain can be applied), and then the associations are adjusted. The resizing can be constrained also to an specific axis using control and shift buttons. If on 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 got (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 constrain 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 constrain can be applied) and, if an specific 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
-
me The QGraphicsSceneMouseEvent event.
Reimplemented in ObjectWidget, SignalWidget, and PinWidget.
Definition at line 334 of file umlwidget.cpp.
|
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
-
me The QGraphicsSceneMouseEvent event.
Reimplemented in ObjectWidget.
Definition at line 416 of file umlwidget.cpp.
|
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
-
me The QGraphicsSceneMouseEvent event.
Definition at line 498 of file umlwidget.cpp.
void UMLWidget::moveByLocal | ( | qreal | dx, |
qreal | dy | ||
) |
Move the widget by an X and Y offset relative to the current position.
Definition at line 1089 of file umlwidget.cpp.
|
protectedvirtual |
Overrides the standard operation.
- Parameters
-
me The move event.
Reimplemented in ObjectWidget.
Definition at line 1703 of file umlwidget.cpp.
|
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
-
diffX The difference between current X position and new X position. diffY The difference between current Y position and new Y position.
Reimplemented in MessageWidget, ObjectWidget, and FloatingTextWidget.
Definition at line 247 of file umlwidget.cpp.
|
virtual |
Returns 0 if the given point is not in the boundaries of the widget, else returns a number which is proportional to the size of the widget.
- Parameters
-
p Point to be checked.
- Returns
- 0 if the given point is not in the boundaries of the widget; (width()+height())/2 if the point is within the boundaries.
Reimplemented in MessageWidget.
Definition at line 1071 of file umlwidget.cpp.
Assignment operator.
Definition at line 94 of file umlwidget.cpp.
bool UMLWidget::operator== | ( | const UMLWidget & | other | ) | const |
Overload '==' operator.
Definition at line 132 of file umlwidget.cpp.
|
virtual |
Draws the UMLWidget on the given paint device.
- Parameters
-
p The painter for the drawing device offsetX x position to start the drawing. offsetY y position to start the drawing.
Reimplemented from WidgetBase.
Reimplemented in MessageWidget, ClassifierWidget, FloatingTextWidget, ActivityWidget, StateWidget, CombinedFragmentWidget, ObjectWidget, NoteWidget, UseCaseWidget, ActorWidget, ObjectNodeWidget, CategoryWidget, SignalWidget, FloatingDashLineWidget, PreconditionWidget, EnumWidget, PinWidget, ArtifactWidget, DatatypeWidget, EntityWidget, ForkJoinWidget, ComponentWidget, PackageWidget, NodeWidget, BoxWidget, and RegionWidget.
Definition at line 1565 of file umlwidget.cpp.
void UMLWidget::removeAssoc | ( | AssociationWidget * | pAssoc | ) |
Removes an already created association from the list of associations that include this UMLWidget.
Definition at line 987 of file umlwidget.cpp.
void UMLWidget::resize | ( | ) |
Resize widget to minimum size.
Definition at line 1169 of file umlwidget.cpp.
|
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
-
me The QGraphicsSceneMouseEvent to get the values from.
Definition at line 1188 of file umlwidget.cpp.
|
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 MessageWidget, and ObjectWidget.
Definition at line 1120 of file umlwidget.cpp.
|
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
-
newW The new width for the widget. newH The new height for the widget.
Reimplemented in MessageWidget, and ObjectWidget.
Definition at line 583 of file umlwidget.cpp.
|
virtual |
A virtual method to save the properties of this widget into a QDomElement 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
-
qDoc A QDomDocument object representing the xml document. qElement A QDomElement representing xml element data.
Reimplemented from WidgetBase.
Reimplemented in MessageWidget, ClassifierWidget, StateWidget, ObjectWidget, FloatingTextWidget, ActivityWidget, CombinedFragmentWidget, NoteWidget, ObjectNodeWidget, SignalWidget, FloatingDashLineWidget, UseCaseWidget, ActorWidget, PreconditionWidget, CategoryWidget, PinWidget, EnumWidget, ArtifactWidget, DatatypeWidget, EntityWidget, ForkJoinWidget, ComponentWidget, PackageWidget, NodeWidget, BoxWidget, and RegionWidget.
Definition at line 1707 of file umlwidget.cpp.
|
protected |
Selects the widget and adds it to the list of selected widgets.
- Parameters
-
me The QGraphicsSceneMouseEvent which made the selection.
Definition at line 1317 of file umlwidget.cpp.
|
protected |
Selects the widget and clears the other selected widgets, if any.
- Parameters
-
me The QGraphicsSceneMouseEvent which made the selection.
Definition at line 1303 of file umlwidget.cpp.
void UMLWidget::setActivated | ( | bool | active = true | ) |
Set the m_activated flag of a widget but does not perform the Activate method.
- Parameters
-
Active Status of activation is to be set.
Definition at line 967 of file umlwidget.cpp.
|
virtual |
Template Method, override this to set the default font metric.
Definition at line 1512 of file umlwidget.cpp.
|
virtual |
Template Method, override this to set the default font metric.
Definition at line 1608 of file umlwidget.cpp.
|
virtual |
Sets the background fill color.
- Parameters
-
color the new fill color
Reimplemented from WidgetBase.
Definition at line 868 of file umlwidget.cpp.
void UMLWidget::setFillColorcmd | ( | const QColor & | color | ) |
Sets the background fill color.
- Parameters
-
color the new fill color
Definition at line 878 of file umlwidget.cpp.
|
inline |
Definition at line 215 of file umlwidget.h.
|
virtual |
Sets the font the widget is to use.
- Parameters
-
font Font to be set.
Reimplemented from WidgetBase.
Definition at line 1641 of file umlwidget.cpp.
void UMLWidget::setFontMetrics | ( | UMLWidget::FontType | fontType, |
QFontMetrics | fm | ||
) |
Set the font metric to use.
Definition at line 1630 of file umlwidget.cpp.
void UMLWidget::setIgnoreSnapToGrid | ( | bool | to | ) |
Set m_ignoreSnapToGrid.
Definition at line 1434 of file umlwidget.cpp.
|
inline |
Write property of m_instanceName.
Definition at line 170 of file umlwidget.h.
|
inline |
Write property of bool m_isInstance.
Definition at line 163 of file umlwidget.h.
|
virtual |
Overrides the method from WidgetBase.
Reimplemented from WidgetBase.
Definition at line 849 of file umlwidget.cpp.
void UMLWidget::setLineColorcmd | ( | const QColor & | color | ) |
Overrides the method from WidgetBase.
Definition at line 840 of file umlwidget.cpp.
|
virtual |
Overrides the method from WidgetBase.
Reimplemented from WidgetBase.
Definition at line 857 of file umlwidget.cpp.
void UMLWidget::setMaximumSize | ( | const QSizeF & | newSize | ) |
This method is used to set the maximum size variable for this widget.
- Parameters
-
newSize The size being set as maximum.
Definition at line 217 of file umlwidget.cpp.
void UMLWidget::setMinimumSize | ( | const QSizeF & | newSize | ) |
This method is used to set the minimum size variable for this widget.
- Parameters
-
newSize The size being set as minimum.
Definition at line 196 of file umlwidget.cpp.
void UMLWidget::setPenFromSettings | ( | QPainter & | p | ) |
Set the pen.
Definition at line 1101 of file umlwidget.cpp.
void UMLWidget::setPenFromSettings | ( | QPainter * | p | ) |
Set the pen.
Definition at line 1109 of file umlwidget.cpp.
void UMLWidget::setScene | ( | UMLScene * | scene | ) |
Clears the selection, resets the toolbar and deselects the widget.
Sets the view the widget is on.
- Parameters
-
v The view the widget is on.
Definition at line 1349 of file umlwidget.cpp.
|
virtual |
Sets the state of whether the widget is selected.
- Parameters
-
_select The state of whether the widget is selected.
Reimplemented in MessageWidget.
Definition at line 1253 of file umlwidget.cpp.
|
inline |
Definition at line 91 of file umlwidget.h.
|
protected |
Fills m_selectedWidgetsList and sets the selection bounds ((m_min/m_max)X/Y attributes).
Definition at line 1240 of file umlwidget.cpp.
|
virtual |
Set the status of whether to show Stereotype.
- Parameters
-
flag True if stereotype shall be shown.
Definition at line 1681 of file umlwidget.cpp.
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.
Definition at line 1452 of file umlwidget.cpp.
void UMLWidget::setSize | ( | const QSizeF & | size | ) |
Sets the size with another size.
Definition at line 1473 of file umlwidget.cpp.
|
virtual |
Overrides the method from WidgetBase.
Reimplemented from WidgetBase.
Definition at line 831 of file umlwidget.cpp.
void UMLWidget::setTextColorcmd | ( | const QColor & | color | ) |
Overrides the method from WidgetBase.
Definition at line 822 of file umlwidget.cpp.
void UMLWidget::setupFontType | ( | QFont & | font, |
UMLWidget::FontType | fontType | ||
) |
Definition at line 1518 of file umlwidget.cpp.
void UMLWidget::setUseFillColor | ( | bool | fc | ) |
Set the status of using fill color.
- Parameters
-
fc the status of using fill color.
Definition at line 813 of file umlwidget.cpp.
|
virtual |
Sets the x-coordinate.
Currently, the only class that reimplements this method is ObjectWidget.
- Parameters
-
x The x-coordinate to be set.
Reimplemented in SignalWidget, and ObjectWidget.
Definition at line 1370 of file umlwidget.cpp.
|
virtual |
Sets the y-coordinate.
Currently, the only class that reimplements this method is ObjectWidget.
- Parameters
-
y The y-coordinate to be set.
Reimplemented in MessageWidget, FloatingDashLineWidget, SignalWidget, and ObjectWidget.
Definition at line 1382 of file umlwidget.cpp.
|
virtual |
Show a properties dialog for a UMLWidget.
Reimplemented from WidgetBase.
Reimplemented in StateWidget, ActivityWidget, FloatingTextWidget, ObjectWidget, ObjectNodeWidget, and SignalWidget.
Definition at line 1047 of file umlwidget.cpp.
bool UMLWidget::showStereotype | ( | ) | const |
Returns the status of whether to show Stereotype.
- Returns
- True if stereotype is shown.
Definition at line 1693 of file umlwidget.cpp.
|
signal |
Emit when the widget moves its' position.
- Parameters
-
id The id of the object behind the widget.
|
slot |
Captures a sigClearAllSelected signal sent by UMLView.
Definition at line 1293 of file umlwidget.cpp.
|
virtualslot |
Captures a color change signal.
- Parameters
-
sceneID The id of the object behind the widget.
Definition at line 744 of file umlwidget.cpp.
|
virtualslot |
Captures a line color change signal.
- Parameters
-
sceneID The id of the object behind the widget.
Definition at line 779 of file umlwidget.cpp.
|
virtualslot |
Captures a linewidth change signal.
- Parameters
-
sceneID The id of the object behind the widget.
Definition at line 796 of file umlwidget.cpp.
|
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.
Definition at line 707 of file umlwidget.cpp.
|
slot |
Tells the widget to snap to grid.
Will use the grid settings of the UMLView it belongs to.
Definition at line 1399 of file umlwidget.cpp.
|
virtualslot |
Captures a text color change signal.
- Parameters
-
sceneID The id of the object behind the widget.
Definition at line 764 of file umlwidget.cpp.
|
virtualslot |
Captures when another widget moves if this widget is linked to it.
- See also
- sigWidgetMoved
- Parameters
-
id The id of object behind the widget.
Definition at line 735 of file umlwidget.cpp.
QPointF UMLWidget::startMovePosition | ( | ) | const |
Return the start position of the move action.
- Returns
- point where the move began
Definition at line 558 of file umlwidget.cpp.
QSizeF UMLWidget::startResizeSize | ( | ) | const |
Return the start size of the resize action.
- Returns
- size where the resize began
Definition at line 567 of file umlwidget.cpp.
void UMLWidget::updateGeometry | ( | ) |
Update the size of this widget.
Definition at line 1481 of file umlwidget.cpp.
|
virtualslot |
When a widget changes this slot captures that signal.
Definition at line 591 of file umlwidget.cpp.
|
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.
Definition at line 1232 of file umlwidget.cpp.
|
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.
Definition at line 1221 of file umlwidget.cpp.
|
static |
Returns whether the widget type has an associated UMLObject.
Definition at line 1412 of file umlwidget.cpp.
|
inline |
Returns the width of the widget.
Definition at line 129 of file umlwidget.h.
Member Data Documentation
|
static |
Definition at line 48 of file umlwidget.h.
|
static |
Definition at line 47 of file umlwidget.h.
|
protected |
true if the activate function has been called for this class instance
Definition at line 308 of file umlwidget.h.
|
protected |
A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram.
Definition at line 289 of file umlwidget.h.
|
protected |
shortcut for UMLApp::app()->getDocument()
Definition at line 301 of file umlwidget.h.
|
protected |
Definition at line 315 of file umlwidget.h.
|
protected |
Definition at line 314 of file umlwidget.h.
|
protected |
Change Widget Behaviour.
Definition at line 313 of file umlwidget.h.
|
protected |
If cursor was in move/resize area when left button was pressed (and no other widgets were selected).
Definition at line 346 of file umlwidget.h.
|
protected |
Definition at line 346 of file umlwidget.h.
|
protected |
instance name (used if on a deployment diagram)
Definition at line 291 of file umlwidget.h.
|
protected |
holds whether this widget is a component instance (i.e. on a deployment diagram)
Definition at line 292 of file umlwidget.h.
|
protected |
Definition at line 305 of file umlwidget.h.
|
protected |
Definition at line 304 of file umlwidget.h.
|
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.
Definition at line 353 of file umlwidget.h.
|
protected |
Definition at line 300 of file umlwidget.h.
|
protected |
Definition at line 337 of file umlwidget.h.
|
protected |
The X/Y position the widget had when the movement started.
Definition at line 334 of file umlwidget.h.
|
protected |
The text in the status bar when the cursor was pressed.
Definition at line 327 of file umlwidget.h.
|
protected |
The width/height the widget had when the resize started.
Definition at line 337 of file umlwidget.h.
|
protected |
Definition at line 303 of file umlwidget.h.
|
protected |
The X/Y offset from the position of the cursor when it was pressed to the upper left corner of the widget.
Definition at line 331 of file umlwidget.h.
|
protected |
Definition at line 302 of file umlwidget.h.
|
protected |
Definition at line 353 of file umlwidget.h.
|
protected |
Definition at line 297 of file umlwidget.h.
|
protected |
A list containing the selected widgets.
It's filled by setSelectionBounds method. It must be filled again if selected widgets changed. It is cleared only in setSelectionBounds, just before filling it. Select, deselect and so on methods DON'T modify this list.
Definition at line 324 of file umlwidget.h.
|
protected |
If shift or control button were pressed in mouse press event.
Definition at line 340 of file umlwidget.h.
|
protected |
should the stereotype be displayed
Definition at line 293 of file umlwidget.h.
|
protected |
Definition at line 297 of file umlwidget.h.
|
protected |
Definition at line 298 of file umlwidget.h.
|
protected |
Definition at line 299 of file umlwidget.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.