[Uml-devel] KDE/kdesdk/umbrello/umbrello/widgets
Ralf Habacker
ralf.habacker at gmail.com
Wed Dec 14 11:12:30 UTC 2011
SVN commit 1268718 by habacker:
merged in non QGraphicsScene related changes from soc-umbrello branch for SignalWidget
M +9 -9 signalwidget.cpp
M +11 -11 signalwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/signalwidget.cpp #1268717:1268718
@@ -44,7 +44,7 @@
: UMLWidget(view, id)
{
UMLWidget::setBaseType(WidgetBase::wt_Signal);
- m_SignalType = signalType;
+ m_signalType = signalType;
updateComponentSize();
m_pName = NULL;
if (signalType == SignalWidget::Time) {
@@ -71,7 +71,7 @@
const int w = width();
const int h = height();
QPolygon a;
- switch (m_SignalType)
+ switch (m_signalType)
{
case Send :
if(UMLWidget::getUseFillColour())
@@ -153,10 +153,10 @@
break;
default:
- uWarning() << "Unknown signal type:" << m_SignalType;
+ uWarning() << "Unknown signal type:" << m_signalType;
break;
}
- if(m_selected)
+ if(m_bSelected)
drawSelected(&p, offsetX, offsetY);
}
@@ -203,7 +203,7 @@
*/
SignalWidget::SignalType SignalWidget::getSignalType() const
{
- return m_SignalType;
+ return m_signalType;
}
/**
@@ -211,7 +211,7 @@
*/
void SignalWidget::setSignalType( SignalType signalType )
{
- m_SignalType = signalType;
+ m_signalType = signalType;
}
/**
@@ -292,7 +292,7 @@
UMLWidget::saveToXMI( qDoc, signalElement );
signalElement.setAttribute( "signalname", m_Text );
signalElement.setAttribute( "documentation", m_Doc );
- signalElement.setAttribute( "signaltype", m_SignalType );
+ signalElement.setAttribute( "signaltype", m_signalType );
if (m_pName && !m_pName->text().isEmpty()) {
signalElement.setAttribute( "textid", ID2STR(m_pName->id()) );
m_pName -> saveToXMI( qDoc, signalElement );
@@ -332,10 +332,10 @@
const int fontHeight = fm.lineSpacing();
int textWidth = fm.width(getName());
- if (m_SignalType == Accept)
+ if (m_signalType == Accept)
textWidth = int((float)textWidth * 1.3f);
height = fontHeight;
- if (m_SignalType != Time)
+ if (m_signalType != Time)
{
width = textWidth > SIGNAL_WIDTH?textWidth:SIGNAL_WIDTH;
height = height > SIGNAL_HEIGHT?height:SIGNAL_HEIGHT;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/signalwidget.h #1268717:1268718
@@ -5,7 +5,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2002-2006 *
+ * copyright (C) 2002-2011 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
@@ -21,7 +21,12 @@
#define SIGNAL_WIDTH 45
#define SIGNAL_HEIGHT 15
-class SignalWidget : public UMLWidget {
+/**
+ * Represents a Send signal, Accept signal or Time event on an
+ * Activity diagram.
+ */
+class SignalWidget : public UMLWidget
+{
Q_OBJECT
public:
/// Enumeration that codes the different types of signal.
@@ -46,26 +51,20 @@
SignalType getSignalType() const;
void setSignalType( SignalType signalType );
-
virtual void showPropertiesDialog();
void mouseMoveEvent(QMouseEvent *me);
- bool loadFromXMI( QDomElement & qElement );
- void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
+ virtual bool loadFromXMI( QDomElement & qElement );
+ virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
public Q_SLOTS:
- void slotMenuSelection(QAction* action);
+ virtual void slotMenuSelection(QAction* action);
protected:
QSize calculateSize();
/**
- * Type of signal.
- */
- SignalType m_SignalType;
-
- /**
* Save the value of the widget to know how to move the floatingtext
*/
int m_oldX;
@@ -78,6 +77,7 @@
*/
FloatingTextWidget* m_pName;
+ SignalType m_signalType; ///< Type of signal
};
#endif
More information about the umbrello-devel
mailing list