[Uml-devel] branches/work/soc-umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Mon Sep 8 20:06:35 UTC 2008
SVN commit 858842 by fischer:
Remove some deprecated methods from newumlwidget.
M +10 -9 cmds/widget/cmd_changeFillColor.cpp
M +5 -9 cmds/widget/cmd_changeFillColor.h
M +68 -68 newumlrectwidget.h
M +0 -3 newumlwidget.h
--- branches/work/soc-umbrello/umbrello/cmds/widget/cmd_changeFillColor.cpp #858841:858842
@@ -4,13 +4,14 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2002-2008 *
- * Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
+ * copyright (C) 2002-2008 *
+ * Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
/* Created By Krzywda Stanislas and Bouchikhi Mohamed-Amine ;) */
#include "cmd_changeFillColor.h"
+
// app includes
#include "uml.h"
#include "umlwidgetcontroller.h"
@@ -28,24 +29,24 @@
namespace Uml
{
- CmdChangeFillColor::CmdChangeFillColor(NewUMLRectWidget *w, const QColor& col):UMLw(w),color(col)
+ CmdChangeFillColor::CmdChangeFillColor(NewUMLRectWidget *w, const QColor& col)
+ : m_umlWidget(w), m_color(col)
{
- setText(i18n("Change Fill Color")+ w->name());
- oldColor= w->getFillColor() ;
+ setText(i18n("Change Fill Color") + w->name());
+ m_oldColor= w->getFillColor() ;
}
CmdChangeFillColor::~CmdChangeFillColor()
{
+ }
- }
void CmdChangeFillColor::redo()
{
- UMLw->setFillColourcmd( color );
+ m_umlWidget->setFillColour( m_color );
}
void CmdChangeFillColor::undo()
{
-
- UMLw->setFillColourcmd( oldColor );
+ m_umlWidget->setFillColour( m_oldColor );
}
}
--- branches/work/soc-umbrello/umbrello/cmds/widget/cmd_changeFillColor.h #858841:858842
@@ -1,12 +1,11 @@
/***************************************************************************
- * *
* 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 *
* (at your option) any later version. *
* *
- * copyright (C) 2002-2008 *
- * Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
+ * copyright (C) 2002-2008 *
+ * Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
/* Created By Krzywda Stanislas and Bouchikhi Mohamed-Amine ;) */
@@ -23,14 +22,11 @@
class CmdChangeFillColor : public QUndoCommand
{
- NewUMLRectWidget *UMLw;
+ NewUMLRectWidget *m_umlWidget;
- /* ancienne couleur */
- QColor oldColor;
+ QColor m_oldColor; ///< old color
+ QColor m_color; ///< new color
- /* nouvelle couleur */
- QColor color;
-
public:
CmdChangeFillColor(NewUMLRectWidget *w, const QColor& col);
~CmdChangeFillColor();
--- branches/work/soc-umbrello/umbrello/newumlrectwidget.h #858841:858842
@@ -40,7 +40,7 @@
*/
class NewUMLRectWidget : public NewUMLWidget
{
- Q_OBJECT
+ Q_OBJECT
public:
/**
@@ -54,25 +54,25 @@
static const QSizeF DefaultMinimumSize;
static const QSizeF DefaultMaximumSize;
- explicit NewUMLRectWidget(UMLObject *object);
+ explicit NewUMLRectWidget(UMLObject *object);
~NewUMLRectWidget();
- /// @return The minimum size for this widget.
- QSizeF minimumSize() const {
- return m_minimumSize;
- }
- void setMinimumSize(const QSizeF& newSize, SizeHintOption option = DontAddMargin);
+ /// @return The minimum size for this widget.
+ QSizeF minimumSize() const {
+ return m_minimumSize;
+ }
+ void setMinimumSize(const QSizeF& newSize, SizeHintOption option = DontAddMargin);
- /// @return The maximum size for this widget.
- QSizeF maximumSize() const {
- return m_maximumSize;
- }
- void setMaximumSize(const QSizeF& newSize, SizeHintOption option = DontAddMargin);
+ /// @return The maximum size for this widget.
+ QSizeF maximumSize() const {
+ return m_maximumSize;
+ }
+ void setMaximumSize(const QSizeF& newSize, SizeHintOption option = DontAddMargin);
- /// @return The current size of this widget.
+ /// @return The current size of this widget.
QSizeF size() const {
- return m_size;
- }
+ return m_size;
+ }
void setSize(const QSizeF &size);
void setSize(qreal width, qreal height) {
setSize(QSizeF(width, height));
@@ -95,51 +95,51 @@
setSize(wt, m_size.height());
}
- /// @return Whether widget is resizable or not.
+ /// @return Whether widget is resizable or not.
bool isResizable() const {
return m_resizable;
}
- /**
- * Shorthand for QRectF(QPointF(0, 0), size()); The rect() area is
- * where all the widget painting should go.
- *
- * @note boundingRect() is always larger than or equal to rect().
- */
+ /**
+ * Shorthand for QRectF(QPointF(0, 0), size()); The rect() area is
+ * where all the widget painting should go.
+ *
+ * @note boundingRect() is always larger than or equal to rect().
+ */
QRectF rect() const {
return QRectF(QPointF(0, 0), size());
}
- /**
- * @return The margin from the rect() left for good visual appeal.
- */
- qreal margin() const {
- return m_margin;
- }
- void setMargin(qreal margin);
+ /**
+ * @return The margin from the rect() left for good visual appeal.
+ */
+ qreal margin() const {
+ return m_margin;
+ }
+ void setMargin(qreal margin);
- /// @return The instance name for this widget.
+ /// @return The instance name for this widget.
QString instanceName() const {
- return m_instanceName;
- }
+ return m_instanceName;
+ }
void setInstanceName(const QString &name);
- /// @return Whether this is an instance or not.
- bool isInstance() const {
- return m_isInstance;
- }
- void setIsInstance(bool b);
+ /// @return Whether this is an instance or not.
+ bool isInstance() const {
+ return m_isInstance;
+ }
+ void setIsInstance(bool b);
- /// @return Whether to show stereotype or not.
+ /// @return Whether to show stereotype or not.
bool showStereotype() const {
- return m_showStereotype;
- }
+ return m_showStereotype;
+ }
void setShowStereotype(bool b);
- /// @return A list representing AssociationWidget connected to
- /// this widget.
+ /// @return A list representing AssociationWidget connected to
+ /// this widget.
AssociationWidgetList associationWidgetList() const {
- return m_associationWidgetList;
- }
+ return m_associationWidgetList;
+ }
void addAssociationWidget(AssociationWidget *assoc);
void removeAssociationWidget(AssociationWidget *assoc);
virtual void adjustAssociations();
@@ -151,7 +151,7 @@
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement);
protected:
- virtual QVariant attributeChange(WidgetAttributeChange change, const QVariant& oldValue);
+ virtual QVariant attributeChange(WidgetAttributeChange change, const QVariant& oldValue);
virtual void updateGeometry();
virtual void setResizable(bool resizable);
@@ -163,44 +163,44 @@
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
- TextItemGroup* createTextItemGroup();
- int indexOfTextItemGroup(TextItemGroup *group) const;
- TextItemGroup* textItemGroupAt(int index) const;
- virtual void updateTextItemGroups();
+ TextItemGroup* createTextItemGroup();
+ int indexOfTextItemGroup(TextItemGroup *group) const;
+ TextItemGroup* textItemGroupAt(int index) const;
+ virtual void updateTextItemGroups();
- /**
- * List of TextItemGroup , which manages various texts for this
- * widget.
- */
- QList<TextItemGroup*> m_textItemGroups;
+ /**
+ * List of TextItemGroup , which manages various texts for this
+ * widget.
+ */
+ QList<TextItemGroup*> m_textItemGroups;
protected Q_SLOTS:
virtual void slotUMLObjectDataChanged();
private:
- /// Current size of the widget.
+ /// Current size of the widget.
QSizeF m_size;
- QSizeF m_minimumSize;
- QSizeF m_maximumSize;
+ QSizeF m_minimumSize;
+ QSizeF m_maximumSize;
- /// Margin for this widget.
- qreal m_margin;
+ /// Margin for this widget.
+ qreal m_margin;
- QString m_instanceName;
- bool m_isInstance;
- bool m_showStereotype;
+ QString m_instanceName;
+ bool m_isInstance;
+ bool m_showStereotype;
- /// Whether resizable or not.
- bool m_resizable;
+ /// Whether resizable or not.
+ bool m_resizable;
AssociationWidgetList m_associationWidgetList;
- /// Widget handle for this widget (for resizing)
- WidgetHandle *m_widgetHandle;
+ /// Widget handle for this widget (for resizing)
+ WidgetHandle *m_widgetHandle;
- QRectF m_geometryBeforeResize;
+ QRectF m_geometryBeforeResize;
- // Dispable copy constructor and operator=
+ // Dispable copy constructor and operator=
DISABLE_COPY(NewUMLRectWidget);
public:
--- branches/work/soc-umbrello/umbrello/newumlwidget.h #858841:858842
@@ -237,7 +237,6 @@
QColor getFillColour() const { return brush().color(); }
QColor getFillColor() const { return getFillColour(); }
void setFillColour(const QColor& col) { setBrush(QBrush(col)); }
- void setFillColourcmd(const QColor& col) { setFillColour(col); }
bool getUseFillColour() const { return false; }
void setUseFillColour(bool) {}
@@ -268,8 +267,6 @@
ListPopupMenu *m_pMenu;
virtual ListPopupMenu* setupPopupMenu();
qreal m_origZ;
- void setZ(qreal z) { setZValue(z); }
- qreal getZ() const { return zValue(); }
qreal onWidget(const QPointF& pos) const {
if(this->contains(mapFromScene(pos))) {
QSizeF s = boundingRect().size();
More information about the umbrello-devel
mailing list