umbrello/umbrello
floatingtextwidget.cpp
Go to the documentation of this file.
53 FloatingTextWidget::FloatingTextWidget(UMLScene * scene, Uml::TextRole::Enum role, const QString& text, Uml::ID::Type id)
105 if (m_textRole == Uml::TextRole::Seq_Message || m_textRole == Uml::TextRole::Seq_Message_Self) {
190 QString newText = KInputDialog::getText(i18n("Change Text"), i18n("Enter new text:"), text(), &ok, m_scene->activeView());
220 QPointer<SelectOpDlg> selectDlg = new SelectOpDlg(m_scene->activeView(), c, enableAutoIncrement);
283 if (m_textRole == Uml::TextRole::Coll_Message || m_textRole == Uml::TextRole::Coll_Message_Self ||
394 QString newText = KInputDialog::getText(i18n("Rename"), t, text(), &ok, m_scene->activeView(), &v);
445 if (m_linkWidget && m_textRole != Uml::TextRole::Seq_Message && m_textRole != Uml::TextRole::Seq_Message_Self) {
591 void FloatingTextWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void setRoleName(const QString &strRole, Uml::RoleType::Enum role)
Sets the text to the FloatingTextWidget that display the Role text of this association.
Definition: associationwidget.cpp:966
void setMultiplicity(const QString &text, Uml::RoleType::Enum role)
Sets the text in the FloatingTextWidget representing the multiplicity at the given side of the associ...
Definition: associationwidget.cpp:1073
void setTextRole(Uml::TextRole::Enum role)
Sets the role type of this FloatingTextWidget.
Definition: floatingtextwidget.cpp:355
virtual UMLClassifier * operationOwner()
Motivated by FloatingTextWidget::slotMenuSelection(mt_Operation)
Definition: linkwidget.cpp:32
void setAutoIncrementSequenceValue(const QString &value)
Definition: umlscene.cpp:232
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
QString autoIncrementSequenceValue(int increment=0) const
Definition: umlscene.cpp:227
Definition: cmd_handleRename.h:20
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1565
Classifiers (classes, interfaces) have lists of operations, attributes, templates and others...
Definition: classifierlistitem.h:29
Definition: basictypes.h:163
Definition: basictypes.h:209
This is an interface realized by AssociationWidget and MessageWidget.
Definition: linkwidget.h:35
Definition: basictypes.h:152
Definition: model_utils.h:112
Uml::TextRole::Enum textRole() const
Return the role of the text widget.
Definition: floatingtextwidget.cpp:364
void setPostText(const QString &t)
Set some text to be appended to the main body of text.
Definition: floatingtextwidget.cpp:142
virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY)
Overridden from UMLWidget.
Definition: floatingtextwidget.cpp:580
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Overrides default method.
Definition: floatingtextwidget.cpp:591
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
UMLOperation * createOperation(const QString &name=QString(), bool *isExistingOp=NULL, Model_Utils::NameAndType_List *params=NULL)
Creates an operation in the current document.
Definition: classifier.cpp:238
Definition: basictypes.h:210
Definition: listpopupmenu.h:114
Definition: umlwidget.h:220
Definition: basictypes.h:176
Definition: listpopupmenu.h:157
QString preText() const
Use to get the pre-text which is prepended to the main body of text to be displayed.
Definition: floatingtextwidget.cpp:300
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType)
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition: umlwidget.cpp:1619
void setTextcmd(const QString &t)
Method used by setText: its called by cmdsetTxt, Don't use it!
Definition: floatingtextwidget.cpp:179
Definition: basictypes.h:153
void setLink(LinkWidget *l)
Set the LinkWidget that this FloatingTextWidget is related to.
Definition: floatingtextwidget.cpp:335
Definition: listpopupmenu.h:193
Definition: umlobject.h:59
bool isSelected() const
Returns the state of whether the widget is selected.
Definition: umlwidget.h:87
virtual void setText(FloatingTextWidget *ft, const QString &newText)=0
Motivated by FloatingTextWidget::handleRename()
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Reimplemented from UMLWidget::saveToXMI to save the widget data into XMI 'floatingtext' element...
Definition: floatingtextwidget.cpp:635
void setAutoIncrementSequence(bool state)
Definition: umlscene.cpp:222
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:872
virtual void slotMenuSelection(QAction *action)
This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMe...
Definition: umlwidget.cpp:707
This class represents an association inside a diagram.
Definition: associationwidget.h:50
void setName(const QString &strName)
Sets the name in the corresponding UMLObject.
Definition: widgetbase.cpp:210
LinkWidget * link() const
Returns the LinkWidget this floating text is related to.
Definition: floatingtextwidget.cpp:345
void setType(UMLObject *type)
Reimplement method from UMLClassifierListItem.
Definition: operation.cpp:87
Definition: basictypes.h:151
Definition: basictypes.h:155
void handleRename()
Handle the ListPopupMenu::mt_Rename case of the slotMenuSelection.
Definition: floatingtextwidget.cpp:373
Enum fromInt(int item)
Convert a integer item into TextRole representation.
Definition: basictypes.cpp:590
virtual void calculateNameTextSegment()
Motivated by FloatingTextWidget::setLink().
Definition: linkwidget.cpp:83
void setName(const QString &strRole)
Sets the text in the FloatingTextWidget widget representing the Name of this association.
Definition: associationwidget.cpp:912
void setMessageText()
Sets the text for this label if it is acting as a sequence diagram message or a collaboration diagram...
Definition: floatingtextwidget.cpp:730
void showOperationDialog(bool enableAutoIncrement=true)
Shows an operation dialog box.
Definition: floatingtextwidget.cpp:207
void executeCommand(QUndoCommand *cmd)
Execute a command and pushit in the stack.
Definition: uml.cpp:3077
Definition: basictypes.h:162
Definition: listpopupmenu.h:158
Definition: basictypes.h:154
virtual bool activate(IDChangeLog *ChangeLog=0)
Activate the object after serializing it from a QDataStream.
Definition: umlwidget.cpp:890
virtual void slotMenuSelection(QAction *action)
Called when a menu selection has been made.
Definition: floatingtextwidget.cpp:657
Definition: cmd_setTxt.h:20
Definition: basictypes.h:160
QString displayText() const
Use to get the total text (prepended + main body + appended) currently displayed by the widget...
Definition: floatingtextwidget.cpp:155
virtual void setMessageText(FloatingTextWidget *ft)=0
Motivated by FloatingTextWidget::setMessageText()
virtual bool loadFromXMI(QDomElement &qElement)
A virtual method to load the properties of this widget from a QDomElement into this widget...
Definition: umlwidget.cpp:1726
virtual void constrainTextPos(qreal &textX, qreal &textY, qreal textWidth, qreal textHeight, Uml::TextRole::Enum tr)=0
Abstract operation implemented by inheriting classes.
bool autoIncrementSequence() const
Return the state of the auto increment sequence.
Definition: umlscene.cpp:217
void setModified(bool modified=true)
Sets the modified flag for the document after a modifying action on the view connected to the documen...
Definition: umldoc.cpp:2607
void setChangeability(Uml::Changeability::Enum value, Uml::RoleType::Enum role)
Sets the changeability on the given end of the Association.
Definition: associationwidget.cpp:1135
Definition: basictypes.h:158
QString postText() const
Use to get the post-text which is appended to the main body of text to be displayed.
Definition: floatingtextwidget.cpp:311
virtual void showPropertiesDialog()
Motivated by FloatingTextWidget::mouseDoubleClickEvent() Only applies to AssociationWidget.
Definition: linkwidget.cpp:75
Definition: basictypes.h:157
Parse_Status parseOperation(QString m, OpDescriptor &desc, UMLClassifier *owningScope)
Parses an operation given in UML syntax.
Definition: model_utils.cpp:793
virtual void resetTextPositions()
Motivated by FloatingTextWidget::slotMenuSelection(mt_Reset_Label_Positions) Only applies to Associat...
Definition: linkwidget.cpp:67
virtual bool loadFromXMI(QDomElement &qElement)
Loads the "floatingtext" XMI element.
Definition: floatingtextwidget.cpp:608
void setPreText(const QString &t)
Set some text to be prepended to the main body of text.
Definition: floatingtextwidget.cpp:131
UMLClassifierList findSuperClassConcepts(ClassifierType type=ALL)
Returns a list of concepts which this concept inherits from.
Definition: classifier.cpp:616
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
A virtual method to save the properties of this widget into a QDomElement i.e xml.
Definition: umlwidget.cpp:1707
UMLClassifierListItem * createChildObject(UMLClassifier *parent, UMLObject::ObjectType type)
Creates an operation, attribute, template, or enum literal for the parent classifier.
Definition: object_factory.cpp:242
virtual void setCustomOpText(const QString &opText)=0
Motivated by FloatingTextWidget::slotMenuSelection(mt_Operation)
UMLView * activeView() const
Returns the active view associated with this scene.
Definition: umlscene.cpp:193
Definition: listpopupmenu.h:156
virtual void setSeqNumAndOp(const QString &seqNum, const QString &op)=0
Motivated by FloatingTextWidget::showOpDlg()
virtual UMLClassifier * seqNumAndOp(QString &seqNum, QString &op)=0
Motivated by FloatingTextWidget::showOpDlg()
virtual void setFont(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1641
virtual void setOperation(UMLOperation *op)=0
Motivated by FloatingTextWidget::slotMenuSelection(mt_Operation)
static bool isTextValid(const QString &text)
For a text to be valid it must be non-empty, i.e.
Definition: floatingtextwidget.cpp:465
void changeName(const QString &newText)
Changes the text of linked widget.
Definition: floatingtextwidget.cpp:406
Definition: basictypes.h:156
static MenuType typeFromAction(QAction *action)
Convenience method to extract the ListPopupMenu type from an action.
Definition: listpopupmenu.cpp:1122
UMLOperation * findOperation(const QString &name, Model_Utils::NameAndType_List params)
Find an operation of the given name and parameter signature.
Definition: classifier.cpp:181
virtual void showPropertiesDialog()
Show the properties for a FloatingTextWidget.
Definition: floatingtextwidget.cpp:281
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Overridden from UMLWidget.
Definition: floatingtextwidget.cpp:521
void showChangeTextDialog()
Displays a dialog box to change the text.
Definition: floatingtextwidget.cpp:187
Definition: basictypes.h:161
virtual QFont font() const
Returns the font used for diaplaying any text.
Definition: widgetbase.cpp:431
virtual UMLOperation * operation()=0
Motivated by FloatingTextWidget::slotMenuSelection(mt_Operation)
bool activate(IDChangeLog *ChangeLog=0)
Activate the FloatingTextWidget after the saved data has been loaded.
Definition: floatingtextwidget.cpp:322
void setText(const QString &t)
Set the main body of text to display.
Definition: floatingtextwidget.cpp:103
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.