FloatingTextWidget Class Reference
This is a multipurpose class. Displays a line of text or an operation. More...
#include <floatingtextwidget.h>
Inheritance diagram for FloatingTextWidget:

Public Slots | |
| void | slotMenuSelection (int sel) |
| Called when a menu selection has been made. | |
| void | setMessageText () |
| Sets the text for this label if it is acting as a sequence diagram message or a collaboration diagram message. | |
Public Member Functions | |
| FloatingTextWidget (UMLView *view, Uml::Text_Role role=Uml::tr_Floating, const QString &text="", Uml::IDType id=Uml::id_None) | |
| Constructs a FloatingTextWidget instance. | |
| virtual | ~FloatingTextWidget () |
| destructor | |
| void | setText (const QString &t) |
| Set the main body of text to display. | |
| void | setPreText (const QString &t) |
| Set some text to be prepended to the main body of text. | |
| void | setPostText (const QString &t) |
| Set some text to be appended to the main body of text. | |
| void | setSeqNum (const QString &sn) |
| Set the sequence number to display. | |
| QString | getSeqNum () const |
| Return the sequence number. | |
| void | setOperation (const QString &op) |
| Set the operation to display. | |
| QString | getText () const |
| Use to get the _main body_ of text (e.g. | |
| QString | getPreText () const |
| Use to get the pre-text which is prepended to the main body of text to be displayed. | |
| QString | getPostText () const |
| Use to get the post-text which is appended to the main body of text to be displayed. | |
| QString | getDisplayText () const |
| Use to get the total text (prepended + main body + appended) currently displayed by the widget. | |
| void | changeTextDlg () |
| Displays a dialog box to change the text. | |
| void | setLink (LinkWidget *l) |
| Set the LinkWidget that this FloatingTextWidget is related to. | |
| LinkWidget * | getLink () |
| Returns the LinkWidget this floating text is related to. | |
| bool | isText () |
| Returns whether this is a line of text. | |
| bool | activate (IDChangeLog *ChangeLog=0) |
| Activate the FloatingTextWidget after the saved data has been loaded. | |
| void | setRole (Uml::Text_Role role) |
| Sets the role type of this FloatingTextWidget. | |
| Uml::Text_Role | getRole () const |
| Return the role of the text widget. | |
| void | draw (QPainter &p, int offsetX, int offsetY) |
| Overrides default method. | |
| void | handleRename () |
| Handle the ListPopupMenu::mt_Rename case of the slotMenuSelection. | |
| void | showOpDlg () |
| Shows an operation dialog box. | |
| void | showProperties () |
| Show the properties for a FloatingTextWidget. | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| Creates the <floatingtext> XMI element. | |
| bool | loadFromXMI (QDomElement &qElement) |
| Loads the <floatingtext> XMI element. | |
Static Public Member Functions | |
| static bool | isTextValid (const QString &text) |
| For a text to be valid it must be non-empty, i.e. | |
Static Public Attributes | |
| static const int | restrictPositionMin = 0 |
| sometimes the x/y values get numbers of <0 and >10000 - which is probably due to a bug somewhere in calculating the position. | |
| static const int | restrictPositionMax = 3000 |
Protected Member Functions | |
| QSize | calculateSize () |
| Overrides method from UMLWidget. | |
Friends | |
| class | FloatingTextWidgetController |
Detailed Description
This is a multipurpose class. Displays a line of text or an operation.In its simplest form it will display a line of text. It can also be setup to be the text for an operation with regard to the MessageWidget on the sequence diagram. It is also used for the text required for an association.
The differences between all these different uses will be the popup menu that is associated with it.
- Author:
- Paul Hensgen <phensgen@techie.com>
- See also:
- UMLWidget Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 38 of file floatingtextwidget.h.
Constructor & Destructor Documentation
|
||||||||||||||||||||
|
Constructs a FloatingTextWidget instance.
Definition at line 40 of file floatingtextwidget.cpp. References UMLWidget::init(), UMLWidget::setZ(), and UMLWidget::updateComponentSize(). |
|
|
destructor
Definition at line 66 of file floatingtextwidget.cpp. |
Member Function Documentation
|
|
Set the main body of text to display.
Definition at line 228 of file floatingtextwidget.cpp. References LinkWidget::getSeqNumAndOp(), UMLView::getShowOpSig(), and UMLWidget::updateComponentSize(). Referenced by changeTextDlg(), handleRename(), and AssociationWidget::setName(). |
|
|
Set some text to be prepended to the main body of text.
Definition at line 244 of file floatingtextwidget.cpp. References UMLWidget::updateComponentSize(). |
|
|
Set some text to be appended to the main body of text.
Definition at line 251 of file floatingtextwidget.cpp. References UMLWidget::updateComponentSize(). |
|
|
Set the sequence number to display.
|
|
|
Return the sequence number.
|
|
|
Set the operation to display.
|
|
|
Use to get the _main body_ of text (e.g. prepended and appended text is omitted) as currently displayed by the widget.
Definition at line 337 of file floatingtextwidget.cpp. Referenced by MessageWidget::activate(), AssociationWidget::activate(), changeTextDlg(), AssociationWidget::getMulti(), AssociationWidget::getName(), AssociationWidget::getRoleName(), handleRename(), AssociationWidget::loadFromXMI(), MessageWidget::saveToXMI(), setMessageText(), UMLView::slotMenuSelection(), slotMenuSelection(), and AssociationWidget::slotMenuSelection(). |
|
|
Use to get the pre-text which is prepended to the main body of text to be displayed.
Definition at line 329 of file floatingtextwidget.cpp. |
|
|
Use to get the post-text which is appended to the main body of text to be displayed.
Definition at line 333 of file floatingtextwidget.cpp. |
|
|
Use to get the total text (prepended + main body + appended) currently displayed by the widget.
Definition at line 350 of file floatingtextwidget.cpp. Referenced by UMLView::addWidget(), calculateSize(), draw(), MessageWidget::setSelected(), and MessageWidget::setTextPosition(). |
|
|
Displays a dialog box to change the text.
Definition at line 257 of file floatingtextwidget.cpp. References getText(), isTextValid(), setText(), and UMLWidget::updateComponentSize(). Referenced by UMLView::slotMenuSelection(). |
|
|
Set the LinkWidget that this FloatingTextWidget is related to.
Definition at line 365 of file floatingtextwidget.cpp. Referenced by AssociationWidget::activate(), AssociationWidget::loadFromXMI(), MessageWidget::setLinkAndTextPos(), and AssociationWidget::setName(). |
|
|
Returns the LinkWidget this floating text is related to.
Definition at line 369 of file floatingtextwidget.cpp. Referenced by UMLView::selectWidgets(). |
|
|
Returns whether this is a line of text. Used for transparency in printing.
Reimplemented from UMLWidget. Definition at line 174 of file floatingtextwidget.h. |
|
|
Activate the FloatingTextWidget after the saved data has been loaded.
Reimplemented from UMLWidget. Definition at line 358 of file floatingtextwidget.cpp. Referenced by AssociationWidget::activate(). |
|
|
Sets the role type of this FloatingTextWidget.
Definition at line 373 of file floatingtextwidget.cpp. Referenced by AssociationWidget::activate(). |
|
|
Return the role of the text widget.
Definition at line 377 of file floatingtextwidget.cpp. Referenced by UMLWidget::activate(), UMLView::getSelectCount(), UMLView::getSelectedWidgets(), and MessageWidget::setTextPosition(). |
|
|
For a text to be valid it must be non-empty, i.e. have a length larger that zero, and have at least one non whitespace character.
Definition at line 381 of file floatingtextwidget.cpp. Referenced by changeTextDlg(), handleRename(), AssociationWidget::loadFromXMI(), and UMLView::slotMenuSelection(). |
|
||||||||||||||||
|
Overrides default method.
Implements UMLWidget. Definition at line 69 of file floatingtextwidget.cpp. References UMLWidget::drawSelected(), and getDisplayText(). |
|
|
Handle the ListPopupMenu::mt_Rename case of the slotMenuSelection. Given an own method because it requires rather lengthy code. Definition at line 158 of file floatingtextwidget.cpp. References UMLApp::getDocument(), getText(), isTextValid(), UMLView::removeWidget(), AssociationWidget::setChangeability(), UMLDoc::setModified(), AssociationWidget::setMulti(), UMLWidget::setName(), AssociationWidget::setName(), AssociationWidget::setRoleName(), setText(), LinkWidget::setText(), and UMLWidget::updateComponentSize(). Referenced by showProperties(), UMLWidget::slotMenuSelection(), and slotMenuSelection(). |
|
|
|
Show the properties for a FloatingTextWidget. Depending on the role of the floating text wiget, the options dialog for the floating text widget, the rename dialog for floating text or the options dialog for the link widget are shown. Reimplemented from UMLWidget. Definition at line 391 of file floatingtextwidget.cpp. References handleRename(), LinkWidget::showDialog(), and showOpDlg(). Referenced by slotMenuSelection(). |
|
||||||||||||
|
Creates the <floatingtext> XMI element.
Reimplemented from UMLWidget. Definition at line 403 of file floatingtextwidget.cpp. |
|
|
Loads the <floatingtext> XMI element.
Reimplemented from UMLWidget. Definition at line 419 of file floatingtextwidget.cpp. Referenced by MessageWidget::loadFromXMI(), and AssociationWidget::loadFromXMI(). |
|
|
Called when a menu selection has been made. This method is public due to called by MessageWidget when this is text for a MessageWidget.
Reimplemented from UMLWidget. Definition at line 89 of file floatingtextwidget.cpp. References UMLWidget::getFont(), LinkWidget::getOperationOwner(), getText(), handleRename(), LinkWidget::lwSetFont(), LinkWidget::resetTextPositions(), LinkWidget::setCustomOpText(), UMLWidget::setFont(), LinkWidget::setOperation(), showOpDlg(), showProperties(), and UMLWidget::slotMenuSelection(). Referenced by MessageWidgetController::doMouseDoubleClick(), and AssociationWidget::slotMenuSelection(). |
|
|
Sets the text for this label if it is acting as a sequence diagram message or a collaboration diagram message.
Definition at line 439 of file floatingtextwidget.cpp. References getText(), LinkWidget::setMessageText(), and UMLWidget::updateComponentSize(). Referenced by MessageWidget::setCustomOpText(), and showOpDlg(). |
|
|
Overrides method from UMLWidget.
Reimplemented from UMLWidget. Definition at line 82 of file floatingtextwidget.cpp. References getDisplayText(), and UMLWidget::getFontMetrics(). |
Member Data Documentation
|
|
sometimes the x/y values get numbers of <0 and >10000 - which is probably due to a bug somewhere in calculating the position. -> workaround till problem is found: define min and max limits => if x or y is outside of interval, the position is reset ( e.g. by AssociationWidget::resetTextPositions() ) Definition at line 49 of file floatingtextwidget.h. |
The documentation for this class was generated from the following files:
