umbrello/umbrello
UMLWidget Class Reference
#include <umlwidget.h>

Detailed Description
This is the base class for nearly all graphical widgets.The base class for graphical UML objects.
Definition at line 46 of file umlwidget.h.
Member Enumeration Documentation
enum UMLWidget::FontType [protected] |
- 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 580 of file umlwidget.h.
Constructor & Destructor Documentation
| UMLWidget::UMLWidget | ( | UMLView * | view, | |
| UMLObject * | o, | |||
| UMLWidgetController * | widgetController = 0 | |||
| ) |
Creates a UMLWidget object.
- Parameters:
-
view The view to be displayed on. o The UMLObject to represent. widgetController The UMLWidgetController of this UMLWidget
Definition at line 47 of file umlwidget.cpp.
| UMLWidget::UMLWidget | ( | UMLView * | view, | |
| Uml::IDType | id = Uml::id_None, |
|||
| UMLWidgetController * | widgetController = 0 | |||
| ) | [explicit] |
Creates a UMLWidget object.
- Parameters:
-
view The view to be displayed on. id The id of the widget. The default value (id_None) will prompt generation of a new ID. widgetController The UMLWidgetController of this UMLWidget
Definition at line 64 of file umlwidget.cpp.
| UMLWidget::~UMLWidget | ( | ) | [virtual] |
| UMLWidget::UMLWidget | ( | const UMLWidget & | other | ) |
Copy constructor.
Member Function Documentation
| bool UMLWidget::operator== | ( | const UMLWidget & | other | ) | [virtual] |
| void UMLWidget::mouseReleaseEvent | ( | QMouseEvent * | me | ) | [virtual] |
Calls the method with the same name in UMLWidgetController.
- Parameters:
-
me The QMouseEvent event.
Definition at line 213 of file umlwidget.cpp.
| void UMLWidget::mouseDoubleClickEvent | ( | QMouseEvent * | me | ) | [virtual] |
Calls the method with the same name in UMLWidgetController.
- Parameters:
-
me The QMouseEvent event.
Definition at line 433 of file umlwidget.cpp.
| void UMLWidget::setUseFillColour | ( | bool | fc | ) |
Set the status of using fill color.
- Parameters:
-
fc the status of using fill color.
Definition at line 437 of file umlwidget.cpp.
| bool UMLWidget::getUseFillColour | ( | ) | const [inline] |
| void UMLWidget::setLineColor | ( | const QColor & | colour | ) | [virtual] |
Overrides the method from WidgetBase.
Reimplemented from WidgetBase.
Definition at line 448 of file umlwidget.cpp.
| void UMLWidget::setLineColorcmd | ( | const QColor & | colour | ) |
| QColor UMLWidget::getLineColor | ( | ) |
| void UMLWidget::setLineWidth | ( | uint | width | ) | [virtual] |
Overrides the method from WidgetBase.
Reimplemented from WidgetBase.
Definition at line 456 of file umlwidget.cpp.
| void UMLWidget::setFillColour | ( | const QColor & | colour | ) |
Sets the background fill colour.
- Parameters:
-
colour the new fill colour
Definition at line 461 of file umlwidget.cpp.
| void UMLWidget::setFillColourcmd | ( | const QColor & | colour | ) |
Sets the background fill colour.
- Parameters:
-
colour the new fill colour
Definition at line 465 of file umlwidget.cpp.
| QColor UMLWidget::getFillColor | ( | ) |
| QColor UMLWidget::getFillColour | ( | ) | const [inline] |
| void UMLWidget::mouseMoveEvent | ( | QMouseEvent * | me | ) | [virtual] |
Calls the method with the same name in UMLWidgetController.
- See also:
- UMLWidgetController::mouseMoveEvent
- Parameters:
-
me The QMouseEvent event.
Reimplemented in PinWidget, and SignalWidget.
Definition at line 174 of file umlwidget.cpp.
| virtual bool UMLWidget::isText | ( | ) | [inline, virtual] |
Returns whether this is a line of text.
Used for transparency in printing.
- Returns:
- always false
Reimplemented in FloatingTextWidget.
Definition at line 179 of file umlwidget.h.
| void UMLWidget::setSelected | ( | bool | _select | ) | [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 706 of file umlwidget.cpp.
| bool UMLWidget::getSelected | ( | ) | const [inline] |
Returns the state of whether the widget is selected.
- Returns:
- Returns the state of whether the widget is selected.
Definition at line 195 of file umlwidget.h.
| void UMLWidget::setSelectedFlag | ( | bool | _select | ) | [inline] |
Definition at line 199 of file umlwidget.h.
| void UMLWidget::setView | ( | UMLView * | v | ) |
Sets the view the widget is on.
- Parameters:
-
v The view the widget is on.
Definition at line 749 of file umlwidget.cpp.
| bool UMLWidget::activate | ( | IDChangeLog * | ChangeLog = 0 |
) | [virtual] |
Activate the object after serializing it from a QDataStream.
- Parameters:
-
ChangeLog
- Returns:
- true for success
Reimplemented in FloatingTextWidget, MessageWidget, ObjectWidget, and PreconditionWidget.
Definition at line 497 of file umlwidget.cpp.
| int UMLWidget::onWidget | ( | const QPoint & | p | ) | [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 677 of file umlwidget.cpp.
| virtual void UMLWidget::draw | ( | QPainter & | p, | |
| int | offsetX, | |||
| int | offsetY | |||
| ) | [pure 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.
Implemented in ActivityWidget, ActorWidget, ArtifactWidget, BoxWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinWidget, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, and UseCaseWidget.
| void UMLWidget::setPen | ( | QPainter & | p | ) |
| void UMLWidget::setFont | ( | QFont | font | ) | [virtual] |
Sets the font the widget is to use.
- Parameters:
-
font Font to be set.
Reimplemented in NoteWidget.
Definition at line 932 of file umlwidget.cpp.
| QFont UMLWidget::getFont | ( | ) | const [virtual] |
| bool UMLWidget::getStartMove | ( | ) | [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 262 of file umlwidget.h.
| void UMLWidget::setX | ( | int | x | ) | [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 NoteWidget, ObjectWidget, and SignalWidget.
Definition at line 762 of file umlwidget.cpp.
| void UMLWidget::setY | ( | int | y | ) | [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 FloatingDashLineWidget, NoteWidget, ObjectWidget, and SignalWidget.
Definition at line 769 of file umlwidget.cpp.
| void UMLWidget::setZ | ( | int | z | ) | [virtual] |
Sets the z-coordinate.
- Parameters:
-
z The z-coordinate to be set.
Definition at line 776 of file umlwidget.cpp.
| int UMLWidget::getX | ( | ) | const [inline] |
| int UMLWidget::getY | ( | ) | const [inline] |
| int UMLWidget::getZ | ( | ) | const [inline] |
| int UMLWidget::getHeight | ( | ) | const [inline] |
| int UMLWidget::getWidth | ( | ) | const [inline] |
| void UMLWidget::setSize | ( | int | width, | |
| int | height | |||
| ) |
Sets the size.
If m_pView->getSnapComponentSizeToGrid() is true, then set the next larger size that snaps to the grid.
Reimplemented from Q3CanvasRectangle.
Definition at line 830 of file umlwidget.cpp.
| void UMLWidget::setIgnoreSnapToGrid | ( | bool | to | ) |
| bool UMLWidget::getIgnoreSnapToGrid | ( | ) | const |
| void UMLWidget::moveBy | ( | int | dx, | |
| int | dy | |||
| ) |
Move the widget by an X and Y offset relative to the current position.
Definition at line 690 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 575 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 569 of file umlwidget.cpp.
| AssociationWidgetList& UMLWidget::getAssocList | ( | ) | [inline] |
Returns the list of associations connected to this widget.
Definition at line 364 of file umlwidget.h.
| bool UMLWidget::getUsesDiagramFillColour | ( | ) | const [inline] |
| bool UMLWidget::getUsesDiagramUseFillColour | ( | ) | const [inline] |
| void UMLWidget::setUsesDiagramFillColour | ( | bool | usesDiagramFillColour | ) | [inline] |
| void UMLWidget::setUsesDiagramUseFillColour | ( | bool | usesDiagramUseFillColour | ) | [inline] |
| void UMLWidget::setIsInstance | ( | bool | isInstance | ) | [inline] |
| bool UMLWidget::getIsInstance | ( | ) | const [inline] |
| void UMLWidget::setInstanceName | ( | const QString & | instanceName | ) | [inline] |
Write property of m_instanceName.
Reimplemented in ObjectWidget.
Definition at line 413 of file umlwidget.h.
| QString UMLWidget::getInstanceName | ( | ) | const [inline] |
Read property of m_instanceName.
Reimplemented in ObjectWidget.
Definition at line 420 of file umlwidget.h.
| bool UMLWidget::getShowStereotype | ( | ) | const |
Returns the status of whether to show Stereotype.
- Returns:
- True if stereotype is shown.
Definition at line 962 of file umlwidget.cpp.
| void UMLWidget::setShowStereotype | ( | bool | _status | ) | [virtual] |
Set the status of whether to show Stereotype.
- Parameters:
-
_status True if stereotype shall be shown.
Definition at line 956 of file umlwidget.cpp.
| void UMLWidget::showProperties | ( | ) | [virtual] |
Show a properties dialog for a UMLWidget.
Reimplemented in ActivityWidget, FloatingTextWidget, ObjectNodeWidget, ObjectWidget, SignalWidget, and StateWidget.
Definition at line 622 of file umlwidget.cpp.
| bool UMLWidget::isActivated | ( | ) |
Returns true if the Activate method has been called for this instance.
Read property of bool m_bActivated.
- Returns:
- The activate status.
Definition at line 561 of file umlwidget.cpp.
| void UMLWidget::setName | ( | const QString & | strName | ) | [virtual] |
Sets the name in the corresponding UMLObject.
Sets the local m_Text if m_pObject is NULL.
- Parameters:
-
strName The name to be set.
Reimplemented in PinWidget, RegionWidget, SignalWidget, and StateWidget.
Definition at line 781 of file umlwidget.cpp.
| QString UMLWidget::getName | ( | ) | const [virtual] |
Gets the name from the corresponding UMLObject.
Returns the local m_Text if m_pObject is NULL.
- Returns:
- The currently set name.
Reimplemented in RegionWidget, SignalWidget, and StateWidget.
Definition at line 790 of file umlwidget.cpp.
| ListPopupMenu * UMLWidget::setupPopupMenu | ( | ) | [virtual] |
Starts the popup menu.
Reimplemented in MessageWidget.
Definition at line 636 of file umlwidget.cpp.
| void UMLWidget::adjustAssocs | ( | int | x, | |
| int | y | |||
| ) | [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
Reimplemented in ClassifierWidget.
Definition at line 581 of file umlwidget.cpp.
| void UMLWidget::adjustUnselectedAssocs | ( | int | x, | |
| int | y | |||
| ) |
Adjusts all unselected associations with the given co-ordinates.
- Parameters:
-
x The x-coordinate. y The y-coordinate.
Definition at line 607 of file umlwidget.cpp.
| void UMLWidget::setActivated | ( | bool | Active = true |
) |
Set the m_bActivated flag of a widget but does not perform the Activate method.
- Parameters:
-
Active Status of activation is to be set.
Definition at line 565 of file umlwidget.cpp.
| 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 MessageWidget, and ObjectWidget.
Definition at line 796 of file umlwidget.cpp.
| bool UMLWidget::widgetHasUMLObject | ( | Uml::Widget_Type | type | ) | [static] |
Returns whether the widget type has an associated UMLObject.
Definition at line 804 of file umlwidget.cpp.
| void UMLWidget::updateComponentSize | ( | ) |
| 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 940 of file umlwidget.cpp.
| void UMLWidget::mousePressEvent | ( | QMouseEvent * | me | ) | [virtual] |
Calls the method with the same name in UMLWidgetController.
- See also:
- UMLWidgetController::mousePressEvent
- Parameters:
-
me The QMouseEvent event.
Definition at line 178 of file umlwidget.cpp.
| void UMLWidget::moveEvent | ( | QMoveEvent * | me | ) | [virtual] |
Overrides the standard operation.
- Parameters:
-
me The move event.
Reimplemented in ObjectWidget.
Definition at line 966 of file umlwidget.cpp.
| void UMLWidget::saveToXMI | ( | QDomDocument & | qDoc, | |
| QDomElement & | qElement | |||
| ) | [virtual] |
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, PinWidget, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, and UseCaseWidget.
Definition at line 969 of file umlwidget.cpp.
| bool UMLWidget::loadFromXMI | ( | QDomElement & | qElement | ) | [virtual] |
Reimplemented from WidgetBase.
Reimplemented in ActivityWidget, ClassifierWidget, CombinedFragmentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PinWidget, PreconditionWidget, RegionWidget, SignalWidget, and StateWidget.
Definition at line 997 of file umlwidget.cpp.
| UMLWidgetController * UMLWidget::getWidgetController | ( | ) |
| void UMLWidget::constrain | ( | int & | width, | |
| int & | height | |||
| ) | [protected, virtual] |
Apply possible constraints to the given candidate width and height.
The default implementation calls calculateSize() and assigns the returned values if they are greater than the input values.
- 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 205 of file umlwidget.cpp.
| void UMLWidget::drawSelected | ( | QPainter * | p, | |
| int | offsetX, | |||
| int | offsetY | |||
| ) | [protected, virtual] |
Draws that the widget is selected.
- Parameters:
-
p Device on which is the selection is to be drawn. offsetX The x-coordinate for drawing. offsetY The y-coordinate for drawing.
Reimplemented in ForkJoinWidget.
Definition at line 475 of file umlwidget.cpp.
| void UMLWidget::drawShape | ( | QPainter & | p | ) | [protected, virtual] |
Overrides default method.
- Parameters:
-
p Device on which the shape has to be drawn.
Reimplemented from Q3CanvasRectangle.
Definition at line 702 of file umlwidget.cpp.
| QSize UMLWidget::calculateSize | ( | ) | [protected, virtual] |
Compute the minimum possible width and height.
The default implementation returns width=20, height=20.
- Returns:
- QSize(mininum_width, minimum_height)
Reimplemented in ActivityWidget, ActorWidget, ArtifactWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingTextWidget, ForkJoinWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinWidget, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, and UseCaseWidget.
Definition at line 201 of file umlwidget.cpp.
| void UMLWidget::setDefaultFontMetrics | ( | UMLWidget::FontType | fontType | ) | [protected, virtual] |
Template Method, override this to set the default font metric.
Definition at line 858 of file umlwidget.cpp.
| void UMLWidget::setDefaultFontMetrics | ( | UMLWidget::FontType | fontType, | |
| QPainter & | painter | |||
| ) | [protected, virtual] |
Definition at line 909 of file umlwidget.cpp.
| QFontMetrics & UMLWidget::getFontMetrics | ( | UMLWidget::FontType | fontType | ) | [protected] |
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition at line 916 of file umlwidget.cpp.
| void UMLWidget::setFontMetrics | ( | UMLWidget::FontType | fontType, | |
| QFontMetrics | fm | |||
| ) | [protected] |
| void UMLWidget::setupFontType | ( | QFont & | font, | |
| UMLWidget::FontType | fontType | |||
| ) | [protected] |
Definition at line 863 of file umlwidget.cpp.
| void UMLWidget::init | ( | ) | [protected] |
Initializes key attributes of the class.
Reimplemented in ClassifierWidget, EntityWidget, EnumWidget, MessageWidget, PinWidget, and PreconditionWidget.
Definition at line 217 of file umlwidget.cpp.
| void UMLWidget::slotRemovePopupMenu | ( | ) | [virtual, slot] |
This slot is entered when an event has occurred on the views display, most likely a mouse event.
Before it sends out that mouse event all children should make sure that they don't have a menu active or there could be more than one popup menu displayed.
Definition at line 669 of file umlwidget.cpp.
| void UMLWidget::updateWidget | ( | ) | [virtual, slot] |
| void UMLWidget::slotMenuSelection | ( | QAction * | action | ) | [virtual, slot] |
Captures any popup menu signals for menus it created.
- Parameters:
-
action The action which has to be executed.
Reimplemented in ActivityWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PinWidget, PreconditionWidget, SignalWidget, and StateWidget.
Definition at line 261 of file umlwidget.cpp.
| void UMLWidget::slotWidgetMoved | ( | Uml::IDType | id | ) | [virtual, slot] |
Captures when another widget moves if it is link to it that signal.
- Parameters:
-
id The id of object behind the widget.
Reimplemented in MessageWidget, and PreconditionWidget.
Definition at line 403 of file umlwidget.cpp.
| void UMLWidget::slotColorChanged | ( | Uml::IDType | viewID | ) | [virtual, slot] |
Captures a color change signal.
- Parameters:
-
viewID The id of the object behind the widget.
Reimplemented in ObjectWidget.
Definition at line 405 of file umlwidget.cpp.
| void UMLWidget::slotLineWidthChanged | ( | Uml::IDType | viewID | ) | [virtual, slot] |
Captures a linewidth change signal.
- Parameters:
-
viewID The id of the object behind the widget.
Definition at line 422 of file umlwidget.cpp.
| void UMLWidget::slotClearAllSelected | ( | ) | [slot] |
Captures a sigClearAllSelected signal sent by UMLView.
Definition at line 744 of file umlwidget.cpp.
| void UMLWidget::slotSnapToGrid | ( | ) | [slot] |
Tells the widget to snap to grid.
Will use the grid settings of the UMLView it belongs to.
Definition at line 799 of file umlwidget.cpp.
| void UMLWidget::sigWidgetMoved | ( | Uml::IDType | id | ) | [signal] |
Emit when the widget moves its' position.
- Parameters:
-
id The id of the object behind the widget.
Friends And Related Function Documentation
friend class UMLWidgetController [friend] |
Definition at line 49 of file umlwidget.h.
Member Data Documentation
bool UMLWidget::m_bUseFillColour [protected] |
This flag indicates if the UMLWidget uses the Diagram FillColour.
Definition at line 614 of file umlwidget.h.
bool UMLWidget::m_bUsesDiagramFillColour [protected] |
true by default, false if the colours have been explicitly set for this widget
Definition at line 620 of file umlwidget.h.
bool UMLWidget::m_bUsesDiagramUseFillColour [protected] |
Definition at line 621 of file umlwidget.h.
QColor UMLWidget::m_FillColour [protected] |
AssociationWidgetList UMLWidget::m_Assocs [protected] |
A list of AssociationWidgets between the UMLWidget and other UMLWidgets in the diagram.
Definition at line 631 of file umlwidget.h.
QString UMLWidget::m_Text [protected] |
getName() returns the name from the UMLObject if this widget has an underlying UMLObject; if it does not, then getName() returns the local m_Text (notably the case for FloatingTextWidget.
)
Definition at line 638 of file umlwidget.h.
QFont UMLWidget::m_Font [protected] |
bool UMLWidget::m_bIsInstance [protected] |
Holds whether this widget is a component instance (i.e.
on a deployment diagram)
Definition at line 648 of file umlwidget.h.
QString UMLWidget::m_instanceName [protected] |
bool UMLWidget::m_bShowStereotype [protected] |
bool UMLWidget::m_bSelected [protected] |
Definition at line 662 of file umlwidget.h.
bool UMLWidget::m_bStartMove [protected] |
Definition at line 662 of file umlwidget.h.
int UMLWidget::m_nPosX [protected] |
Definition at line 664 of file umlwidget.h.
int UMLWidget::m_origZ [protected] |
Definition at line 664 of file umlwidget.h.
ListPopupMenu* UMLWidget::m_pMenu [protected] |
Definition at line 665 of file umlwidget.h.
UMLDoc* UMLWidget::m_pDoc [protected] |
bool UMLWidget::m_bResizable [protected] |
Definition at line 667 of file umlwidget.h.
QFontMetrics* UMLWidget::m_pFontMetrics[FT_INVALID] [protected] |
Definition at line 668 of file umlwidget.h.
bool UMLWidget::m_bActivated [protected] |
It is true if the Activate Function has been called for this class instance.
Definition at line 674 of file umlwidget.h.
bool UMLWidget::m_bIgnoreSnapToGrid [protected] |
bool UMLWidget::m_bIgnoreSnapComponentSizeToGrid [protected] |
Definition at line 680 of file umlwidget.h.
UMLWidgetController* UMLWidget::m_widgetController [protected] |
The documentation for this class was generated from the following files:
KDE 4.0 API Reference