umbrello/umbrello
objectnodewidget.cpp
Go to the documentation of this file.
45 ObjectNodeWidget::ObjectNodeWidget(UMLScene * scene, ObjectNodeType objectNodeType, Uml::ID::Type id)
62 void ObjectNodeWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
89 painter->drawText(OBJECTNODE_MARGIN, (textStartY/2), w - OBJECTNODE_MARGIN * 2, fontHeight, Qt::AlignHCenter, QLatin1String("<< centralBuffer >>"));
90 painter->drawText(OBJECTNODE_MARGIN, (textStartY/2) + fontHeight + 5, w - OBJECTNODE_MARGIN * 2, fontHeight, Qt::AlignHCenter, name());
96 painter->drawText(OBJECTNODE_MARGIN, (textStartY/2), w - OBJECTNODE_MARGIN * 2, fontHeight, Qt::AlignHCenter, QLatin1String("<< datastore >>"));
97 painter->drawText(OBJECTNODE_MARGIN, (textStartY/2) + fontHeight + 5, w - OBJECTNODE_MARGIN * 2, fontHeight, Qt::AlignHCenter, name());
115 painter->drawText(OBJECTNODE_MARGIN, textStartY/2 - OBJECTNODE_MARGIN, w - OBJECTNODE_MARGIN * 2, fontHeight, Qt::AlignHCenter, name());
116 painter->drawText(OBJECTNODE_MARGIN, textStartY/2 + textStartY + OBJECTNODE_MARGIN, w - OBJECTNODE_MARGIN * 2, fontHeight, Qt::AlignHCenter, objectflow_value);
311 QString type = KInputDialog::getItem (i18n("Select Object node type"), i18n("Select the object node type"), list, current, false, &pressedOK, UMLApp::app());
316 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the data store node"), i18n("Enter the name of the data store node"), i18n("data store name"));
318 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the buffer node"), i18n("Enter the name of the buffer"), i18n("centralBuffer"));
320 Dialog_Utils::askNameForWidget(targetWidget, i18n("Enter the name of the object flow"), i18n("Enter the name of the object flow"), i18n("object flow"));
337 QString state = KInputDialog::getText(i18n("Enter Object Flow State"), i18n("Enter State (keep '-' if there is no state for the object) "), i18n("-"), &pressedOK, UMLApp::app());
This class is the graphical version of a UML Object Node.
Definition: objectnodewidget.h:28
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Overrides the standard paint event.
Definition: objectnodewidget.cpp:62
void slotMenuSelection(QAction *action)
Captures any popup menu signals for menus it created.
Definition: objectnodewidget.cpp:229
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)
QString attribute(const QString &name, const QString &defValue) const
void showDocumentation(UMLObject *object, bool overwrite=false)
Called when a widget wishes to display its documentation in the doc window.
Definition: docwindow.cpp:88
Definition: objectnodewidget.h:36
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
static ObjectNodeType toObjectNodeType(const QString &type)
Returns the type of object node.
Definition: objectnodewidget.cpp:179
virtual void showPropertiesDialog()
Show a properties dialog for an ObjectNodeWidget.
Definition: objectnodewidget.cpp:258
Definition: umlwidget.h:215
Definition: listpopupmenu.h:171
void updateDocumentation(bool clear=false, bool startup=false)
Call when you wish move changes in the doc window back into the members documentation.
Definition: docwindow.cpp:230
void drawLine(const QLineF &line)
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:910
QString name() const
Gets the name from the corresponding UMLObject if this widget has an underlying UMLObject; if it does...
Definition: widgetbase.cpp:211
virtual bool loadFromXMI(QDomElement &qElement)
Loads the widget from the "objectnodewidget" XMI element.
Definition: objectnodewidget.cpp:287
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
virtual void setName(const QString &strName)
Sets the name in the corresponding UMLObject.
Definition: widgetbase.cpp:224
void askStateForWidget()
Open a dialog box to input the state of the widget.
Definition: objectnodewidget.cpp:334
void drawRect(const QRectF &rectangle)
void setFont(const QFont &font)
void setPen(const QColor &color)
void setAttribute(const QString &name, const QString &value)
int toInt(bool *ok, int base) const
bool isEmpty() const
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
ObjectNodeWidget(UMLScene *scene, ObjectNodeType objectNodeType=Normal, Uml::ID::Type id=Uml::ID::None)
Creates a Object Node widget.
Definition: objectnodewidget.cpp:45
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 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:2652
Definition: objectnodewidget.h:35
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1461
void askForObjectNodeType(UMLWidget *&targetWidget)
Open a dialog box to select the objectNode type (Data, Buffer or Flow).
Definition: objectnodewidget.cpp:302
Definition: objectnodewidget.h:38
Definition: objectnodewidget.h:37
void setObjectNodeType(ObjectNodeType objectNodeType)
Sets the type of object node.
Definition: objectnodewidget.cpp:195
int width(const QString &text, int len) const
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
Definition: listpopupmenu.h:170
ObjectNodeType objectNodeType() const
Returns the type of object node.
Definition: objectnodewidget.cpp:171
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves the widget to the "objectnodewidget" XMI element.
Definition: objectnodewidget.cpp:273
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 setState(const QString &state)
Sets the state of an object node when it's an objectflow.
Definition: objectnodewidget.cpp:212
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:26 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:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.