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

Protected Member Functions

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

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

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

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
sceneThe parent of this ClassifierWidget.
umlcThe UMLClassifier to represent.
Here is the call graph for this function:

◆ ClassifierWidget() [2/3]

ClassifierWidget::ClassifierWidget ( UMLScene scene,
UMLInstance umli 
)

Constructs a ClassifierWidget for a UMLInstance.

Parameters
sceneThe parent of this ClassifierWidget.
umliThe UMLInstance to represent.
Here is the call graph for this function:

◆ ClassifierWidget() [3/3]

ClassifierWidget::ClassifierWidget ( UMLScene scene,
UMLPackage o 
)

Constructs a ClassifierWidget for a UMLPackage.

Parameters
sceneThe parent of this ClassifierWidget.
oThe UMLPackage to represent.
Here is the call graph for this function:

◆ ~ClassifierWidget()

ClassifierWidget::~ClassifierWidget ( )
virtual

Destructor.

Here is the call graph for this function:

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
Here is the call graph for this function:

◆ calculateSize()

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

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

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ changeToPackage()

void ClassifierWidget::changeToPackage ( )

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

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ displayedOperations()

int ClassifierWidget::displayedOperations ( ) const

Return the number of displayed operations.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ drawAsPackage()

void ClassifierWidget::drawAsPackage ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option 
)
private
Here is the call graph for this function:

◆ 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
painterQPainter to paint to.
otObject type to draw, either ot_Attribute or ot_Operation.
sigTypeGoverns details of the member display.
xX coordinate at which to draw the texts.
yY coordinate at which text drawing commences.
widthThe text width.
heightThe text height.
Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ loadFromXMI()

bool ClassifierWidget::loadFromXMI ( QDomElement &  qElement)
virtual

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

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ minimumSize()

QSizeF ClassifierWidget::minimumSize ( ) const
privatevirtual

Overrides method from UMLWidget.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ mouseDoubleClickEvent()

void ClassifierWidget::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Event handler for mouse double click events.

Parameters
eventthe QGraphicsSceneMouseEvent event.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ onWidget()

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

Override method from UMLWidget in order to additionally check m_pInterfaceName.

Parameters
pPoint 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ saveToXMI()

void ClassifierWidget::saveToXMI ( QXmlStreamWriter &  writer)
virtual

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

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ 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
sigType of signature to display for an attribute.
Here is the call graph for this function:

◆ setClassAssociationWidget()

void ClassifierWidget::setClassAssociationWidget ( AssociationWidget assocwidget)

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

Here is the call graph for this function:

◆ setDocumentation()

void ClassifierWidget::setDocumentation ( const QString &  doc)
virtual

Used by some child classes to set documentation.

Parameters
docThe documentation to be set in the UMLObject (if m_umlObject is set.)

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setDrawAsCircle()

void ClassifierWidget::setDrawAsCircle ( bool  drawAsCircle)

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

Parameters
drawAsCircleTrue if widget shall be drawn as circle.
Here is the call graph for this function:

◆ setOperationSignature()

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

Set the type of signature to display for an Operation

Parameters
sigType of signature to display for an operation.
Here is the call graph for this function:

◆ setShowAttSigs()

void ClassifierWidget::setShowAttSigs ( bool  _status)

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

Parameters
_statusTrue if attribute signatures shall be shown.
Here is the call graph for this function:

◆ setShowStereotype()

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

Reimplement method from UMLWidget.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ setVisualProperties()

void ClassifierWidget::setVisualProperties ( VisualProperties  properties)

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

Here is the call graph for this function:

◆ setVisualProperty()

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

A convenient method to set and reset individual VisualProperty

Undo command.

Parameters
propertyThe property to be set/reset.
enableTrue/false to set/reset. (default = true)
Note
This method handles ShowAttributeSignature and ShowOperationSignature specially.
Here is the call graph for this function:

◆ setVisualPropertyCmd()

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

A convenient method to set and reset individual VisualProperty

Parameters
propertyThe property to be set/reset.
enableTrue/false to set/reset. (default = true)
Note
This method handles ShowAttributeSignature and ShowOperationSignature specially.
Here is the call graph for this function:

◆ shape()

QPainterPath ClassifierWidget::shape ( ) const
virtual
Returns
The shape of the ClassifierWidget.
Here is the call graph for this function:

◆ showPropertiesDialog()

bool ClassifierWidget::showPropertiesDialog ( )
virtual

Show a properties dialog for a ClassifierWidget

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ slotMenuSelection

void ClassifierWidget::slotMenuSelection ( QAction *  action)
virtualslot

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

Parameters
actionThe action that has been selected.
Here is the call graph for this function:

◆ slotShowAttributes

void ClassifierWidget::slotShowAttributes ( bool  state)
privateslot

Slot to show/hide attributes based on state.

Here is the call graph for this function:

◆ slotShowOperations

void ClassifierWidget::slotShowOperations ( bool  state)
privateslot

Slot to show/hide operations based on state.

Here is the call graph for this function:

◆ toggleDrawAsCircle()

void ClassifierWidget::toggleDrawAsCircle ( )

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

Here is the call graph for this function:

◆ toggleShowAttSigs()

void ClassifierWidget::toggleShowAttSigs ( )

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

Here is the call graph for this function:

◆ toggleVisualProperty()

void ClassifierWidget::toggleVisualProperty ( VisualProperty  property)

A convenient method to toggle individual VisualProperty of this widget.

Parameters
propertyThe property to be toggled.
Note
This method handles ShowAttributeSignature and ShowOperationSignature specially.
Here is the call graph for this function:

◆ updateSignatureTypes()

void ClassifierWidget::updateSignatureTypes ( )
private

Updates m_operationSignature to match m_showVisibility.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

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: