Common base class for UMLWidget and AssociationWidget.
More...
#include <widgetbase.h>
|
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
} |
|
|
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
|
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
|
◆ WidgetType
Enumerator |
---|
wt_Min | |
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 | |
◆ WidgetBase()
Creates a WidgetBase object.
- Parameters
-
scene | The view to be displayed on. |
type | The WidgetType to construct. This must be set to the appropriate value by the constructors of inheriting classes. |
◆ ~WidgetBase()
WidgetBase::~WidgetBase |
( |
| ) |
|
|
virtual |
◆ activate()
bool WidgetBase::activate |
( |
IDChangeLog * |
changeLog = 0 | ) |
|
|
virtual |
◆ addAssoc()
Adds an already created association to the list of associations that include this UMLWidget
Reimplemented in UMLWidget.
◆ asActivityWidget()
◆ asActorWidget()
◆ asArtifactWidget()
◆ asAssociationWidget()
◆ asBoxWidget()
◆ asCategoryWidget()
◆ asClassifierWidget()
◆ asCombinedFragmentWidget()
◆ asComponentWidget()
◆ asDatatypeWidget()
◆ asEntityWidget()
◆ asEnumWidget()
◆ asFloatingDashLineWidget()
◆ asFloatingTextWidget()
◆ asForkJoinWidget()
◆ asInterfaceWidget()
◆ asMessageWidget()
◆ asNodeWidget()
◆ asNoteWidget()
◆ asObjectNodeWidget()
◆ asObjectWidget()
◆ asPackageWidget()
◆ asPinPortBase()
◆ asPinWidget()
◆ asPortWidget()
◆ asPreconditionWidget()
◆ asRegionWidget()
◆ asSignalWidget()
◆ asStateWidget()
◆ asUMLWidget()
◆ asUseCaseWidget()
◆ autoResize()
bool WidgetBase::autoResize |
( |
| ) |
|
Return state of auto resize property
- Returns
- the auto resize state
◆ baseType()
Read property of m_baseType.
◆ baseTypeStr()
QLatin1String WidgetBase::baseTypeStr |
( |
| ) |
const |
- Returns
- The type used for rtti as string.
◆ baseTypeStrWithoutPrefix()
QString WidgetBase::baseTypeStrWithoutPrefix |
( |
| ) |
const |
- Returns
- The type as string without 'wt_' prefix.
◆ boundingRect()
QRectF WidgetBase::boundingRect |
( |
| ) |
const |
|
virtual |
◆ changesShape()
bool WidgetBase::changesShape |
( |
| ) |
|
Return changes state property
- Returns
- the changes shape state
◆ contextMenuEvent()
void WidgetBase::contextMenuEvent |
( |
QGraphicsSceneContextMenuEvent * |
event | ) |
|
|
protectedvirtual |
◆ documentation()
QString WidgetBase::documentation |
( |
| ) |
const |
Used by some child classes to get documentation.
- Returns
- The documentation from the UMLObject (if m_umlObject is set.)
◆ fillColor()
QColor WidgetBase::fillColor |
( |
| ) |
const |
Returns fill color
- Returns
- currently used fill color
◆ font()
QFont WidgetBase::font |
( |
| ) |
const |
|
virtual |
Returns the font used for displaying any text.
- Returns
- the font
Reimplemented in AssociationWidget.
◆ hasDocumentation()
bool WidgetBase::hasDocumentation |
( |
| ) |
|
Returns state of documentation for the widget.
- Returns
- false if documentation is empty
◆ id()
◆ isActivityWidget()
bool WidgetBase::isActivityWidget |
( |
| ) |
|
|
inline |
◆ isActorWidget()
bool WidgetBase::isActorWidget |
( |
| ) |
|
|
inline |
◆ isArtifactWidget()
bool WidgetBase::isArtifactWidget |
( |
| ) |
|
|
inline |
◆ isAssociationWidget()
bool WidgetBase::isAssociationWidget |
( |
| ) |
|
|
inline |
◆ isBoxWidget()
bool WidgetBase::isBoxWidget |
( |
| ) |
|
|
inline |
◆ isCategoryWidget()
bool WidgetBase::isCategoryWidget |
( |
| ) |
|
|
inline |
◆ isClassWidget()
bool WidgetBase::isClassWidget |
( |
| ) |
|
|
inline |
◆ isCombinedFragmentWidget()
bool WidgetBase::isCombinedFragmentWidget |
( |
| ) |
|
|
inline |
◆ isComponentWidget()
bool WidgetBase::isComponentWidget |
( |
| ) |
|
|
inline |
◆ isDatatypeWidget()
bool WidgetBase::isDatatypeWidget |
( |
| ) |
|
|
inline |
◆ isEntityWidget()
bool WidgetBase::isEntityWidget |
( |
| ) |
|
|
inline |
◆ isEnumWidget()
bool WidgetBase::isEnumWidget |
( |
| ) |
|
|
inline |
◆ isFloatingDashLineWidget()
bool WidgetBase::isFloatingDashLineWidget |
( |
| ) |
|
|
inline |
◆ isForkJoinWidget()
bool WidgetBase::isForkJoinWidget |
( |
| ) |
|
|
inline |
◆ isInterfaceWidget()
bool WidgetBase::isInterfaceWidget |
( |
| ) |
|
|
inline |
◆ isMessageWidget()
bool WidgetBase::isMessageWidget |
( |
| ) |
|
|
inline |
◆ isNodeWidget()
bool WidgetBase::isNodeWidget |
( |
| ) |
|
|
inline |
◆ isNoteWidget()
bool WidgetBase::isNoteWidget |
( |
| ) |
|
|
inline |
◆ isObjectNodeWidget()
bool WidgetBase::isObjectNodeWidget |
( |
| ) |
|
|
inline |
◆ isObjectWidget()
bool WidgetBase::isObjectWidget |
( |
| ) |
|
|
inline |
◆ isPackageWidget()
bool WidgetBase::isPackageWidget |
( |
| ) |
|
|
inline |
◆ isPinWidget()
bool WidgetBase::isPinWidget |
( |
| ) |
|
|
inline |
◆ isPortWidget()
bool WidgetBase::isPortWidget |
( |
| ) |
|
|
inline |
◆ isPreconditionWidget()
bool WidgetBase::isPreconditionWidget |
( |
| ) |
|
|
inline |
◆ isRegionWidget()
bool WidgetBase::isRegionWidget |
( |
| ) |
|
|
inline |
◆ isSignalWidget()
bool WidgetBase::isSignalWidget |
( |
| ) |
|
|
inline |
◆ isStateWidget()
bool WidgetBase::isStateWidget |
( |
| ) |
|
|
inline |
◆ isTextWidget()
bool WidgetBase::isTextWidget |
( |
| ) |
|
|
inline |
◆ isUseCaseWidget()
bool WidgetBase::isUseCaseWidget |
( |
| ) |
|
|
inline |
◆ lineColor()
QColor WidgetBase::lineColor |
( |
| ) |
const |
Returns line color
- Returns
- currently used line color
◆ lineWidth()
uint WidgetBase::lineWidth |
( |
| ) |
const |
Returns line width
- Returns
- currently used line with
◆ loadFromXMI1()
bool WidgetBase::loadFromXMI1 |
( |
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
-
qElement | A QDomElement which contains xml info for this widget. |
- Todo:
- Add support to load older version.
Reimplemented in ActivityWidget, AssociationWidget, ClassifierWidget, CombinedFragmentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, and UMLWidget.
◆ localID()
Returns the local ID for this object. This ID is used so that many objects of the same UMLObject instance can be on the same diagram.
- Returns
- The local ID.
◆ name()
QString WidgetBase::name |
( |
| ) |
const |
Gets the name from the corresponding UMLObject if this widget has an underlying UMLObject; if it does not, then it returns the local m_Text (notably the case for FloatingTextWidget.)
- Returns
- the currently set name
◆ onWidget()
UMLWidget * WidgetBase::onWidget |
( |
const QPointF & |
p | ) |
|
|
virtual |
◆ operator=()
◆ paint()
void WidgetBase::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget = 0 |
|
) |
| |
|
virtual |
Draws the UMLWidget on the given paint device
- Parameters
-
painter | The painter for the drawing device |
option | Painting related options |
widget | Background widget on which to paint (optional) |
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, UMLWidget, UseCaseWidget, and FloatingDashLineWidget.
◆ rect()
QRectF WidgetBase::rect |
( |
| ) |
const |
return drawing rectangle of widget in local coordinates
◆ removeAssoc()
Removes an already created association from the list of associations that include this UMLWidget
Reimplemented in UMLWidget.
◆ saveToXMI1()
void WidgetBase::saveToXMI1 |
( |
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
-
writer | The QXmlStreamWriter to write to. |
Reimplemented in ActivityWidget, ActorWidget, ArtifactWidget, AssociationWidget, BoxWidget, CategoryWidget, ClassifierWidget, CombinedFragmentWidget, ComponentWidget, DatatypeWidget, EntityWidget, EnumWidget, FloatingDashLineWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NodeWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, PackageWidget, PinPortBase, PreconditionWidget, RegionWidget, SignalWidget, StateWidget, UMLWidget, and UseCaseWidget.
◆ setAutoResize()
void WidgetBase::setAutoResize |
( |
bool |
state | ) |
|
set auto resize state
- Parameters
-
◆ setBaseType()
void WidgetBase::setBaseType |
( |
const WidgetType & |
baseType | ) |
|
Set property m_baseType. Used for types changing their types during runtime.
◆ setChangesShape()
void WidgetBase::setChangesShape |
( |
bool |
state | ) |
|
set changes shape property
- Parameters
-
◆ setDocumentation()
void WidgetBase::setDocumentation |
( |
const QString & |
doc | ) |
|
|
virtual |
Used by some child classes to set documentation.
- Parameters
-
doc | The documentation to be set in the UMLObject (if m_umlObject is set.) |
Reimplemented in ClassifierWidget.
◆ setFillColor()
void WidgetBase::setFillColor |
( |
const QColor & |
color | ) |
|
|
virtual |
Sets the fill color
- Parameters
-
Reimplemented in UMLWidget.
◆ setFont()
void WidgetBase::setFont |
( |
const QFont & |
font | ) |
|
|
virtual |
Set the font used to display text inside this widget.
Reimplemented in UMLWidget.
◆ setID()
◆ setLineColor()
void WidgetBase::setLineColor |
( |
const QColor & |
color | ) |
|
|
virtual |
◆ setLineWidth()
void WidgetBase::setLineWidth |
( |
uint |
width | ) |
|
|
virtual |
◆ setLocalID()
Sets the local id of the object.
- Parameters
-
id | The local id of the object. |
◆ setName()
void WidgetBase::setName |
( |
const QString & |
strName | ) |
|
|
virtual |
◆ setRect() [1/2]
void WidgetBase::setRect |
( |
const QRectF & |
rect | ) |
|
set widget rectangle in item coordinates
◆ setRect() [2/2]
void WidgetBase::setRect |
( |
qreal |
x, |
|
|
qreal |
y, |
|
|
qreal |
width, |
|
|
qreal |
height |
|
) |
| |
set widget rectangle in item coordinates
◆ setSelected()
void WidgetBase::setSelected |
( |
bool |
select | ) |
|
|
virtual |
◆ setTextColor()
void WidgetBase::setTextColor |
( |
const QColor & |
color | ) |
|
|
virtual |
◆ setUMLObject()
void WidgetBase::setUMLObject |
( |
UMLObject * |
obj | ) |
|
|
virtual |
◆ setUseFillColor()
void WidgetBase::setUseFillColor |
( |
bool |
state | ) |
|
|
virtual |
Set state if fill color is used
- Parameters
-
Reimplemented in UMLWidget.
◆ setUsesDiagramFillColor()
void WidgetBase::setUsesDiagramFillColor |
( |
bool |
state | ) |
|
Set state if diagram fill color is used
- Parameters
-
◆ setUsesDiagramLineColor()
void WidgetBase::setUsesDiagramLineColor |
( |
bool |
state | ) |
|
Set state of diagram line color is used
- Parameters
-
◆ setUsesDiagramLineWidth()
void WidgetBase::setUsesDiagramLineWidth |
( |
bool |
state | ) |
|
Set state of diagram line width is used
- Parameters
-
◆ setUsesDiagramTextColor()
void WidgetBase::setUsesDiagramTextColor |
( |
bool |
state | ) |
|
Set state if diagram text color is used
- Parameters
-
◆ setUsesDiagramUseFillColor()
void WidgetBase::setUsesDiagramUseFillColor |
( |
bool |
state | ) |
|
Set state of diagram use fill color is used
- Parameters
-
◆ showPropertiesDialog()
bool WidgetBase::showPropertiesDialog |
( |
| ) |
|
|
virtual |
A virtual method for the widget to display a property dialog box. Subclasses should reimplement this appropriately. In case the user cancels the dialog or there are some requirements not fulfilled the method returns false; true otherwise.
- Returns
- true - properties has been applyed
-
false - properties has not been applied
Reimplemented in ActivityWidget, AssociationWidget, BoxWidget, ClassifierWidget, FloatingTextWidget, ForkJoinWidget, MessageWidget, NoteWidget, ObjectNodeWidget, ObjectWidget, SignalWidget, StateWidget, and UMLWidget.
◆ slotMenuSelection
void WidgetBase::slotMenuSelection |
( |
QAction * |
trigger | ) |
|
|
virtualslot |
◆ textColor()
QColor WidgetBase::textColor |
( |
| ) |
const |
Returns text color
- Returns
- currently used text color
◆ toI18nString()
Returns the given enum value as localized string.
- Parameters
-
wt | WidgetType of which a string representation is wanted |
- Returns
- the WidgetType as localized string
◆ toIcon()
Returns the given enum value as icon type.
- Parameters
-
wt | WidgetType of which an icon type representation is wanted |
- Returns
- the WidgetType as icon type
◆ toString()
Helper function for debug output. Returns the given enum value as string.
- Parameters
-
wt | WidgetType of which a string representation is wanted |
- Returns
- the WidgetType as string
◆ umlDoc()
UMLDoc * WidgetBase::umlDoc |
( |
| ) |
const |
◆ umlObject()
◆ umlScene()
UMLScene * WidgetBase::umlScene |
( |
| ) |
const |
◆ useFillColor()
bool WidgetBase::useFillColor |
( |
| ) |
|
Return state of fill color usage
- Returns
- True if fill color is used
◆ usesDiagramFillColor()
bool WidgetBase::usesDiagramFillColor |
( |
| ) |
const |
Returns state of diagram fill color is used
- Returns
- True means diagrams fill color is used
◆ usesDiagramLineColor()
bool WidgetBase::usesDiagramLineColor |
( |
| ) |
const |
Returns state of diagram line color is used
- Returns
- True means diagrams line color is used
◆ usesDiagramLineWidth()
bool WidgetBase::usesDiagramLineWidth |
( |
| ) |
const |
Returns state of diagram line width is used
- Returns
- True means diagrams line width is used
◆ usesDiagramTextColor()
bool WidgetBase::usesDiagramTextColor |
( |
| ) |
const |
Returns state if diagram text color is used
- Returns
- True means diagram text color is used
◆ usesDiagramUseFillColor()
bool WidgetBase::usesDiagramUseFillColor |
( |
| ) |
const |
Returns state of diagram use fill color is used
- Returns
- True means diagrams fill color is used
◆ widgetHasUMLObject()
Returns whether the widget type has an associated UMLObject
◆ widgetWithID()
Returns the widget with the given ID. The default implementation tests the following IDs:
- m_nLocalID
- if m_umlObject is non NULL: m_umlObject->id()
- m_nID Composite widgets override this function to test further owned widgets.
- Parameters
-
id | The ID to test this widget against. |
- Returns
- 'this' if id is either of m_nLocalID, m_umlObject->id(), or m_nId; else NULL.
Reimplemented in ClassifierWidget, and PinPortBase.
◆ m_autoResize
bool WidgetBase::m_autoResize |
|
protected |
◆ m_baseType
◆ m_brush
QBrush WidgetBase::m_brush |
|
protected |
◆ m_changesShape
bool WidgetBase::m_changesShape |
|
protected |
The widget changes its shape when the number of connections or their positions are changed.
◆ m_Doc
QString WidgetBase::m_Doc |
|
protected |
Only used if m_umlObject is not set.
◆ m_fillColor
QColor WidgetBase::m_fillColor |
|
protected |
color of the background of the widget
◆ m_font
◆ m_lineColor
QColor WidgetBase::m_lineColor |
|
protected |
Color of the lines of the widget. Is saved to XMI.
◆ m_lineWidth
uint WidgetBase::m_lineWidth |
|
protected |
Width of the lines of the widget. Is saved to XMI.
◆ m_nId
This ID is only used when the widget does not have a corresponding UMLObject (i.e. the m_umlObject pointer is NULL.) For UMLObjects, the ID from the UMLObject is used.
◆ m_nLocalID
This ID is only used when a widget could be added more than once to a diagram
◆ m_rect
QRectF WidgetBase::m_rect |
|
protected |
◆ m_scene
◆ m_Text
QString WidgetBase::m_Text |
|
protected |
◆ m_textColor
QColor WidgetBase::m_textColor |
|
protected |
Color of the text of the widget. Is saved to XMI.
◆ m_umlObject
◆ m_useFillColor
bool WidgetBase::m_useFillColor |
|
protected |
flag indicates if the UMLWidget uses the Diagram FillColour
◆ m_usesDiagramFillColor
bool WidgetBase::m_usesDiagramFillColor |
|
protected |
true by default, false if the colors have been explicitly set for this widget. These are saved to XMI.
◆ m_usesDiagramLineColor
bool WidgetBase::m_usesDiagramLineColor |
|
protected |
◆ m_usesDiagramLineWidth
bool WidgetBase::m_usesDiagramLineWidth |
|
protected |
◆ m_usesDiagramTextColor
bool WidgetBase::m_usesDiagramTextColor |
|
protected |
◆ m_usesDiagramUseFillColor
bool WidgetBase::m_usesDiagramUseFillColor |
|
protected |
The documentation for this class was generated from the following files: