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, QLatin1String("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,
293 QStringList result = KInputDialog::getItemList (dialogTitle, dialogPrompt, list, select, false, &pressedOK, UMLApp::app());
299 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the diagram referenced"), i18n("Enter the name of the diagram referenced"), i18n("Diagram name"));
301 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the guard of the loop"), i18n("Enter the guard of the loop"), i18n("-"));
303 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the first alternative name"), i18n("Enter the first alternative name"), i18n("-"));
316 QDomElement combinedFragmentElement = qDoc.createElement(QLatin1String("combinedFragmentwidget"));
320 combinedFragmentElement.setAttribute(QLatin1String("CombinedFragmenttype"), m_CombinedFragment);
323 for (QList<FloatingDashLineWidget*>::iterator it = m_dashLines.begin() ; it != m_dashLines.end() ; ++it) {
407 name = KInputDialog::getText(i18n("Enter first alternative"), i18n("Enter first alternative :"), m_Text, &ok);
410 name = KInputDialog::getText(i18n("Enter referenced diagram name"), i18n("Enter referenced diagram name :"), m_Text, &ok);
413 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
qreal x() const
qreal y() const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1636
QDomNode appendChild(const QDomNode &newChild)
void push_back(const T &value)
QString attribute(const QString &name, const QString &defValue) const
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:67
void removeDashLine(FloatingDashLineWidget *line)
Definition: combinedfragmentwidget.cpp:370
Definition: umlwidget.h:215
int size() const
Definition: listpopupmenu.h:171
bool loadFromXMI(QDomElement &qElement)
Loads the "floatingdashline" XMI element.
Definition: floatingdashlinewidget.cpp:174
QSizeF minimumSize() const
Overrides method from UMLWidget.
Definition: combinedfragmentwidget.cpp:186
QString join(const QString &separator) const
void drawLine(const QLineF &line)
void setupNewWidget(UMLWidget *w, bool setPosition=true)
Initialize and announce a newly created widget.
Definition: umlscene.cpp:540
QString name() const
Gets the name from the corresponding UMLObject if this widget has an underlying UMLObject; if it does...
Definition: widgetbase.cpp:211
int size() const
virtual int type() const
virtual void slotMenuSelection(QAction *action)
This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMe...
Definition: umlwidget.cpp:772
QDomNode nextSibling() const
QDomElement toElement() const
void drawRect(const QRectF &rectangle)
void setFont(const QFont &font)
void append(const T &value)
void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves the widget to the "combinedFragmentwidget" XMI element.
Definition: combinedfragmentwidget.cpp:314
CombinedFragmentType combinedFragmentType() const
Returns the type of combined fragment.
Definition: combinedfragmentwidget.cpp:208
void setPen(const QColor &color)
void setAttribute(const QString &name, const QString &value)
void setCombinedFragmentType(CombinedFragmentType combinedfragmentType)
Sets the type of combined fragment.
Definition: combinedfragmentwidget.cpp:216
int toInt(bool *ok, int base) const
bool isEmpty() const
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
This class is used to draw dash lines for UML combined fragments.
Definition: floatingdashlinewidget.h:33
T & first()
virtual bool loadFromXMI(QDomElement &qElement)
A virtual method to load the properties of this widget from a QDomElement into this widget...
Definition: umlwidget.cpp:1833
void slotMenuSelection(QAction *action)
Overrides the function from UMLWidget.
Definition: combinedfragmentwidget.cpp:381
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1461
iterator end()
int width(const QString &text, int len) const
bool contains(const T &value) const
CombinedFragmentWidget(UMLScene *scene, CombinedFragmentType combinedfragmentType=Ref, Uml::ID::Type id=Uml::ID::None)
Creates a Combined Fragment widget.
Definition: combinedfragmentwidget.cpp:38
bool isNull() const
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:333
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:1810
QDomNode firstChild() const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Overrides the standard paint event.
Definition: combinedfragmentwidget.cpp:57
int length() const
void clipSize()
clip the size of this widget against the minimal and maximal limits.
Definition: umlwidget.cpp:1572
This class is the graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:36
QString tagName() const
static MenuType typeFromAction(QAction *action)
Convenience method to extract the ListPopupMenu type from an action.
Definition: listpopupmenu.cpp:1234
QDomElement createElement(const QString &tagName)
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Returns the font metric used by this object for Text which uses bold/italic fonts.
Definition: umlwidget.cpp:1701
void askNameForWidgetType(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
...
Definition: combinedfragmentwidget.cpp:277
bool removeOne(const T &value)
T & back()
iterator begin()
virtual QFont font() const
Returns the font used for diaplaying any text.
Definition: widgetbase.cpp:445
int lineSpacing() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.