umbrello: ClassifierWidget Class Reference

umbrello 2.32.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

Public Types | Public Slots | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ClassifierWidget Class Reference

Common implementation for class widget and interface widget. More...

`#include <classifierwidget.h>`

Inheritance diagram for ClassifierWidget:

## Public Types
enum | VisualProperty { ShowStereotype = 0x1 , ShowOperations = 0x2 , ShowPublicOnly = 0x4 , ShowVisibility = 0x8 , ShowPackage = 0x10 , ShowAttributes = 0x20 , DrawAsCircle = 0x40 , ShowOperationSignature = 0x60 , ShowAttributeSignature = 0x80 , DrawAsPackage = 0x100 , ShowDocumentation = 0x200 }
Public Types inherited from UMLWidget
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 | slotMenuSelection (QAction *action)
Public Slots inherited from UMLWidget
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)

## Public Member Functions
| ClassifierWidget (UMLScene *scene, UMLClassifier *umlc)
| ClassifierWidget (UMLScene *scene, UMLInstance *umli)
| ClassifierWidget (UMLScene *scene, UMLPackage *o)
virtual | ~ClassifierWidget ()
UMLClassifier * | classifier () const
void | setShowStereotype (Uml::ShowStereoType::Enum flag)
VisualProperties | visualProperties () const
void | setVisualProperties (VisualProperties properties)
bool | visualProperty (VisualProperty property) const
void | setVisualProperty (VisualProperty property, bool enable=true)
void | setVisualPropertyCmd (VisualProperty property, bool enable=true)
void | toggleVisualProperty (VisualProperty property)
int | displayedAttributes () const
int | displayedOperations () const
Uml::SignatureType::Enum | attributeSignature () const
void | setAttributeSignature (Uml::SignatureType::Enum sig)
Uml::SignatureType::Enum | operationSignature () const
void | setOperationSignature (Uml::SignatureType::Enum sig)
void | setShowAttSigs (bool _show)
void | toggleShowAttSigs ()
bool | getDrawAsCircle () const
void | setDrawAsCircle (bool drawAsCircle)
void | toggleDrawAsCircle ()
void | changeToClass ()
void | changeToInterface ()
void | changeToPackage ()
AssociationWidget * | classAssociationWidget () const
void | setClassAssociationWidget (AssociationWidget *assocwidget)
UMLWidget * | onWidget (const QPointF &p)
UMLWidget * | widgetWithID (Uml::ID::Type id)
virtual void | setDocumentation (const QString &doc)
QSizeF | calculateSize (bool withExtensions=true) const
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
virtual QPainterPath | shape () const
virtual void | saveToXMI1 (QXmlStreamWriter &writer)
virtual bool | loadFromXMI1 (QDomElement &qElement)
virtual bool | showPropertiesDialog ()
void | setUMLObject (UMLObject *obj)
Public Member Functions inherited from UMLWidget
| 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 ()
UMLWidget & | operator= (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)
void | moveByLocal (qreal dx, qreal dy)
virtual void | removeAssoc (AssociationWidget *pAssoc)
virtual void | addAssoc (AssociationWidget *pAssoc)
AssociationWidgetList & | associationWidgetList () 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 | loadFromXMI1 (QDomElement &qElement)
virtual void | saveToXMI1 (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 ()
UMLObject * | umlObject () 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 UMLWidget * | widgetWithID (Uml::ID::Type id)
WidgetType | baseType () const
void | setBaseType (const WidgetType &baseType)
QLatin1String | baseTypeStr () const
QString | baseTypeStrWithoutPrefix () const
virtual void | setSelected (bool select)
UMLScene * | umlScene () const
UMLDoc * | umlDoc () const
QString | documentation () const
bool | hasDocumentation ()
virtual void | setDocumentation (const QString &doc)
QString | name () const
virtual void | setName (const QString &strName)
QColor | lineColor () const
virtual void | setLineColor (const QColor &color)
uint | lineWidth () const
virtual void | setLineWidth (uint width)
QColor | textColor () const
virtual void | setTextColor (const QColor &color)
QColor | fillColor () const
virtual void | setFillColor (const QColor &color)
bool | usesDiagramLineColor () const
void | setUsesDiagramLineColor (bool state)
bool | usesDiagramLineWidth () const
void | setUsesDiagramLineWidth (bool state)
bool | useFillColor ()
virtual void | setUseFillColor (bool state)
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
virtual void | setFont (const QFont &font)
bool | autoResize ()
void | setAutoResize (bool state)
bool | changesShape ()
void | setChangesShape (bool state)
virtual bool | showPropertiesDialog ()
virtual bool | loadFromXMI1 (QDomElement &qElement)
virtual void | saveToXMI1 (QXmlStreamWriter &writer)
virtual void | removeAssoc (AssociationWidget *pAssoc)
virtual void | addAssoc (AssociationWidget *pAssoc)
WidgetBase & | operator= (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 UMLWidget * | onWidget (const QPointF &p)
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
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
ActivityWidget * | asActivityWidget ()
ActorWidget * | asActorWidget ()
ArtifactWidget * | asArtifactWidget ()
AssociationWidget * | asAssociationWidget ()
BoxWidget * | asBoxWidget ()
CategoryWidget * | asCategoryWidget ()
ClassifierWidget * | asClassifierWidget ()
CombinedFragmentWidget * | asCombinedFragmentWidget ()
ComponentWidget * | asComponentWidget ()
DatatypeWidget * | asDatatypeWidget ()
EntityWidget * | asEntityWidget ()
EnumWidget * | asEnumWidget ()
FloatingDashLineWidget * | asFloatingDashLineWidget ()
ForkJoinWidget * | asForkJoinWidget ()
InterfaceWidget * | asInterfaceWidget ()
MessageWidget * | asMessageWidget ()
NodeWidget * | asNodeWidget ()
NoteWidget * | asNoteWidget ()
ObjectNodeWidget * | asObjectNodeWidget ()
ObjectWidget * | asObjectWidget ()
PackageWidget * | asPackageWidget ()
PinWidget * | asPinWidget ()
PinPortBase * | asPinPortBase ()
PortWidget * | asPortWidget ()
PreconditionWidget * | asPreconditionWidget ()
RegionWidget * | asRegionWidget ()
SignalWidget * | asSignalWidget ()
StateWidget * | asStateWidget ()
FloatingTextWidget * | asFloatingTextWidget ()
UseCaseWidget * | asUseCaseWidget ()
UMLWidget * | asUMLWidget ()
virtual bool | activate (IDChangeLog *changeLog=0)
virtual void | setSelected (bool state)
Public Member Functions inherited from DiagramProxyWidget
| DiagramProxyWidget (UMLWidget *widget, qreal borderWidth=5)
virtual | ~DiagramProxyWidget ()
Uml::ID::Type | diagramLink () const
UMLScene * | linkedDiagram () const
bool | setDiagramLink (const Uml::ID::Type &id)
const QRectF & | clientRect ()
const QRectF & | sceneRect ()
void | setClientRect (const QRectF &rect)
bool | isProxyWidget ()
UMLWidget * | getProxiedWidget (const QPointF &p)
QPointF | mapFromClient (const QPointF &p)
QRectF | mapFromClient (const QRectF &r)
QPointF | mapToClient (const QPointF &pos)
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)

## Protected Member Functions
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
Protected Member Functions inherited from UMLWidget
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)
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
Protected Member Functions inherited from QGraphicsObjectWrapper
QVariant | itemChange (GraphicsItemChange change, const QVariant &value)
Protected Member Functions inherited from DiagramProxyWidget
DiagramProxyWidget & | operator= (const DiagramProxyWidget &other)
bool | activate (IDChangeLog *changeLog=0)
bool | loadFromXMI1 (QDomElement &qElement)
void | saveToXMI1 (QXmlStreamWriter &writer)
void | setupEvent (QGraphicsSceneMouseEvent &e, QGraphicsSceneMouseEvent *event, const QPointF &pos)
void | setupEvent (QGraphicsSceneContextMenuEvent &e, QGraphicsSceneContextMenuEvent *event, const QPointF &pos)
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)
void | slotMenuSelection (QAction *action)

## Private Slots
void | slotShowAttributes (bool state)
void | slotShowOperations (bool state)

## Private Member Functions
void | updateSignatureTypes ()
QSize | calculateTemplatesBoxSize () const
QSizeF | minimumSize () const
void | drawAsCircle (QPainter *p, const QStyleOptionGraphicsItem *option)
QSize | calculateAsCircleSize () const
void | drawAsPackage (QPainter *painter, const QStyleOptionGraphicsItem *option)
QSize | calculateAsPackageSize () const
int | displayedMembers (UMLObject::ObjectType ot) const
void | drawMembers (QPainter *painter, UMLObject::ObjectType ot, Uml::SignatureType::Enum sigType, int x, int y, int textWidth, int fontHeight)

## Private Attributes
VisualProperties | m_visualProperties
Uml::SignatureType::Enum | m_attributeSignature
| Loaded/saved item. More...
Uml::SignatureType::Enum | m_operationSignature
| Loaded/saved item. More...
AssociationWidget * | m_pAssocWidget
| related AssociationWidget in case this classifier acts as an association class More...
QPointer< FloatingTextWidget > | m_pInterfaceName
| Separate widget for name in case of interface drawn as circle. More...

## Static Private Attributes
static const int | CIRCLE_SIZE = 30
| size of circle when interface is rendered as such More...
static const int | SOCKET_INCREMENT = 10
| augmentation of circle for socket (required interface) More...

