ClassifierWidget Class Reference
Common implementation for class widget and interface widget. More...
#include <classifierwidget.h>
Inheritance diagram for ClassifierWidget:

Public Slots | |
| void | slotMenuSelection (int sel) |
| Will be called when a menu selection has been made from the popup menu. | |
Public Member Functions | |
| ClassifierWidget (UMLView *view, UMLClassifier *o) | |
| Constructs a ClassifierWidget. | |
| virtual | ~ClassifierWidget () |
| Destructor. | |
| void | toggleShowStereotype () |
| Toggles the status of whether to show StereoType. | |
| bool | getShowOps () const |
| Return the status of showing operations. | |
| void | setShowOps (bool _show) |
| Set the status of whether to show Operations. | |
| void | toggleShowOps () |
| Toggles the status of showing operations. | |
| bool | getShowPublicOnly () const |
| Return true if public operations/attributes are shown only. | |
| void | setShowPublicOnly (bool _status) |
| Set whether to show public operations/attributes only. | |
| void | toggleShowPublicOnly () |
| Toggle whether to show public operations/attributes only. | |
| bool | getShowVisibility () const |
| Returns the status of whether to show visibility. | |
| void | setShowVisibility (bool _visibility) |
| Set the status of whether to show visibility. | |
| void | toggleShowVisibility () |
| Toggles the status of whether to show visibility. | |
| Uml::Signature_Type | getShowOpSigs () const |
| Return the status of showing operation signatures. | |
| void | setShowOpSigs (bool _show) |
| Set the status of whether to show Operation signature. | |
| void | toggleShowOpSigs () |
| Toggles the status of showing operation signatures. | |
| bool | getShowPackage () const |
| Returns the status of whether to show Package. | |
| void | setShowPackage (bool _status) |
| Set the status of whether to show Package. | |
| void | toggleShowPackage () |
| Toggles the status of whether to show package. | |
| void | setOpSignature (Uml::Signature_Type sig) |
| Set the type of signature to display for an Operation. | |
| int | displayedAttributes () |
| Return the number of displayed attributes. | |
| int | displayedOperations () |
| Return the number of displayed operations. | |
| bool | getShowAtts () const |
| Returns whether to show attributes. | |
| void | toggleShowAtts () |
| Toggles whether to show attributes. | |
| Uml::Signature_Type | getShowAttSigs () |
| Returns whether to show attribute signatures. | |
| void | toggleShowAttSigs () |
| Toggles whether to show attribute signatures. | |
| void | setShowAtts (bool _show) |
| Sets whether to show attributes. | |
| void | setShowAttSigs (bool _show) |
| Sets whether to show attribute signature Only applies when m_pObject->getBaseType() is ot_Class. | |
| void | setAttSignature (Uml::Signature_Type sig) |
| Sets the type of signature to display for an attribute. | |
| bool | getDrawAsCircle () const |
| Returns whether to draw as circle. | |
| void | toggleDrawAsCircle () |
| Toggles whether to draw as circle. | |
| void | setDrawAsCircle (bool drawAsCircle) |
| Sets whether to draw as circle. | |
| void | changeToClass () |
| Changes this classifier from an interface to a class. | |
| void | changeToInterface () |
| Changes this classifier from a class to an interface. | |
| void | setClassAssocWidget (AssociationWidget *assocwidget) |
| Set the AssociationWidget when this ClassWidget acts as an association class. | |
| AssociationWidget * | getClassAssocWidget () |
| Return the AssociationWidget when this classifier acts as an association class (else return NULL.). | |
| UMLClassifier * | getClassifier () |
| Return the UMLClassifier which this ClassifierWidget represents. | |
| void | draw (QPainter &p, int offsetX, int offsetY) |
| Overrides standard method. | |
| virtual void | adjustAssocs (int x, int y) |
| Extends base method to adjust also the association of a class association. | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| Creates the <classwidget> or <interfacewidget>XML element. | |
| bool | loadFromXMI (QDomElement &qElement) |
| Loads the <classwidget> or <interfacewidget> XML element. | |
Protected Member Functions | |
| void | init () |
| Initializes key variables of the class. | |
| QSize | calculateTemplatesBoxSize () |
| Calculcates the size of the templates box in the top left if it exists, returns QSize(0,0) if it doesn't. | |
| QSize | calculateSize () |
| Overrides method from UMLWidget. | |
| void | drawAsCircle (QPainter &p, int offsetX, int offsetY) |
| Draws the interface as a circle with name underneath. | |
| QSize | calculateAsCircleSize () |
| Calculates the size of the object when drawn as a circle. | |
| void | updateSigs () |
| Updates m_ShowOpSigs to match m_bShowVisibility. | |
| int | displayedMembers (Uml::Object_Type ot) |
| Return the number of displayed members of the given Object_Type. | |
| void | drawMembers (QPainter &p, Uml::Object_Type ot, Uml::Signature_Type sigType, int x, int y, int fontHeight) |
| Auxiliary method for draw() of child classes: Draw the attributes or operations. | |
Protected Attributes | |
| bool | m_bShowOperations |
| Loaded/saved item. | |
| bool | m_bShowPublicOnly |
| Loaded/saved item. | |
| bool | m_bShowAccess |
| Loaded/saved item. | |
| bool | m_bShowPackage |
| Loaded/saved item. | |
| bool | m_bShowAttributes |
| Loaded/saved item. | |
| bool | m_bDrawAsCircle |
| Loaded/saved item. | |
| Uml::Signature_Type | m_ShowAttSigs |
| Loaded/saved item. | |
| Uml::Signature_Type | m_ShowOpSigs |
| Loaded/saved item. | |
| int | m_bodyOffsetY |
| Auxiliary variable for size calculations and drawing. | |
| AssociationWidget * | m_pAssocWidget |
| The related AssociationWidget in case this classifier acts as an association class. | |
Static Protected Attributes | |
| static const int | MARGIN = 5 |
| Text width margin. | |
| static const int | CIRCLE_SIZE = 30 |
| Size of circle when interface is rendered as such. | |
Detailed Description
Common implementation for class widget and interface widget.
- Author:
- Oliver Kellogg
- See also:
- UMLWidget Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 27 of file classifierwidget.h.
Constructor & Destructor Documentation
|
||||||||||||
|
Constructs a ClassifierWidget.
Definition at line 28 of file classifierwidget.cpp. References init(), m_bShowAttributes, WidgetBase::setBaseType(), and updateSigs(). |
|
|
Destructor.
Definition at line 39 of file classifierwidget.cpp. References m_pAssocWidget, and AssociationWidget::removeAssocClassLine(). |
Member Function Documentation
|
|
Toggles the status of whether to show StereoType.
Definition at line 107 of file classifierwidget.cpp. References UMLWidget::updateComponentSize(), and updateSigs(). Referenced by slotMenuSelection(). |
|
|
Return the status of showing operations.
Definition at line 115 of file classifierwidget.cpp. References m_bShowOperations. |
|
|
Set the status of whether to show Operations.
Definition at line 119 of file classifierwidget.cpp. References m_bShowOperations, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by ClassOptionsPage::updateWidget(). |
|
|
Toggles the status of showing operations.
Definition at line 126 of file classifierwidget.cpp. References m_bShowOperations, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by slotMenuSelection(). |
|
|
Return true if public operations/attributes are shown only.
Definition at line 133 of file classifierwidget.cpp. References m_bShowPublicOnly. |
|
|
Set whether to show public operations/attributes only.
Definition at line 137 of file classifierwidget.cpp. References m_bShowPublicOnly, and UMLWidget::updateComponentSize(). |
|
|
Toggle whether to show public operations/attributes only.
Definition at line 143 of file classifierwidget.cpp. References m_bShowPublicOnly, and UMLWidget::updateComponentSize(). Referenced by slotMenuSelection(). |
|
|
Returns the status of whether to show visibility.
Definition at line 149 of file classifierwidget.cpp. References m_bShowAccess. |
|
|
Set the status of whether to show visibility.
Definition at line 153 of file classifierwidget.cpp. References m_bShowAccess, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by ClassOptionsPage::updateWidget(). |
|
|
Toggles the status of whether to show visibility.
Definition at line 160 of file classifierwidget.cpp. References m_bShowAccess, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by slotMenuSelection(). |
|
|
Return the status of showing operation signatures.
Definition at line 167 of file classifierwidget.cpp. References m_ShowOpSigs. |
|
|
Set the status of whether to show Operation signature.
Definition at line 171 of file classifierwidget.cpp. References m_bShowAccess, m_ShowOpSigs, and UMLWidget::updateComponentSize(). Referenced by ClassOptionsPage::updateWidget(). |
|
|
Toggles the status of showing operation signatures.
Definition at line 185 of file classifierwidget.cpp. References m_bShowAccess, m_ShowOpSigs, and UMLWidget::updateComponentSize(). Referenced by slotMenuSelection(). |
|
|
Returns the status of whether to show Package.
Definition at line 201 of file classifierwidget.cpp. References m_bShowPackage. |
|
|
Set the status of whether to show Package.
Definition at line 205 of file classifierwidget.cpp. References m_bShowPackage, and UMLWidget::updateComponentSize(). Referenced by ClassOptionsPage::updateWidget(). |
|
|
Toggles the status of whether to show package.
Definition at line 211 of file classifierwidget.cpp. References m_bShowPackage, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by slotMenuSelection(). |
|
|
Set the type of signature to display for an Operation.
Definition at line 218 of file classifierwidget.cpp. References m_ShowOpSigs, UMLWidget::updateComponentSize(), and updateSigs(). |
|
|
Return the number of displayed attributes.
Definition at line 498 of file classifierwidget.cpp. References displayedMembers(), and m_bShowAttributes. Referenced by calculateSize(), and draw(). |
|
|
Return the number of displayed operations.
Definition at line 293 of file classifierwidget.cpp. References displayedMembers(), and m_bShowOperations. Referenced by calculateSize(). |
|
|
Returns whether to show attributes. Only applies when m_pObject->getBaseType() is ot_Class.
Definition at line 162 of file classifierwidget.h. References m_bShowAttributes. Referenced by ClassOptionsPage::setupPage(). |
|
|
Toggles whether to show attributes. Only applies when m_pObject->getBaseType() is ot_Class. Definition at line 257 of file classifierwidget.cpp. References m_bShowAttributes, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by slotMenuSelection(). |
|
|
Returns whether to show attribute signatures. Only applies when m_pObject->getBaseType() is ot_Class.
Definition at line 178 of file classifierwidget.h. References m_ShowAttSigs. Referenced by ClassOptionsPage::setupPage(). |
|
|
Toggles whether to show attribute signatures. Only applies when m_pObject->getBaseType() is ot_Class. Definition at line 265 of file classifierwidget.cpp. References m_bShowAccess, m_ShowAttSigs, and UMLWidget::updateComponentSize(). Referenced by slotMenuSelection(). |
|
|
Sets whether to show attributes. Only applies when m_pObject->getBaseType() is ot_Class.
Definition at line 225 of file classifierwidget.cpp. References m_bShowAttributes, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by ClassOptionsPage::updateWidget(). |
|
|
Sets whether to show attribute signature Only applies when m_pObject->getBaseType() is ot_Class.
Definition at line 240 of file classifierwidget.cpp. References m_bShowAccess, m_ShowAttSigs, and UMLWidget::updateComponentSize(). Referenced by init(), and ClassOptionsPage::updateWidget(). |
|
|
Sets the type of signature to display for an attribute. Only applies when m_pObject->getBaseType() is ot_Class.
Definition at line 233 of file classifierwidget.cpp. References m_ShowAttSigs, UMLWidget::updateComponentSize(), and updateSigs(). |
|
|
Returns whether to draw as circle. Only applies when m_pObject->getBaseType() is ot_Interface.
Definition at line 713 of file classifierwidget.cpp. References m_bDrawAsCircle. Referenced by ListPopupMenu::ListPopupMenu(), and ClassOptionsPage::setupPage(). |
|
|
Toggles whether to draw as circle. Only applies when m_pObject->getBaseType() is ot_Interface. Definition at line 717 of file classifierwidget.cpp. References m_bDrawAsCircle, UMLWidget::updateComponentSize(), and updateSigs(). Referenced by slotMenuSelection(). |
|
|
Sets whether to draw as circle. Only applies when m_pObject->getBaseType() is ot_Interface.
Definition at line 707 of file classifierwidget.cpp. References m_bDrawAsCircle, and UMLWidget::updateComponentSize(). Referenced by Widget_Factory::createWidget(), and ClassOptionsPage::updateWidget(). |
|
|
Changes this classifier from an interface to a class. Attributes and stereotype visibility is got from the view OptionState. This widget is also updated. Definition at line 724 of file classifierwidget.cpp. References getClassifier(), UMLView::getOptionState(), m_bShowAttributes, UMLClassifier::setBaseType(), WidgetBase::setBaseType(), and UMLWidget::updateComponentSize(). Referenced by slotMenuSelection(). |
|
|
Changes this classifier from a class to an interface. Attributes are hidden and stereotype is shown. This widget is also updated. Definition at line 736 of file classifierwidget.cpp. References getClassifier(), m_bShowAttributes, UMLClassifier::setBaseType(), WidgetBase::setBaseType(), and UMLWidget::updateComponentSize(). Referenced by slotMenuSelection(). |
|
|
Set the AssociationWidget when this ClassWidget acts as an association class.
Definition at line 504 of file classifierwidget.cpp. References getClassifier(), m_pAssocWidget, and UMLClassifier::setClassAssoc(). Referenced by AssociationWidget::createAssocClassLine(), AssociationWidget::loadFromXMI(), and AssociationWidget::removeAssocClassLine(). |
|
|
Return the AssociationWidget when this classifier acts as an association class (else return NULL.).
Definition at line 512 of file classifierwidget.cpp. References m_pAssocWidget. |
|
|
Return the UMLClassifier which this ClassifierWidget represents.
Definition at line 516 of file classifierwidget.cpp. Referenced by calculateSize(), calculateTemplatesBoxSize(), changeToClass(), changeToInterface(), displayedMembers(), draw(), drawMembers(), ListPopupMenu::ListPopupMenu(), saveToXMI(), setClassAssocWidget(), and slotMenuSelection(). |
|
||||||||||||||||
|
Overrides standard method. Auxiliary to reimplementations in the derived classes. Implements UMLWidget. Definition at line 520 of file classifierwidget.cpp. References calculateTemplatesBoxSize(), displayedAttributes(), drawAsCircle(), drawMembers(), UMLWidget::drawSelected(), UMLObject::getAbstract(), getClassifier(), UMLWidget::getFont(), UMLWidget::getFontMetrics(), UMLObject::getFullyQualifiedName(), UMLWidget::getName(), UMLObject::getStereotype(), UMLClassifier::getTemplateList(), m_bDrawAsCircle, m_bodyOffsetY, m_bShowAttributes, m_bShowOperations, m_bShowPackage, m_ShowAttSigs, m_ShowOpSigs, MARGIN, and UMLWidget::setPen(). |
|
||||||||||||
|
Extends base method to adjust also the association of a class association. Executes the base method and then, if file isn't loading and the classifier acts as a class association, the association position is updated.
Reimplemented from UMLWidget. Definition at line 747 of file classifierwidget.cpp. References UMLWidget::adjustAssocs(), AssociationWidget::computeAssocClassLine(), UMLDoc::loading(), and m_pAssocWidget. |
|
||||||||||||
|
Creates the <classwidget> or <interfacewidget>XML element.
Reimplemented from UMLWidget. Definition at line 757 of file classifierwidget.cpp. References UMLObject::getAbstract(), getClassifier(), UMLClassifier::isInterface(), m_bDrawAsCircle, m_bShowAccess, m_bShowAttributes, m_bShowOperations, m_bShowPackage, m_bShowPublicOnly, m_ShowAttSigs, and m_ShowOpSigs. |
|
|
Loads the <classwidget> or <interfacewidget> XML element.
Reimplemented from UMLWidget. Definition at line 779 of file classifierwidget.cpp. References m_bDrawAsCircle, m_bShowAccess, m_bShowAttributes, m_bShowOperations, m_bShowPackage, m_bShowPublicOnly, m_ShowAttSigs, and m_ShowOpSigs. |
|
|
Will be called when a menu selection has been made from the popup menu.
Reimplemented from UMLWidget. Definition at line 395 of file classifierwidget.cpp. References changeToClass(), changeToInterface(), ListPopupMenu::convert_MT_OT(), getClassifier(), UMLApp::getDocument(), UMLDoc::setModified(), UMLWidget::slotMenuSelection(), toggleDrawAsCircle(), toggleShowAtts(), toggleShowAttSigs(), toggleShowOps(), toggleShowOpSigs(), toggleShowPackage(), toggleShowPublicOnly(), toggleShowStereotype(), toggleShowVisibility(), and UMLWidget::updateComponentSize(). |
|
|
Initializes key variables of the class.
Reimplemented from UMLWidget. Definition at line 47 of file classifierwidget.cpp. References UMLView::getOptionState(), m_bDrawAsCircle, m_bShowAccess, m_bShowAttributes, m_bShowOperations, m_bShowPackage, m_bShowPublicOnly, m_pAssocWidget, m_ShowAttSigs, m_ShowOpSigs, WidgetBase::setBaseType(), and setShowAttSigs(). Referenced by ClassifierWidget(). |
|
|
Calculcates the size of the templates box in the top left if it exists, returns QSize(0,0) if it doesn't.
Definition at line 470 of file classifierwidget.cpp. References getClassifier(), UMLWidget::getFont(), UMLClassifier::getTemplateList(), and MARGIN. Referenced by calculateSize(), and draw(). |
|
|
Overrides method from UMLWidget.
Reimplemented from UMLWidget. Definition at line 299 of file classifierwidget.cpp. References calculateAsCircleSize(), UMLWidget::calculateSize(), calculateTemplatesBoxSize(), displayedAttributes(), displayedOperations(), UMLObject::getAbstract(), getClassifier(), UMLClassifier::getFilteredList(), UMLWidget::getFontMetrics(), UMLObject::getFullyQualifiedName(), UMLObject::getName(), UMLObject::getStereotype(), m_bDrawAsCircle, m_bShowAttributes, m_bShowOperations, m_bShowPackage, m_bShowPublicOnly, m_ShowAttSigs, m_ShowOpSigs, and MARGIN. |
|
||||||||||||||||
|
Draws the interface as a circle with name underneath. Only applies when m_pObject->getBaseType() is ot_Interface. Definition at line 641 of file classifierwidget.cpp. References CIRCLE_SIZE, UMLWidget::drawSelected(), UMLWidget::getFont(), UMLWidget::getFontMetrics(), UMLObject::getFullyQualifiedName(), UMLWidget::getName(), and m_bShowPackage. Referenced by draw(). |
|
|
Calculates the size of the object when drawn as a circle. Only applies when m_pObject->getBaseType() is ot_Interface. Definition at line 665 of file classifierwidget.cpp. References CIRCLE_SIZE, UMLWidget::getFontMetrics(), UMLObject::getFullyQualifiedName(), UMLObject::getName(), m_bShowPackage, and MARGIN. Referenced by calculateSize(). |
|
|
Updates m_ShowOpSigs to match m_bShowVisibility.
Definition at line 77 of file classifierwidget.cpp. References m_bShowAccess, m_ShowAttSigs, m_ShowOpSigs, and UMLWidget::updateComponentSize(). Referenced by ClassifierWidget(), setAttSignature(), setOpSignature(), setShowAtts(), setShowOps(), setShowVisibility(), toggleDrawAsCircle(), toggleShowAtts(), toggleShowOps(), toggleShowPackage(), toggleShowStereotype(), and toggleShowVisibility(). |
|
|
Return the number of displayed members of the given Object_Type. Takes into consideration m_bShowPublicOnly but not other settings, Definition at line 283 of file classifierwidget.cpp. References getClassifier(), UMLClassifier::getFilteredList(), and m_bShowPublicOnly. Referenced by displayedAttributes(), and displayedOperations(). |
|
||||||||||||||||||||||||||||
|
Auxiliary method for draw() of child classes: Draw the attributes or operations.
Definition at line 686 of file classifierwidget.cpp. References getClassifier(), UMLClassifier::getFilteredList(), UMLWidget::getFont(), and m_bShowPublicOnly. Referenced by draw(). |
Member Data Documentation
|
|
Loaded/saved item.
Definition at line 360 of file classifierwidget.h. Referenced by calculateSize(), displayedOperations(), draw(), getShowOps(), init(), loadFromXMI(), saveToXMI(), setShowOps(), and toggleShowOps(). |
|
|
Loaded/saved item.
Definition at line 361 of file classifierwidget.h. Referenced by calculateSize(), displayedMembers(), drawMembers(), getShowPublicOnly(), init(), loadFromXMI(), saveToXMI(), setShowPublicOnly(), and toggleShowPublicOnly(). |
|
|
Loaded/saved item.
Definition at line 362 of file classifierwidget.h. Referenced by getShowVisibility(), init(), loadFromXMI(), saveToXMI(), setShowAttSigs(), setShowOpSigs(), setShowVisibility(), toggleShowAttSigs(), toggleShowOpSigs(), toggleShowVisibility(), and updateSigs(). |
|
|
Loaded/saved item.
Definition at line 363 of file classifierwidget.h. Referenced by calculateAsCircleSize(), calculateSize(), draw(), drawAsCircle(), getShowPackage(), init(), loadFromXMI(), saveToXMI(), setShowPackage(), and toggleShowPackage(). |
|
|
Loaded/saved item.
Definition at line 364 of file classifierwidget.h. Referenced by calculateSize(), changeToClass(), changeToInterface(), ClassifierWidget(), displayedAttributes(), draw(), getShowAtts(), init(), loadFromXMI(), saveToXMI(), setShowAtts(), and toggleShowAtts(). |
|
|
Loaded/saved item.
Definition at line 365 of file classifierwidget.h. Referenced by calculateSize(), draw(), getDrawAsCircle(), init(), loadFromXMI(), saveToXMI(), setDrawAsCircle(), and toggleDrawAsCircle(). |
|
|
Loaded/saved item.
Definition at line 366 of file classifierwidget.h. Referenced by calculateSize(), draw(), getShowAttSigs(), init(), loadFromXMI(), saveToXMI(), setAttSignature(), setShowAttSigs(), toggleShowAttSigs(), and updateSigs(). |
|
|
Loaded/saved item.
Definition at line 367 of file classifierwidget.h. Referenced by calculateSize(), draw(), getShowOpSigs(), init(), loadFromXMI(), saveToXMI(), setOpSignature(), setShowOpSigs(), toggleShowOpSigs(), and updateSigs(). |
|
|
Text width margin.
Definition at line 44 of file classifierwidget.cpp. Referenced by calculateAsCircleSize(), calculateSize(), calculateTemplatesBoxSize(), and draw(). |
|
|
Size of circle when interface is rendered as such.
Definition at line 45 of file classifierwidget.cpp. Referenced by calculateAsCircleSize(), and drawAsCircle(). |
|
|
Auxiliary variable for size calculations and drawing.
Definition at line 380 of file classifierwidget.h. Referenced by draw(). |
|
|
The related AssociationWidget in case this classifier acts as an association class.
Definition at line 386 of file classifierwidget.h. Referenced by adjustAssocs(), getClassAssocWidget(), init(), setClassAssocWidget(), and ~ClassifierWidget(). |
The documentation for this class was generated from the following files:
