[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Tue May 15 21:20:10 UTC 2012
SVN commit 1295075 by fischer:
Differences to gsoc-branch reduced.
M +3 -1 clipboard/umldragdata.cpp
M +3 -3 widgets/classifierwidget.cpp
M +10 -10 widgets/umlwidget.cpp
M +2 -2 widgets/umlwidget.h
M +6 -14 widgets/widgetbase.cpp
M +12 -14 widgets/widgetbase.h
--- trunk/KDE/kdesdk/umbrello/umbrello/clipboard/umldragdata.cpp #1295074:1295075
@@ -16,6 +16,7 @@
#include "idchangelog.h"
#include "uml.h"
#include "umldoc.h"
+#include "umlscene.h"
#include "umlview.h"
#include "umlobject.h"
#include "folder.h"
@@ -672,9 +673,10 @@
}
UMLView *view = UMLApp::app()->currentView();
+ UMLScene *scene = view->umlScene();
while ( !widgetElement.isNull() ) {
- UMLWidget* widget = view->umlScene()->loadWidgetFromXMI(widgetElement);
+ UMLWidget* widget = scene->loadWidgetFromXMI(widgetElement);
if (widget)
widgets.append(widget);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/classifierwidget.cpp #1295074:1295075
@@ -67,7 +67,7 @@
setShowAttSigs( ops.classState.showAttSig );
if (c && c->isInterface()) {
- setBaseType(WidgetBase::wt_Interface);
+ m_baseType = WidgetBase::wt_Interface;
m_visualProperties = ShowOperations | ShowVisibility | ShowStereotype;
setShowStereotype(true);
updateSignatureTypes();
@@ -813,7 +813,7 @@
*/
void ClassifierWidget::changeToClass()
{
- WidgetBase::setBaseType(WidgetBase::wt_Class);
+ m_baseType = WidgetBase::wt_Class;
classifier()->setBaseType(UMLObject::ot_Class);
const Settings::OptionState& ops = m_scene->optionState();
@@ -831,7 +831,7 @@
*/
void ClassifierWidget::changeToInterface()
{
- WidgetBase::setBaseType(WidgetBase::wt_Interface);
+ m_baseType = WidgetBase::wt_Interface;
classifier()->setBaseType(UMLObject::ot_Interface);
setVisualProperty(ShowAttributes, false);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1295074:1295075
@@ -96,7 +96,7 @@
}
/**
- * Standard destructor.
+ * Destructor.
*/
UMLWidget::~UMLWidget()
{
@@ -157,7 +157,7 @@
if (this == &other)
return true;
- if (m_Type != other.m_Type) {
+ if (m_baseType != other.m_baseType) {
return false;
}
@@ -231,7 +231,7 @@
{
updateComponentSize();
adjustAssocs(x(), y()); //adjust assoc lines.
- switch (m_Type) {
+ switch (m_baseType) {
case WidgetBase::wt_Class:
m_scene->createAutoAttributeAssociations(this);
break;
@@ -348,7 +348,7 @@
void UMLWidget::slotMenuSelection(QAction* action)
{
QColor newColor;
- const WidgetBase::WidgetType wt = m_Type;
+ const WidgetBase::WidgetType wt = m_baseType;
UMLWidget* widget = 0; // use for select the first object properties (fill, line color)
ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action);
@@ -695,7 +695,7 @@
*/
bool UMLWidget::activate(IDChangeLog* /*ChangeLog = 0 */)
{
- if (widgetHasUMLObject(m_Type) && m_pObject == NULL) {
+ if (widgetHasUMLObject(m_baseType) && m_pObject == NULL) {
m_pObject = m_doc->findObjectById(m_nId);
if (m_pObject == NULL) {
uError() << "cannot find UMLObject with id=" << ID2STR(m_nId);
@@ -1058,7 +1058,7 @@
*/
void UMLWidget::setSelected(bool _select)
{
- const WidgetBase::WidgetType wt = m_Type;
+ const WidgetBase::WidgetType wt = m_baseType;
if (_select) {
if (m_scene->selectedCount() == 0) {
if (widgetHasUMLObject(wt)) {
@@ -1454,11 +1454,11 @@
/**
* Set the status of whether to show Stereotype.
*
- * @param _status True if stereotype shall be shown.
+ * @param flag True if stereotype shall be shown.
*/
-void UMLWidget::setShowStereotype(bool _status)
+void UMLWidget::setShowStereotype(bool flag)
{
- m_showStereotype = _status;
+ m_showStereotype = flag;
updateComponentSize();
update();
}
@@ -1468,7 +1468,7 @@
*
* @return True if stereotype is shown.
*/
-bool UMLWidget::getShowStereotype() const
+bool UMLWidget::showStereotype() const
{
return m_showStereotype;
}
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.h #1295074:1295075
@@ -185,8 +185,8 @@
return m_instanceName;
}
- bool getShowStereotype() const;
- virtual void setShowStereotype(bool _status);
+ bool showStereotype() const;
+ virtual void setShowStereotype(bool flag);
virtual void showPropertiesDialog();
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widgetbase.cpp #1295074:1295075
@@ -24,7 +24,7 @@
*/
WidgetBase::WidgetBase(UMLScene *scene, WidgetType type)
: QObject(scene),
- m_Type(type),
+ m_baseType(type),
m_scene(scene),
m_pObject(0)
{
@@ -55,19 +55,11 @@
}
/**
- * Set property m_Type.
+ * Read property of m_baseType.
*/
-void WidgetBase::setBaseType(WidgetBase::WidgetType type)
-{
- m_Type = type;
-}
-
-/**
- * Read property of m_Type.
- */
WidgetBase::WidgetType WidgetBase::baseType() const
{
- return m_Type;
+ return m_baseType;
}
/**
@@ -75,7 +67,7 @@
*/
QLatin1String WidgetBase::baseTypeStr() const
{
- return QLatin1String(ENUM_NAME(WidgetBase, WidgetType, m_Type));
+ return QLatin1String(ENUM_NAME(WidgetBase, WidgetType, m_baseType));
}
/**
@@ -411,7 +403,7 @@
if (lineColor != "none") {
setLineColor( QColor(lineColor) );
m_usesDiagramLineColor = false;
- } else if (m_Type != WidgetBase::wt_Box && m_scene != NULL) {
+ } else if (m_baseType != WidgetBase::wt_Box && m_scene != NULL) {
setLineColor( m_scene->lineColor() );
m_usesDiagramLineColor = true;
}
@@ -460,7 +452,7 @@
*/
WidgetBase& WidgetBase::operator=(const WidgetBase& other)
{
- m_Type = other.m_Type;
+ m_baseType = other.m_baseType;
m_scene = other.m_scene;
m_pObject = other.m_pObject;
m_Doc = other.m_Doc;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widgetbase.h #1295074:1295075
@@ -79,7 +79,6 @@
void setID(Uml::IDType id);
WidgetType baseType() const;
- void setBaseType(WidgetType type);
QLatin1String baseTypeStr() const;
UMLScene* umlScene() const;
@@ -88,43 +87,43 @@
QString documentation() const;
void setDocumentation(const QString& doc);
- QColor textColor() const;
- virtual void setTextColor(const QColor& color);
-
QColor lineColor() const;
virtual void setLineColor(const QColor& color);
+ uint lineWidth() const;
+ virtual void setLineWidth(uint width);
+
+ QColor textColor() const;
+ virtual void setTextColor(const QColor& color);
+
QColor fillColor() const;
virtual void setFillColor(const QColor& color);
- uint lineWidth() const;
- virtual void setLineWidth(uint width);
+ bool usesDiagramLineColor() const;
+ void setUsesDiagramLineColor(bool state);
+ bool usesDiagramLineWidth() const;
+ void setUsesDiagramLineWidth(bool state);
+
bool useFillColor();
void setUseFillColor(bool state);
bool usesDiagramTextColor() const;
void setUsesDiagramTextColor(bool state);
- bool usesDiagramLineColor() const;
- void setUsesDiagramLineColor(bool state);
-
bool usesDiagramFillColor() const;
void setUsesDiagramFillColor(bool state);
bool usesDiagramUseFillColor() const;
void setUsesDiagramUseFillColor(bool state);
- bool usesDiagramLineWidth() const;
- void setUsesDiagramLineWidth(bool state);
-
virtual bool loadFromXMI( QDomElement & qElement );
virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
WidgetBase& operator=(const WidgetBase& other);
protected:
- WidgetType m_Type; ///< Type of widget.
+ WidgetType m_baseType; ///< Type of widget.
UMLScene *m_scene;
UMLObject *m_pObject;
QString m_Doc; ///< Only used if m_pObject is not set.
@@ -172,7 +171,6 @@
bool m_usesDiagramUseFillColor;
bool m_usesDiagramLineWidth;
-
};
#endif
More information about the umbrello-devel
mailing list