## Additional Inherited Members
Signals inherited from UMLWidget
void | sigWidgetMoved (Uml::ID::Type id)
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)
Static Public Attributes inherited from UMLWidget
static const QSizeF | DefaultMinimumSize
static const QSizeF | DefaultMaximumSize
static const int | defaultMargin = 5
static const int | selectionMarkerSize = 4
static const int | resizeMarkerLineCount = 3
Protected Attributes inherited from UMLWidget
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
UMLDoc * | m_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
UMLScene * | m_scene
QPointer< UMLObject > | m_umlObject
QString | m_Doc
| Only used if m_umlObject is not set. More...
QString | m_Text
QRectF | m_rect
| widget size 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}

## Detailed Description

Common implementation for class widget and interface widget.

Author
  Oliver Kellogg
  Gopala Krishna

See also
  UMLWidget 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

## ◆ VisualProperty

enum ClassifierWidget::VisualProperty

This enumeration lists the visual properties that can be easily set, reset and toggled and all these operate on an integer which stores all the flag status.

Enumerator
ShowStereotype |
ShowOperations |
ShowPublicOnly |
ShowVisibility |
ShowPackage |
ShowAttributes |
DrawAsCircle |
ShowOperationSignature | only in setter
ShowAttributeSignature | only in setter
DrawAsPackage |
ShowDocumentation |

## Constructor & Destructor Documentation

## ◆ ClassifierWidget() [1/3]

ClassifierWidget::ClassifierWidget | ( | UMLScene * | scene,
|  | UMLClassifier * | umlc
| ) |  |

Constructs a ClassifierWidget for a UMLClassifier.

Parameters

  scene | The parent of this ClassifierWidget.
  umlc | The UMLClassifier to represent.

## ◆ ClassifierWidget() [2/3]

ClassifierWidget::ClassifierWidget | ( | UMLScene * | scene,
|  | UMLInstance * | umli
| ) |  |

Constructs a ClassifierWidget for a UMLInstance.

Parameters

  scene | The parent of this ClassifierWidget.
  umli | The UMLInstance to represent.

## ◆ ClassifierWidget() [3/3]

ClassifierWidget::ClassifierWidget | ( | UMLScene * | scene,
|  | UMLPackage * | o
| ) |  |

Constructs a ClassifierWidget for a UMLPackage.

Parameters

  scene | The parent of this ClassifierWidget.
  o | The UMLPackage to represent.

## ◆ ~ClassifierWidget()

ClassifierWidget::~ClassifierWidget | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ attributeSignature()

Uml::SignatureType::Enum ClassifierWidget::attributeSignature | ( |  | ) | const

Returns whether to show attribute signatures. Only applies when m_umlObject->getBaseType() is ot_Class.

