[Uml-devel] KDE/kdesdk/umbrello/umbrello/widgets
Ralf Habacker
ralf.habacker at gmail.com
Wed Dec 14 13:38:37 UTC 2011
SVN commit 1268729 by habacker:
fixed ToolBarStateOnWidget's method documentation locations and ordering according to class definition
M +71 -12 toolbarstateonewidget.cpp
M +5 -73 toolbarstateonewidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/toolbarstateonewidget.cpp #1268728:1268729
@@ -1,4 +1,5 @@
/***************************************************************************
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
@@ -11,7 +12,8 @@
// own header
#include "toolbarstateonewidget.h"
-// local includes
+// app includes
+#include "activitywidget.h"
#include "debug_utils.h"
#include "dialog_utils.h"
#include "floatingtextwidget.h"
@@ -19,22 +21,24 @@
#include "preconditionwidget.h"
#include "messagewidget.h"
#include "objectwidget.h"
-#include "activitywidget.h"
#include "regionwidget.h"
-#include "umlscene.h"
-#include "umlwidget.h"
#include "uml.h"
#include "umldoc.h"
+#include "umlscene.h"
#include "umlview.h"
+#include "umlwidget.h"
// kde includes
#include <klocale.h>
#include <kmessagebox.h>
-#include <QtGui/QMouseEvent>
-
using namespace Uml;
+/**
+ * Creates a new ToolBarStateOneWidget.
+ *
+ * @param umlView The UMLView to use.
+ */
ToolBarStateOneWidget::ToolBarStateOneWidget(UMLScene *umlScene)
: ToolBarStatePool(umlScene)
{
@@ -42,30 +46,50 @@
m_firstObject = 0;
}
+/**
+ * Destroys this ToolBarStateOneWidget.
+ */
ToolBarStateOneWidget::~ToolBarStateOneWidget()
{
}
-void ToolBarStateOneWidget::init()
-{
- ToolBarStatePool::init();
-}
-
+/**
+ * Called when the current tool is changed to use another tool.
+ * Executes base method and cleans the message.
+ */
void ToolBarStateOneWidget::cleanBeforeChange()
{
ToolBarStatePool::cleanBeforeChange();
}
+/**
+ * Called when a mouse event happened.
+ * It executes the base method and then updates the position of the
+ * message line, if any.
+ */
void ToolBarStateOneWidget::mouseMove(QMouseEvent* ome)
{
ToolBarStatePool::mouseMove(ome);
}
+/**
+ * A widget was removed from the UMLView.
+ * If the widget removed was the current widget, the current widget is set
+ * to 0.
+ * Also, if it was the first object, the message is cleaned.
+ */
void ToolBarStateOneWidget::slotWidgetRemoved(UMLWidget* widget)
{
ToolBarState::slotWidgetRemoved(widget);
}
+/**
+ * Selects only widgets, but no associations.
+ * Overrides base class method.
+ * If the press event happened on the line of an object, the object is set
+ * as current widget. If the press event happened on a widget, the widget is
+ * set as current widget.
+ */
void ToolBarStateOneWidget::setCurrentElement()
{
m_isObjectWidgetLine = false;
@@ -83,6 +107,17 @@
}
}
+/**
+ * Called when the release event happened on a widget.
+ * If the button pressed isn't left button or the widget isn't an object
+ * widget, the message is cleaned.
+ * If the release event didn't happen on the line of an object and the first
+ * object wasn't selected, nothing is done. If the first object was already
+ * selected, a creation message is made.
+ * If the event happened on the line of an object, the first object or the
+ * second are set, depending on whether the first object was already set or
+ * not.
+ */
void ToolBarStateOneWidget::mouseReleaseWidget()
{
WidgetBase::WidgetType widgetType = getWidgetType();
@@ -116,10 +151,22 @@
}
+/**
+ * Called when the release event happened on an empty space.
+ * Cleans the message.
+ * Empty spaces are not only actual empty spaces, but also associations.
+ */
void ToolBarStateOneWidget::mouseReleaseEmpty()
{
}
+/**
+ * Sets the first object of the message using the specified object.
+ * The temporal visual message is created and mouse tracking enabled, so
+ * mouse events will be delivered.
+ *
+ * @param firstObject The first object of the message.
+ */
void ToolBarStateOneWidget::setWidget(UMLWidget* firstObject)
{
m_firstObject = firstObject;
@@ -144,7 +191,11 @@
}
-
+/**
+ * Returns the widget type of this tool.
+ *
+ * @return The widget type of this tool.
+ */
WidgetBase::WidgetType ToolBarStateOneWidget::getWidgetType()
{
if (getButton() == WorkToolBar::tbb_Seq_Precondition) {
@@ -159,4 +210,12 @@
return WidgetBase::wt_Pin;
}
+/**
+ * Goes back to the initial state.
+ */
+void ToolBarStateOneWidget::init()
+{
+ ToolBarStatePool::init();
+}
+
#include "toolbarstateonewidget.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/toolbarstateonewidget.h #1268728:1268729
@@ -1,4 +1,5 @@
/***************************************************************************
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
@@ -28,98 +29,26 @@
{
Q_OBJECT
public:
-
- /**
- * Creates a new ToolBarStateOneWidget.
- *
- * @param umlView The UMLView to use.
- */
ToolBarStateOneWidget(UMLScene *umlScene);
- /**
- * Destroys this ToolBarStateOneWidget.
- */
virtual ~ToolBarStateOneWidget();
- /**
- * Goes back to the initial state.
- */
- virtual void init();
-
- /**
- * Called when the current tool is changed to use another tool.
- * Executes base method and cleans the message.
- */
virtual void cleanBeforeChange();
- /**
- * Called when a mouse event happened.
- * It executes the base method and then updates the position of the
- * message line, if any.
- */
virtual void mouseMove(QMouseEvent* ome);
-public slots:
-
- /**
- * A widget was removed from the UMLView.
- * If the widget removed was the current widget, the current widget is set
- * to 0.
- * Also, if it was the first object, the message is cleaned.
- */
+public Q_SLOTS:
virtual void slotWidgetRemoved(UMLWidget* widget);
protected:
-
- /**
- * Selects only widgets, but no associations.
- * Overrides base class method.
- * If the press event happened on the line of an object, the object is set
- * as current widget. If the press event happened on a widget, the widget is
- * set as current widget.
- */
virtual void setCurrentElement();
- /**
- * Called when the release event happened on a widget.
- * If the button pressed isn't left button or the widget isn't an object
- * widget, the message is cleaned.
- * If the release event didn't happen on the line of an object and the first
- * object wasn't selected, nothing is done. If the first object was already
- * selected, a creation message is made.
- * If the event happened on the line of an object, the first object or the
- * second are set, depending on whether the first object was already set or
- * not.
- */
virtual void mouseReleaseWidget();
-
- /**
- * Called when the release event happened on an empty space.
- * Cleans the message.
- * Empty spaces are not only actual empty spaces, but also associations.
- */
virtual void mouseReleaseEmpty();
-protected:
-
- /**
- * Sets the first object of the message using the specified object.
- * The temporal visual message is created and mouse tracking enabled, so
- * mouse events will be delivered.
- *
- * @param firstObject The first object of the message.
- */
void setWidget(UMLWidget* firstObject);
-
-
- /**
- * Returns the widget type of this tool.
- *
- * @return The widget type of this tool.
- */
WidgetBase::WidgetType getWidgetType();
-
/**
* The first object in the message.
*/
@@ -132,6 +61,9 @@
*/
bool m_isObjectWidgetLine;
+private:
+ virtual void init();
+
};
#endif //TOOLBARSTATEONEWIDGET_H
More information about the umbrello-devel
mailing list