umbrello/umbrello
combinedfragmentwidget.cpp
Go to the documentation of this file.
38 CombinedFragmentWidget::CombinedFragmentWidget(UMLScene * scene, CombinedFragmentType combinedfragmentType, Uml::ID::Type id)
49 for(QList<FloatingDashLineWidget*>::iterator it=m_dashLines.begin() ; it!=m_dashLines.end() ; ++it) {
57 void CombinedFragmentWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
87 painter->drawText(COMBINED_FRAGMENT_MARGIN, textStartY, w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignCenter, combined_fragment_value);
88 painter->drawText(COMBINED_FRAGMENT_MARGIN, 0, w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, "ref");
107 painter->drawText(COMBINED_FRAGMENT_MARGIN, 0, w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, temp);
130 painter->drawText(COMBINED_FRAGMENT_MARGIN, 20, w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, temp);
139 for(QList<FloatingDashLineWidget*>::iterator it=m_dashLines.begin() ; it!=m_dashLines.end() ; ++it) {
159 for(QList<FloatingDashLineWidget*>::iterator it=m_dashLines.begin() ; it!=m_dashLines.end() ; ++it) {
208 CombinedFragmentWidget::CombinedFragmentType CombinedFragmentWidget::combinedFragmentType() const
241 CombinedFragmentWidget::CombinedFragmentType CombinedFragmentWidget::combinedFragmentType(const QString& type) const
277 void CombinedFragmentWidget::askNameForWidgetType(UMLWidget* &targetWidget, const QString& dialogTitle,
282 const QStringList list = QStringList() << "Reference" << "Option" << "Break" << "Loop" << "Negative" << "Critical" << "Assertion" << "Alternative" << "Parallel" ;
283 const QStringList select = QStringList() << "Reference" << "Option" << "Break" << "Loop" << "Negative" << "Critical" << "Assertion" << "Alternative" << "Parallel" ;
284 QStringList result = KInputDialog::getItemList (dialogTitle, dialogPrompt, list, select, false, &pressedOK, UMLApp::app());
290 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the diagram referenced"), i18n("Enter the name of the diagram referenced"), i18n("Diagram name"));
292 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the guard of the loop"), i18n("Enter the guard of the loop"), i18n("-"));
294 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the first alternative name"), i18n("Enter the first alternative name"), i18n("-"));
314 for (QList<FloatingDashLineWidget*>::iterator it = m_dashLines.begin() ; it != m_dashLines.end() ; ++it) {
397 name = KInputDialog::getText(i18n("Enter first alternative"), i18n("Enter first alternative :"), m_Text, &ok);
400 name = KInputDialog::getText(i18n("Enter referenced diagram name"), i18n("Enter referenced diagram name :"), m_Text, &ok);
403 name = KInputDialog::getText(i18n("Enter the guard of the loop"), i18n("Enter the guard of the loop:"), m_Text, &ok);
CombinedFragmentType
Definition: combinedfragmentwidget.h:41
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1565
void askNameForWidget(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Helper function for requesting a name for an UMLWidget using a dialog.
Definition: dialog_utils.cpp:64
void removeDashLine(FloatingDashLineWidget *line)
Definition: combinedfragmentwidget.cpp:360
Definition: umlwidget.h:220
Definition: listpopupmenu.h:157
bool loadFromXMI(QDomElement &qElement)
Loads the "floatingdashline" XMI element.
Definition: floatingdashlinewidget.cpp:173
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType)
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition: umlwidget.cpp:1619
QString name() const
Gets the name from the corresponding UMLObject if this widget has an underlying UMLObject; if it does...
Definition: widgetbase.cpp:197
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
void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves the widget to the "combinedFragmentwidget" XMI element.
Definition: combinedfragmentwidget.cpp:305
CombinedFragmentType combinedFragmentType() const
Returns the type of combined fragment.
Definition: combinedfragmentwidget.cpp:208
void setCombinedFragmentType(CombinedFragmentType combinedfragmentType)
Sets the type of combined fragment.
Definition: combinedfragmentwidget.cpp:216
This class is used to draw dash lines for UML combined fragments.
Definition: floatingdashlinewidget.h:33
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
void slotMenuSelection(QAction *action)
Overrides the function from UMLWidget.
Definition: combinedfragmentwidget.cpp:371
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1391
CombinedFragmentWidget(UMLScene *scene, CombinedFragmentType combinedfragmentType=Ref, Uml::ID::Type id=Uml::ID::None)
Creates a Combined Fragment widget.
Definition: combinedfragmentwidget.cpp:38
CombinedFragmentType m_CombinedFragment
Type of CombinedFragment.
Definition: combinedfragmentwidget.h:81
bool loadFromXMI(QDomElement &qElement)
Loads the widget from the "CombinedFragmentwidget" XMI element.
Definition: combinedfragmentwidget.cpp:324
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
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Overrides the standard paint event.
Definition: combinedfragmentwidget.cpp:57
This class is the graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:36
static MenuType typeFromAction(QAction *action)
Convenience method to extract the ListPopupMenu type from an action.
Definition: listpopupmenu.cpp:1122
void askNameForWidgetType(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
...
Definition: combinedfragmentwidget.cpp:277
virtual QFont font() const
Returns the font used for diaplaying any text.
Definition: widgetbase.cpp:431
void setupNewWidget(UMLWidget *w)
Initialize and announce a newly created widget.
Definition: umlscene.cpp:512
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.