Returns
  Status of how attribute signatures are shown.

## ◆ calculateAsCircleSize()

QSize ClassifierWidget::calculateAsCircleSize | ( |  | ) | const
| private

Calculates the size of the object when drawn as a circle. Only applies when m_umlObject->getBaseType() is ot_Interface.

## ◆ calculateAsPackageSize()

QSize ClassifierWidget::calculateAsPackageSize | ( |  | ) | const
| private

## ◆ calculateSize()

QSizeF ClassifierWidget::calculateSize | ( | bool | withExtensions = `true` | ) | const
| virtual

Calculate content related size of widget. Overrides method from UMLWidget.

Reimplemented from UMLWidget.

## ◆ calculateTemplatesBoxSize()

QSize ClassifierWidget::calculateTemplatesBoxSize | ( |  | ) | const
| private

Calculcates the size of the templates box in the top left if it exists, returns QSize(0, 0) if it doesn't.

Returns
  QSize of the templates flap.

## ◆ changeToClass()

void ClassifierWidget::changeToClass | ( |  | ) |

Changes this classifier from an interface to a class. Attributes and stereotype visibility is got from the view OptionState. This widget is also updated.

## ◆ changeToInterface()

void ClassifierWidget::changeToInterface | ( |  | ) |

Changes this classifier from a class to an interface. Attributes are hidden and stereotype is shown. This widget is also updated.

## ◆ changeToPackage()

void ClassifierWidget::changeToPackage | ( |  | ) |

Changes this classifier from an "class-or-package" to a package. This widget is also updated.

## ◆ classAssociationWidget()

AssociationWidget * ClassifierWidget::classAssociationWidget | ( |  | ) | const

Return the AssociationWidget when this classifier acts as an association class (else return NULL.)

## ◆ classifier()

UMLClassifier * ClassifierWidget::classifier | ( |  | ) | const

Return the UMLClassifier which this ClassifierWidget represents.

## ◆ displayedAttributes()

int ClassifierWidget::displayedAttributes | ( |  | ) | const

Return the number of displayed attributes.

## ◆ displayedMembers()

int ClassifierWidget::displayedMembers | ( | UMLObject::ObjectType | ot | ) | const
| private

Return the number of displayed members of the given ObjectType. Takes into consideration m_showPublicOnly but not other settings.

## ◆ displayedOperations()

int ClassifierWidget::displayedOperations | ( |  | ) | const

Return the number of displayed operations.

## ◆ drawAsCircle()

void ClassifierWidget::drawAsCircle | ( | QPainter * | painter,
|  | const QStyleOptionGraphicsItem * | option
| ) |  |
| private

Draws the interface as a circle. Only applies when m_umlObject->getBaseType() is ot_Interface.

## ◆ drawAsPackage()

void ClassifierWidget::drawAsPackage | ( | QPainter * | painter,
|  | const QStyleOptionGraphicsItem * | option
| ) |  |
| private

## ◆ drawMembers()

void ClassifierWidget::drawMembers | ( | QPainter * | painter,
|  | UMLObject::ObjectType | ot,
|  | Uml::SignatureType::Enum | sigType,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height
| ) |  |
| private

Auxiliary method for draw() of child classes: Draw the attributes or operations.

Parameters

  p | QPainter to paint to.
  ot | Object type to draw, either ot_Attribute or ot_Operation.
  sigType | Governs details of the member display.
  x | X coordinate at which to draw the texts.
  y | Y coordinate at which text drawing commences.
  width | The text width.
  height | The text height.

## ◆ getDrawAsCircle()

bool ClassifierWidget::getDrawAsCircle | ( |  | ) | const

Returns whether to draw as circle. Only applies when m_umlObject->getBaseType() is ot_Interface.

Returns
  True if widget is drawn as circle.

## ◆ loadFromXMI1()

bool ClassifierWidget::loadFromXMI1 | ( | QDomElement & | qElement | ) |
| virtual

Loads the "classwidget" or "interfacewidget" XML element.

Reimplemented from UMLWidget.

## ◆ minimumSize()

QSizeF ClassifierWidget::minimumSize | ( |  | ) | const
| privatevirtual

Overrides method from UMLWidget.

Reimplemented from UMLWidget.

## ◆ mouseDoubleClickEvent()

void ClassifierWidget::mouseDoubleClickEvent | ( | QGraphicsSceneMouseEvent * | event | ) |
| protectedvirtual

Event handler for mouse double click events.

Parameters

  event | the QGraphicsSceneMouseEvent event.

Reimplemented from UMLWidget.

## ◆ onWidget()

UMLWidget * ClassifierWidget::onWidget | ( | const QPointF & | p | ) |
| virtual

Override method from UMLWidget in order to additionally check m_pInterfaceName.

Parameters

  p | Point to be checked.

Returns
  'this' if UMLWidget::onWidget(p) returns non 0; m_pInterfaceName if m_pName is non NULL and m_pInterfaceName->onWidget(p) returns non 0; else NULL.

Reimplemented from WidgetBase.

## ◆ operationSignature()

Uml::SignatureType::Enum ClassifierWidget::operationSignature | ( |  | ) | const

Returns
  The Uml::SignatureType::Enum value for the operations.

## ◆ paint()

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

Overrides standard method. Auxiliary to reimplementations in the derived classes.

Note
  keep fetching attributes in sync with calculateSize()

Reimplemented from UMLWidget.

## ◆ saveToXMI1()

void ClassifierWidget::saveToXMI1 | ( | QXmlStreamWriter & | writer | ) |
| virtual

Creates the "classwidget" or "interfacewidget" XML element.

Reimplemented from UMLWidget.

## ◆ setAttributeSignature()

void ClassifierWidget::setAttributeSignature | ( | Uml::SignatureType::Enum | sig | ) |

Sets the type of signature to display for an attribute. Only applies when m_umlObject->getBaseType() is ot_Class.

Parameters

  sig | Type of signature to display for an attribute.

## ◆ setClassAssociationWidget()

void ClassifierWidget::setClassAssociationWidget | ( | AssociationWidget * | assocwidget | ) |

Set the AssociationWidget when this ClassWidget acts as an association class.

## ◆ setDocumentation()

void ClassifierWidget::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 from WidgetBase.

## ◆ setDrawAsCircle()

void ClassifierWidget::setDrawAsCircle | ( | bool | drawAsCircle | ) |

Sets whether to draw as circle. Only applies when m_umlObject->getBaseType() is ot_Interface.

Parameters

  drawAsCircle | True if widget shall be drawn as circle.

## ◆ setOperationSignature()

void ClassifierWidget::setOperationSignature | ( | Uml::SignatureType::Enum | sig | ) |

Set the type of signature to display for an Operation

Parameters

  sig | Type of signature to display for an operation.

## ◆ setShowAttSigs()

void ClassifierWidget::setShowAttSigs | ( | bool | _status | ) |

Sets whether to show attribute signature Only applies when m_umlObject->getBaseType() is ot_Class.

Parameters

  _status | True if attribute signatures shall be shown.

## ◆ setShowStereotype()

void ClassifierWidget::setShowStereotype | ( | Uml::ShowStereoType::Enum | flag | ) |
| virtual

Reimplement method from UMLWidget.

Reimplemented from UMLWidget.

## ◆ setUMLObject()

void ClassifierWidget::setUMLObject | ( | UMLObject * | obj | ) |
| virtual

Overriding the method from WidgetBase because we need to do something extra in case this ClassifierWidget represents an interface widget used in component diagrams.

Reimplemented from WidgetBase.

## ◆ setVisualProperties()

void ClassifierWidget::setVisualProperties | ( | VisualProperties | properties | ) |

Set an OR combination of properties stored in properties on this widget.

## ◆ setVisualProperty()

void ClassifierWidget::setVisualProperty | ( | VisualProperty | property,
|  | bool | enable = `true`
| ) |  |

A convenient method to set and reset individual VisualProperty

Undo command.

Parameters

  property | The property to be set/reset.
  enable | True/false to set/reset. (default = true)

Note
  This method handles ShowAttributeSignature and ShowOperationSignature specially.

## ◆ setVisualPropertyCmd()

void ClassifierWidget::setVisualPropertyCmd | ( | VisualProperty | property,
|  | bool | enable = `true`
| ) |  |

A convenient method to set and reset individual VisualProperty

Parameters

  property | The property to be set/reset.
  enable | True/false to set/reset. (default = true)

Note
  This method handles ShowAttributeSignature and ShowOperationSignature specially.

## ◆ shape()

QPainterPath ClassifierWidget::shape | ( |  | ) | const
| virtual

Returns
  The shape of the ClassifierWidget.

## ◆ showPropertiesDialog()

bool ClassifierWidget::showPropertiesDialog | ( |  | ) |
| virtual

Show a properties dialog for a ClassifierWidget

Reimplemented from UMLWidget.

## ◆ slotMenuSelection

void ClassifierWidget::slotMenuSelection | ( | QAction * | action | ) |
| virtualslot

Will be called when a menu selection has been made from the popup menu.

Parameters

  action | The action that has been selected.

## ◆ slotShowAttributes

void ClassifierWidget::slotShowAttributes | ( | bool | state | ) |
| privateslot

Slot to show/hide attributes based on state.

## ◆ slotShowOperations

void ClassifierWidget::slotShowOperations | ( | bool | state | ) |
| privateslot

Slot to show/hide operations based on state.

## ◆ toggleDrawAsCircle()

void ClassifierWidget::toggleDrawAsCircle | ( |  | ) |

Toggles whether to draw as circle. Only applies when m_umlObject->getBaseType() is ot_Interface.

## ◆ toggleShowAttSigs()

void ClassifierWidget::toggleShowAttSigs | ( |  | ) |

Toggles whether to show attribute signatures. Only applies when m_umlObject->getBaseType() is ot_Class.

## ◆ toggleVisualProperty()

void ClassifierWidget::toggleVisualProperty | ( | VisualProperty | property | ) |

A convenient method to toggle individual VisualProperty of this widget.

Parameters

  property | The property to be toggled.

Note
  This method handles ShowAttributeSignature and ShowOperationSignature specially.

## ◆ updateSignatureTypes()

void ClassifierWidget::updateSignatureTypes | ( |  | ) |
| private

Updates m_operationSignature to match m_showVisibility.

## ◆ visualProperties()

ClassifierWidget::VisualProperties ClassifierWidget::visualProperties | ( |  | ) | const

Returns
  the visual properties

## ◆ visualProperty()

bool ClassifierWidget::visualProperty | ( | VisualProperty | property | ) | const

Returns
  The status of the property passed in.

Note
  Use attributeSignature() and operationSignature() to get signature status. This method only indicates whether signature is visible or not.

## ◆ widgetWithID()

UMLWidget * ClassifierWidget::widgetWithID | ( | Uml::ID::Type | id | ) |
| virtual

Reimplement function from UMLWidget.

Reimplemented from WidgetBase.

## Member Data Documentation

## ◆ CIRCLE_SIZE

const int ClassifierWidget::CIRCLE_SIZE = 30
| staticprivate

size of circle when interface is rendered as such

## ◆ m_attributeSignature

Uml::SignatureType::Enum ClassifierWidget::m_attributeSignature
| private

Loaded/saved item.

## ◆ m_operationSignature

Uml::SignatureType::Enum ClassifierWidget::m_operationSignature
| private

Loaded/saved item.

## ◆ m_pAssocWidget

AssociationWidget* ClassifierWidget::m_pAssocWidget
| private

related AssociationWidget in case this classifier acts as an association class

## ◆ m_pInterfaceName

QPointer<FloatingTextWidget> ClassifierWidget::m_pInterfaceName
| private

Separate widget for name in case of interface drawn as circle.

## ◆ m_visualProperties

VisualProperties ClassifierWidget::m_visualProperties
| private

## ◆ SOCKET_INCREMENT

const int ClassifierWidget::SOCKET_INCREMENT = 10
| staticprivate

augmentation of circle for socket (required interface)

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

- umbrello/umlwidgets/classifierwidget.h
- umbrello/umlwidgets/classifierwidget.cpp