summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Paulo Torres de Oliveira <luis.paulo.tdo@gmail.com>2014-08-13 04:07:06 -0300
committerSandro S. Andrade <sandroandrade@kde.org>2014-08-24 23:34:04 +0200
commitbae337cbeb3c5c391a35f201a3bb0f7640afc588 (patch)
tree522829049eff84a00508f8ae0e620be40c298fdb
parent8c8c2d7efe77131c33ce1bb59c2b79150e30d8d1 (diff)
Add GCC-XML Backend Plugin, ACDC Plugin and UML Notation Plugin
Change-Id: Ib562f00477748322c06e9dd0999a988816e6e419 Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
-rw-r--r--.qmake.conf2
-rw-r--r--examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.cpp5
-rw-r--r--examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.h6
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.json8
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.pro24
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_dependencies.pri4
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_export.h53
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.cpp100
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.h93
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.cpp117
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.h65
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.cpp173
-rw-r--r--examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.h70
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycore.pro4
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.cpp33
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.h17
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoveryalgorithm.h2
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoverybackend.h3
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.cpp107
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.h90
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.json12
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.pro22
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.ui117
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel_dependencies.pri7
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.cpp66
-rw-r--r--examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.h69
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend.pro11
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend_export.h53
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp351
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.h47
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.cpp92
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.h73
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.cpp150
-rw-r--r--examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.h85
-rw-r--r--examples/uml/duse-mt/src/plugins/plugins.pro5
-rw-r--r--examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.json8
-rw-r--r--examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.pro21
-rw-r--r--examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_dependencies.pri4
-rw-r--r--examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_export.h53
-rw-r--r--examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.cpp101
-rw-r--r--examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.h77
41 files changed, 2199 insertions, 201 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 16328b7d..00e3fcf4 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,3 +1,3 @@
load(qt_build_config)
-MODULE_VERSION = 5.3.0
+MODULE_VERSION = 5.3.1
diff --git a/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.cpp b/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.cpp
index 2e0a0ebf..c5514646 100644
--- a/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.cpp
+++ b/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.cpp
@@ -52,5 +52,10 @@ IPlugin::~IPlugin()
{
}
+QString IPlugin::name()
+{
+ return _name;
+}
+
}
diff --git a/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.h b/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.h
index 136271e1..07c13739 100644
--- a/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.h
+++ b/examples/uml/duse-mt/src/libs/duseinterfaces/iplugin.h
@@ -46,6 +46,7 @@
#include "icore.h"
#include <QtCore/QObject>
+#include <QtCore/QString>
namespace DuSE
{
@@ -59,6 +60,11 @@ public:
virtual ~IPlugin();
virtual bool initialize() = 0;
+
+ virtual QString name();
+
+protected:
+ QString _name;
};
}
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.json b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.json
new file mode 100644
index 00000000..1952997f
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.json
@@ -0,0 +1,8 @@
+{
+ "Category": "Architecture Recovery",
+ "Vendor": "Qt Project",
+ "Version": "1.0",
+ "DependencyList": [
+ "ArchitectureRecoveryCorePlugin"
+ ]
+}
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.pro b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.pro
new file mode 100644
index 00000000..f1964825
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm.pro
@@ -0,0 +1,24 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2014-08-13T04:20:30
+#
+#-------------------------------------------------
+
+include(../../duse-mt-plugin.pri)
+
+QT -= widgets gui
+
+DEFINES += ACDCARCHITECTURERECOVERYALGORITHM_LIBRARY
+
+HEADERS += \
+ acdcarchitecturerecoveryalgorithm_export.h \
+ acdcarchitecturerecoveryalgorithmplugin.h \
+ dependencyrelationstreemanager.h \
+ subgraphdominatorpattern.h
+
+SOURCES += \
+ acdcarchitecturerecoveryalgorithmplugin.cpp \
+ dependencyrelationstreemanager.cpp \
+ subgraphdominatorpattern.cpp
+
+OTHER_FILES += acdcarchitecturerecoveryalgorithm.json
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_dependencies.pri b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_dependencies.pri
new file mode 100644
index 00000000..d7045bf4
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_dependencies.pri
@@ -0,0 +1,4 @@
+DUSEMT_PLUGIN_NAME = AcdcArchitectureRecoveryAlgorithm
+
+DUSEMT_PLUGIN_DEPENDS += \
+ architecturerecoverycore
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_export.h b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_export.h
new file mode 100644
index 00000000..87d44411
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithm_export.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ACDCARCHITECTURERECOVERYALGORITHM_EXPORT_H
+#define ACDCARCHITECTURERECOVERYALGORITHM_EXPORT_H
+
+#include <qglobal.h>
+
+#if defined(ACDCARCHITECTURERECOVERYALGORITHM_LIBRARY)
+# define ACDCARCHITECTURERECOVERYALGORITHM_EXPORT Q_DECL_EXPORT
+#else
+# define ACDCARCHITECTURERECOVERYALGORITHM_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // ACDCARCHITECTURERECOVERYALGORITHM_EXPORT_H
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.cpp b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.cpp
new file mode 100644
index 00000000..8a370d68
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "acdcarchitecturerecoveryalgorithmplugin.h"
+
+#include <QDebug>
+
+namespace DuSE
+{
+
+AcdcArchitectureRecoveryAlgorithmPlugin::AcdcArchitectureRecoveryAlgorithmPlugin(QObject *parent)
+ : IPlugin(parent), _dependencyRelationsTreeManager(new DependencyRelationsTreeManager),
+ _subgraphDominatorPattern(new SubgraphDominatorPattern)
+{
+ _name = "ACDC";
+}
+
+bool AcdcArchitectureRecoveryAlgorithmPlugin::initialize()
+{
+ return true;
+}
+
+void AcdcArchitectureRecoveryAlgorithmPlugin::run()
+{
+ _dependencyRelationsTreeManager->fillNodesTable(_nodesTable, _dependencyRelations);
+ _dependencyRelationsTreeManager->orderNodes(_nodesTable, _orderedNodes);
+ _subgraphDominatorPattern->executePattern(_orderedNodes, _dependencyRelations);
+ _subgraphs = _subgraphDominatorPattern->subgraphs();
+ _orphanNodes = _subgraphDominatorPattern->orphanNodes(_subgraphs, _dependencyRelations);
+ _subgraphs.append(_orphanNodes);
+}
+
+void AcdcArchitectureRecoveryAlgorithmPlugin::setDependencyRelations(QMultiMap<QString, QString> m_dependencyRelations)
+{
+ _dependencyRelations = m_dependencyRelations;
+}
+
+QList<QStringList> AcdcArchitectureRecoveryAlgorithmPlugin::subgraphs()
+{
+ return _subgraphs;
+}
+
+void AcdcArchitectureRecoveryAlgorithmPlugin::setDevelopmentPlatform(IDevelopmentPlatform *m_developmentPlatform)
+{
+ _developmentPlatform = m_developmentPlatform;
+}
+
+void AcdcArchitectureRecoveryAlgorithmPlugin::setModelingNotation(IModelingNotation *m_modelingNotation)
+{
+ _modelingNotation = m_modelingNotation;
+}
+
+IDevelopmentPlatform *AcdcArchitectureRecoveryAlgorithmPlugin::developmentPlatform()
+{
+ return _developmentPlatform;
+}
+
+IModelingNotation *AcdcArchitectureRecoveryAlgorithmPlugin::modelingNotation()
+{
+ return _modelingNotation;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.h b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.h
new file mode 100644
index 00000000..719485e7
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef ACDCARCHITECTURERECOVERYALGORITHMPLUGIN_H
+#define ACDCARCHITECTURERECOVERYALGORITHMPLUGIN_H
+
+#include <QMultiMap>
+#include <QHash>
+
+#include <duseinterfaces/iplugin.h>
+#include <architecturerecoverycore/iarchitecturerecoveryalgorithm.h>
+
+#include "dependencyrelationstreemanager.h"
+#include "subgraphdominatorpattern.h"
+
+#include "acdcarchitecturerecoveryalgorithm_export.h"
+
+namespace DuSE
+{
+
+class ACDCARCHITECTURERECOVERYALGORITHM_EXPORT AcdcArchitectureRecoveryAlgorithmPlugin : public IPlugin, public IArchitectureRecoveryAlgorithm
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.liveblue.DuSE.IPlugin" FILE "acdcarchitecturerecoveryalgorithm.json")
+
+public:
+ AcdcArchitectureRecoveryAlgorithmPlugin(QObject *parent = 0);
+
+ virtual bool initialize();
+
+ virtual void run();
+
+ void setDependencyRelations(QMultiMap<QString, QString> m_dependencyRelations);
+ QList<QStringList> subgraphs();
+
+ virtual void setDevelopmentPlatform(IDevelopmentPlatform *m_developmentPlatform);
+ virtual void setModelingNotation(IModelingNotation *m_modelingNotation);
+
+ virtual IDevelopmentPlatform* developmentPlatform();
+ virtual IModelingNotation* modelingNotation();
+
+private:
+ IDevelopmentPlatform *_developmentPlatform;
+ IModelingNotation *_modelingNotation;
+ QMultiMap<QString, QString> _dependencyRelations;
+ DependencyRelationsTreeManager *_dependencyRelationsTreeManager;
+ QHash<QString, int> _nodesTable;
+ QStringList _orderedNodes;
+ SubgraphDominatorPattern *_subgraphDominatorPattern;
+ QList<QStringList> _subgraphs;
+ QStringList _orphanNodes;
+};
+
+}
+
+#endif // ACDCARCHITECTURERECOVERYALGORITHMPLUGIN_H
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.cpp b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.cpp
new file mode 100644
index 00000000..237ed055
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "dependencyrelationstreemanager.h"
+
+namespace DuSE
+{
+
+DependencyRelationsTreeManager::DependencyRelationsTreeManager()
+{
+}
+
+void DependencyRelationsTreeManager::fillNodesTable(QHash<QString, int> &nodesTable, const QMultiMap<QString, QString> &dependencies)
+{
+ foreach (QString key, dependencies.uniqueKeys()) {
+ nodesTable.insert(key, dependencies.values(key).count());
+ }
+
+ foreach (QString value, dependencies.values()) {
+ if (!nodesTable.keys().contains(value)) {
+ nodesTable.insert(value, 0);
+ }
+ }
+}
+
+void DependencyRelationsTreeManager::orderNodes(const QHash<QString, int> &nodesTable, QStringList &nodeList)
+{
+ int max = findMax(nodesTable);
+
+ for (int i = 1; i <= max; ++i) {
+ foreach (QString node, nodesTable.keys()) {
+ int count = nodesTable.value(node);
+
+ if (i == count) {
+ nodeList.append(node);
+ }
+ }
+ }
+}
+
+int DependencyRelationsTreeManager::findMax(const QHash<QString, int> &nodesTable)
+{
+ int max = 0;
+ foreach (int count, nodesTable.values()) {
+ if (count > max) {
+ max = count;
+ }
+ }
+
+ return max;
+}
+
+QStringList DependencyRelationsTreeManager::targets(const QStringList &nodesList, const QMultiMap<QString, QString> &dependencies)
+{
+ QStringList coveredNodes;
+ foreach (QString itemNode, nodesList) {
+ foreach (QString coveredNode, dependencies.values(itemNode)) {
+ if ((coveredNode != itemNode) && !coveredNodes.contains(coveredNode)) {
+ coveredNodes.append(coveredNode);
+ }
+ }
+ }
+
+ return coveredNodes;
+}
+
+QStringList DependencyRelationsTreeManager::sources(QString node, QMultiMap<QString, QString> dependencies)
+{
+ QStringList sourceList;
+
+ foreach (QString key, dependencies.keys()) {
+ if (dependencies.values(key).contains(node)) {
+ sourceList.append(key);
+ }
+ }
+
+ return sourceList;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.h b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.h
new file mode 100644
index 00000000..c17faee6
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/dependencyrelationstreemanager.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef DEPENDENCYRELATIONSTREEMANAGER_H
+#define DEPENDENCYRELATIONSTREEMANAGER_H
+
+#include <QMultiMap>
+#include <QHash>
+#include <QStringList>
+
+namespace DuSE
+{
+
+class DependencyRelationsTreeManager
+{
+public:
+ DependencyRelationsTreeManager();
+
+ void fillNodesTable(QHash<QString, int> &nodesTable, const QMultiMap<QString, QString> &dependencies);
+ void orderNodes(const QHash<QString, int> &nodesTable, QStringList &nodeList);
+ int findMax(const QHash<QString, int> &nodesTable);
+ QStringList targets(const QStringList &nodesList, const QMultiMap<QString, QString> &dependencies);
+ QStringList sources(QString node, QMultiMap<QString, QString> dependencies);
+};
+
+}
+
+#endif // DEPENDENCYRELATIONSTREEMANAGER_H
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.cpp b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.cpp
new file mode 100644
index 00000000..17ebf6f9
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.cpp
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "subgraphdominatorpattern.h"
+
+namespace DuSE
+{
+
+SubgraphDominatorPattern::SubgraphDominatorPattern()
+{
+}
+
+void SubgraphDominatorPattern::executePattern(const QStringList &orderedNodes, QMultiMap<QString, QString> dependencies)
+{
+ // Para cada nó da lista de nós ordenados
+ foreach (QString node, orderedNodes) {
+
+ // Chamar coveredSet
+ QStringList coveredNodes = coveredSet(node, dependencies);
+
+ if (coveredNodes.contains(node) && (coveredNodes.count() == 1)) {
+ } else {
+ // Um Subgraph Dominator foi descoberto. Ele será adicionado na lista e será removido do Hash de dependências.
+ _subgraphs.append(coveredNodes);
+ }
+ }
+}
+
+QStringList SubgraphDominatorPattern::coveredSet(QString node, QMultiMap<QString, QString> dependencies)
+{
+ QStringList list;
+ QStringList covered;
+
+ // Criar uma lista e colocar o nó lá dentro
+ list.append(node);
+ int currentListSize = 0;
+ int originalListSize = 0;
+
+ do {
+ originalListSize = list.count();
+
+ // Guardar em covered os nós para os quais todos os nós da lista apontam,
+ // exceto os próprios nós (ou seja, não considera loops) da lista.
+ covered = _treeManager.targets(list, dependencies);
+
+ // Cria uma lista falseOnes
+ QStringList falseOnes;
+ int currentCoveredSize = 0;
+ int originalCoveredSize = 0;
+ do {
+ originalCoveredSize = covered.count();
+
+ // Tirar uma cópia de covered e guardar em both
+ QStringList both = covered;
+
+ // Adicionar a lista em both
+ foreach (QString itemNode, list) {
+ if (!both.contains(itemNode)) {
+ both.append(list);
+ }
+ }
+
+ foreach (QString coveredNode, covered) {
+ bool nodeIsFalseOne = false;
+ QStringList sourceList = _treeManager.sources(coveredNode, dependencies);
+ foreach (QString source, sourceList) {
+ if (!both.contains(source)) {
+ nodeIsFalseOne = true;
+ break;
+ }
+ }
+
+ if (nodeIsFalseOne == true) {
+ falseOnes.append(coveredNode);
+ }
+ }
+
+ foreach (QString falseOne, falseOnes) {
+ covered.removeOne(falseOne);
+ }
+ currentCoveredSize = covered.count();
+ } while (originalCoveredSize != currentCoveredSize);
+
+ foreach (QString coveredNode, covered) {
+ if (!list.contains(coveredNode)) {
+ list.append(coveredNode);
+ }
+ }
+ currentListSize = list.count();
+ } while (originalListSize != currentListSize);
+
+ return list;
+}
+
+QStringList SubgraphDominatorPattern::orphanNodes(const QList<QStringList> &subgraphs, QMultiMap<QString, QString> dependencies)
+{
+ QStringList orphanContainer;
+ QStringList allNodes;
+
+ foreach (QString dependent, dependencies.uniqueKeys()) {
+ if (!allNodes.contains(dependent)) {
+ allNodes.append(dependent);
+ }
+ foreach (QString dependency, dependencies.values(dependent)) {
+ if (!allNodes.contains(dependency)) {
+ allNodes.append(dependency);
+ }
+ }
+ }
+
+ foreach (QString node, allNodes) {
+ bool nodeIsOrphan = true;
+
+ foreach (QStringList subgraph, subgraphs) {
+ if (subgraph.contains(node)) {
+ nodeIsOrphan = false;
+ break;
+ }
+ }
+
+ if (nodeIsOrphan == true) {
+ if (!orphanContainer.contains(node)) {
+ orphanContainer.append(node);
+ }
+ }
+ }
+
+ return orphanContainer;
+}
+
+QList<QStringList> SubgraphDominatorPattern::subgraphs()
+{
+ return _subgraphs;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.h b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.h
new file mode 100644
index 00000000..3f4d3ba3
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/acdcarchitecturerecoveryalgorithm/subgraphdominatorpattern.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef SUBGRAPHDOMINATORPATTERN_H
+#define SUBGRAPHDOMINATORPATTERN_H
+
+#include <QMultiMap>
+#include <QStringList>
+
+#include "dependencyrelationstreemanager.h"
+
+namespace DuSE
+{
+
+class SubgraphDominatorPattern
+{
+public:
+ SubgraphDominatorPattern();
+
+ void executePattern(const QStringList &orderedNodes, QMultiMap<QString, QString> dependencies);
+ QStringList coveredSet(QString node, QMultiMap<QString, QString> dependencies);
+ QStringList orphanNodes(const QList<QStringList> &subgraphs, QMultiMap<QString, QString> dependencies);
+
+ QList<QStringList> subgraphs();
+
+private:
+ QList<QStringList> _subgraphs;
+ DependencyRelationsTreeManager _treeManager;
+};
+
+}
+
+#endif // SUBGRAPHDOMINATORPATTERN_H
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycore.pro b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycore.pro
index 26b23ceb..3044c484 100644
--- a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycore.pro
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycore.pro
@@ -6,6 +6,8 @@
include(../../duse-mt-plugin.pri)
+QT += gui widgets
+
HEADERS += architecturerecoverycoreplugin.h \
iarchitecturerecoverybackend.h \
imodelingnotation.h \
@@ -14,3 +16,5 @@ HEADERS += architecturerecoverycoreplugin.h \
SOURCES += architecturerecoverycoreplugin.cpp
OTHER_FILES += architecturerecoverycore.json
+
+FORMS +=
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.cpp b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.cpp
index 05d2abdb..3a2b420b 100644
--- a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.cpp
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.cpp
@@ -55,9 +55,40 @@ ArchitectureRecoveryCorePlugin::ArchitectureRecoveryCorePlugin(QObject *parent)
bool ArchitectureRecoveryCorePlugin::initialize()
{
- qDebug() << ICore::self()->pluginController()->pluginsByType<DuSE::IArchitectureRecoveryBackend>();
return true;
}
+void ArchitectureRecoveryCorePlugin::loadPluginsList()
+{
+}
+
+void ArchitectureRecoveryCorePlugin::loadRecoveryBackends()
+{
+}
+
+void ArchitectureRecoveryCorePlugin::loadRecoveryAlgorithms()
+{
+
+}
+
+void ArchitectureRecoveryCorePlugin::loadModelingNotations()
+{
+
+}
+
+QList<IArchitectureRecoveryBackend *> ArchitectureRecoveryCorePlugin::recoveryBackends()
+{
+ return _recoveryBackends;
}
+QList<IArchitectureRecoveryAlgorithm *> ArchitectureRecoveryCorePlugin::recoveryAlgorithms()
+{
+ return _recoveryAlgorithms;
+}
+
+QList<IModelingNotation *> ArchitectureRecoveryCorePlugin::modelingNotations()
+{
+ return _modelingNotations;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.h b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.h
index a83fa66f..df439048 100644
--- a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.h
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/architecturerecoverycoreplugin.h
@@ -41,6 +41,9 @@
#ifndef ARCHITECTURERECOVERYCOREPLUGIN_H
#define ARCHITECTURERECOVERYCOREPLUGIN_H
+#include <architecturerecoverycore/iarchitecturerecoverybackend.h>
+#include <architecturerecoverycore/iarchitecturerecoveryalgorithm.h>
+#include <architecturerecoverycore/imodelingnotation.h>
#include <duseinterfaces/iplugin.h>
namespace DuSE
@@ -55,6 +58,20 @@ public:
ArchitectureRecoveryCorePlugin(QObject *parent = 0);
virtual bool initialize();
+
+ void loadPluginsList();
+ void loadRecoveryBackends();
+ void loadRecoveryAlgorithms();
+ void loadModelingNotations();
+ QList<IArchitectureRecoveryBackend *> recoveryBackends();
+ QList<IArchitectureRecoveryAlgorithm *> recoveryAlgorithms();
+ QList<IModelingNotation *> modelingNotations();
+
+private:
+ QList<const QMetaObject*> _metaObjects;
+ QList<IArchitectureRecoveryBackend *> _recoveryBackends;
+ QList<IArchitectureRecoveryAlgorithm *> _recoveryAlgorithms;
+ QList<IModelingNotation *> _modelingNotations;
};
}
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoveryalgorithm.h b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoveryalgorithm.h
index 9d69b125..71498f4a 100644
--- a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoveryalgorithm.h
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoveryalgorithm.h
@@ -51,7 +51,7 @@ class IArchitectureRecoveryAlgorithm
{
public:
- virtual void run() const = 0;
+ virtual void run() = 0;
virtual void setDevelopmentPlatform(IDevelopmentPlatform *m_developmentPlatform) = 0;
virtual void setModelingNotation(IModelingNotation *m_modelingNotation) = 0;
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoverybackend.h b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoverybackend.h
index 9d7b2500..964c4de5 100644
--- a/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoverybackend.h
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverycore/iarchitecturerecoverybackend.h
@@ -42,13 +42,13 @@
#define IARCHITECTURERECOVERYBACKEND_H
#include <QObjectList>
+#include <QString>
namespace DuSE
{
class IArchitectureRecoveryBackend
{
-
public:
virtual QObjectList components() = 0;
virtual QObjectList connectors() = 0;
@@ -57,4 +57,3 @@ public:
}
#endif // IARCHITECTURERECOVERYBACKEND_H
-
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.cpp b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.cpp
new file mode 100644
index 00000000..457e03dd
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.cpp
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "architecturerecoverypanel.h"
+#include "ui_architecturerecoverypanel.h"
+
+#include <QtCore/QDebug>
+
+#include <duseinterfaces/iplugincontroller.h>
+
+namespace DuSE
+{
+
+ArchitectureRecoveryPanel::ArchitectureRecoveryPanel(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ArchitectureRecoveryPanel)
+{
+ ui->setupUi(this);
+
+ connect(ui->startPushButton, SIGNAL(clicked()), this, SLOT(run()));
+}
+
+ArchitectureRecoveryPanel::~ArchitectureRecoveryPanel()
+{
+ delete ui;
+}
+
+void ArchitectureRecoveryPanel::loadPanel()
+{
+ loadBackendPlugins();
+ loadAlgorithmPlugins();
+ loadNotationPlugins();
+ show();
+}
+
+void ArchitectureRecoveryPanel::run()
+{
+ GccXmlArchitectureRecoveryBackendPlugin *gccXmlBackend = new GccXmlArchitectureRecoveryBackendPlugin;
+ AcdcArchitectureRecoveryAlgorithmPlugin *acdcAlgorithm = new AcdcArchitectureRecoveryAlgorithmPlugin;
+ UmlModelingNotationPlugin *umlNotation = new UmlModelingNotationPlugin;
+
+ gccXmlBackend->run();
+ DependencyRelations dependencyRelations = gccXmlBackend->components().at(0)->property("components").value<DependencyRelations>();
+ QString systemDirectory = gccXmlBackend->components().at(0)->property("systemDirectory").toString();
+
+ acdcAlgorithm->setDependencyRelations(dependencyRelations);
+ acdcAlgorithm->run();
+ QList<QStringList> subgraphs = acdcAlgorithm->subgraphs();
+
+ umlNotation->setClusterList(subgraphs);
+ umlNotation->loadSubsystems();
+ umlNotation->generateDiagram(systemDirectory);
+}
+
+void ArchitectureRecoveryPanel::loadBackendPlugins()
+{
+ ui->backendComboBox->addItem("GCC-XML");
+}
+
+void ArchitectureRecoveryPanel::loadAlgorithmPlugins()
+{
+ ui->algorithmComboBox->addItem("ACDC (Algorithm for Compreehension-Driven Clustering)");
+}
+
+void ArchitectureRecoveryPanel::loadNotationPlugins()
+{
+ ui->notationComboBox->addItem("UML (Unified Modeling Language)");
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.h b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.h
new file mode 100644
index 00000000..4d59cca2
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef ARCHITECTURERECOVERYPANEL_H
+#define ARCHITECTURERECOVERYPANEL_H
+
+#include <QtCore/QMap>
+#include <QtWidgets/QDialog>
+
+#include <acdcarchitecturerecoveryalgorithm/acdcarchitecturerecoveryalgorithmplugin.h>
+#include <architecturerecoverycore/architecturerecoverycoreplugin.h>
+#include <architecturerecoverycore/iarchitecturerecoveryalgorithm.h>
+#include <architecturerecoverycore/iarchitecturerecoverybackend.h>
+#include <duseinterfaces/iplugin.h>
+#include <gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.h>
+#include <umlmodelingnotation/umlmodelingnotationplugin.h>
+
+namespace DuSE
+{
+
+namespace Ui {
+ class ArchitectureRecoveryPanel;
+}
+
+class ArchitectureRecoveryPanel : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit ArchitectureRecoveryPanel(QWidget *parent = 0);
+ ~ArchitectureRecoveryPanel();
+
+ void loadBackendPlugins();
+ void loadAlgorithmPlugins();
+ void loadNotationPlugins();
+
+public Q_SLOTS:
+ void loadPanel();
+ void run();
+
+private:
+ Ui::ArchitectureRecoveryPanel *ui;
+ QMap<QString, IPlugin *> backendPluginsMap;
+ QMap<QString, IArchitectureRecoveryAlgorithm *> algorithmPluginsMap;
+ QMap<QString, IModelingNotation *> notationPluginsMap;
+ ArchitectureRecoveryCorePlugin *architectureRecoveryCore;
+};
+
+#endif // ARCHITECTURERECOVERYPANEL_H
+
+}
+
+
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.json b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.json
new file mode 100644
index 00000000..3b9d9911
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.json
@@ -0,0 +1,12 @@
+{
+ "Category": "Architecture Recovery",
+ "Vendor": "Qt Project",
+ "Version": "1.0",
+ "DependencyList": [
+ "ArchitectureRecoveryCorePlugin",
+ "GccXmlArchitectureRecoveryBackendPlugin",
+ "AcdcArchitectureRecoveryAlgorithmPlugin",
+ "UmlModelingNotationPlugin"
+ ]
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.pro b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.pro
new file mode 100644
index 00000000..f575d181
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.pro
@@ -0,0 +1,22 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2013-11-03T17:38:51
+#
+#-------------------------------------------------
+
+include(../../duse-mt-plugin.pri)
+
+QT += gui widgets modeling
+
+HEADERS += \
+ architecturerecoverypanel.h \
+ architecturerecoverypanelplugin.h
+
+SOURCES += \
+ architecturerecoverypanel.cpp \
+ architecturerecoverypanelplugin.cpp
+
+OTHER_FILES += architecturerecoverypanel.json
+
+FORMS += \
+ architecturerecoverypanel.ui
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.ui b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.ui
new file mode 100644
index 00000000..627a06f2
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel.ui
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DuSE::ArchitectureRecoveryPanel</class>
+ <widget class="QDialog" name="DuSE::ArchitectureRecoveryPanel">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>393</width>
+ <height>265</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <widget class="QLabel" name="algorithmLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>110</y>
+ <width>71</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Algoritmo:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" name="notationComboBox">
+ <property name="geometry">
+ <rect>
+ <x>90</x>
+ <y>170</y>
+ <width>291</width>
+ <height>23</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QLabel" name="notationLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>170</y>
+ <width>71</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Notação:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="architectureProcessInformativeLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>381</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Defina as etapas do processo de recuperação arquitetural:</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="startPushButton">
+ <property name="geometry">
+ <rect>
+ <x>279</x>
+ <y>220</y>
+ <width>101</width>
+ <height>23</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Iniciar</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="backendLabel">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>50</y>
+ <width>71</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Backend:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" name="backendComboBox">
+ <property name="geometry">
+ <rect>
+ <x>90</x>
+ <y>50</y>
+ <width>291</width>
+ <height>23</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QComboBox" name="algorithmComboBox">
+ <property name="geometry">
+ <rect>
+ <x>90</x>
+ <y>110</y>
+ <width>291</width>
+ <height>23</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel_dependencies.pri b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel_dependencies.pri
new file mode 100644
index 00000000..40d209d3
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanel_dependencies.pri
@@ -0,0 +1,7 @@
+DUSEMT_PLUGIN_NAME = ArchitectureRecoveryPanel
+
+DUSEMT_PLUGIN_DEPENDS += \
+ architecturerecoverycore \
+ gccxmlarchitecturerecoverybackend \
+ acdcarchitecturerecoveryalgorithm \
+ umlmodelingnotation
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.cpp b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.cpp
new file mode 100644
index 00000000..9a8ee974
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "architecturerecoverypanelplugin.h"
+
+#include <QtCore/QDebug>
+#include <QtWidgets/QAction>
+
+#include <duseinterfaces/iuicontroller.h>
+
+namespace DuSE
+{
+
+ArchitectureRecoveryPanelPlugin::ArchitectureRecoveryPanelPlugin(QObject *parent)
+ : IPlugin(parent), architectureRecoveryPanel(new ArchitectureRecoveryPanel)
+{
+}
+
+
+bool DuSE::ArchitectureRecoveryPanelPlugin::initialize()
+{
+ QAction *newArchitectureRecoveryProcessAction = new QAction(QIcon(), tr("New architecture recovery process"), this);
+ connect(newArchitectureRecoveryProcessAction, SIGNAL(triggered()), architectureRecoveryPanel, SLOT(loadPanel()));
+ ICore::self()->uiController()->addAction(newArchitectureRecoveryProcessAction, tr("menu_File"));
+
+ return true;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.h b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.h
new file mode 100644
index 00000000..a865f28b
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/architecturerecoverypanel/architecturerecoverypanelplugin.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef ARCHITECTURERECOVERYPANELPLUGIN_H
+#define ARCHITECTURERECOVERYPANELPLUGIN_H
+
+#include <duseinterfaces/iplugin.h>
+
+#include "architecturerecoverypanel.h"
+
+namespace DuSE
+{
+
+class ArchitectureRecoveryPanelPlugin : public IPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.liveblue.DuSE.IPlugin" FILE "architecturerecoverypanel.json")
+
+public:
+ ArchitectureRecoveryPanelPlugin(QObject *parent = 0);
+
+ virtual bool initialize();
+
+ void run();
+
+private:
+ ArchitectureRecoveryPanel *architectureRecoveryPanel;
+};
+
+}
+
+#endif // ARCHITECTURERECOVERYPANELPLUGIN_H
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend.pro b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend.pro
index d4041016..9c4cf0ab 100644
--- a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend.pro
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend.pro
@@ -8,8 +8,15 @@ include(../../duse-mt-plugin.pri)
QT += widgets gui
-HEADERS += gccxmlarchitecturerecoverybackendplugin.h
+DEFINES += GCCXMLARCHITECTURERECOVERYBACKEND_LIBRARY
-SOURCES += gccxmlarchitecturerecoverybackendplugin.cpp
+HEADERS += gccxmlarchitecturerecoverybackend_export.h \
+ gccxmlarchitecturerecoverybackendplugin.h \
+ xmlfilemanager.h \
+ xmlfilereader.h
+
+SOURCES += gccxmlarchitecturerecoverybackendplugin.cpp \
+ xmlfilemanager.cpp \
+ xmlfilereader.cpp
OTHER_FILES += gccxmlarchitecturerecoverybackend.json
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend_export.h b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend_export.h
new file mode 100644
index 00000000..e96b5845
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackend_export.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GCCXMLARCHITECTURERECOVERYBACKEND_EXPORT_H
+#define GCCXMLARCHITECTURERECOVERYBACKEND_EXPORT_H
+
+#include <qglobal.h>
+
+#if defined(GCCXMLARCHITECTURERECOVERYBACKEND_LIBRARY)
+# define GCCXMLARCHITECTURERECOVERYBACKEND_EXPORT Q_DECL_EXPORT
+#else
+# define GCCXMLARCHITECTURERECOVERYBACKEND_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // GCCXMLARCHITECTURERECOVERYBACKEND_EXPORT_H
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp
index e161b412..220bf417 100644
--- a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.cpp
@@ -42,7 +42,9 @@
#include <QtWidgets/QAction>
#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QMessageBox>
+#include <QtCore/QDebug>
#include <QtCore/QProcess>
#include <QtCore/QXmlStreamReader>
@@ -54,244 +56,247 @@ namespace DuSE
GccXmlArchitectureRecoveryBackendPlugin::GccXmlArchitectureRecoveryBackendPlugin(QObject *parent) :
IPlugin(parent)
{
+ _name = "C++ (GCC-XML)";
+ qRegisterMetaType<DependencyRelations>("DependencyRelations");
}
bool GccXmlArchitectureRecoveryBackendPlugin::initialize()
{
- QAction *newArchitectureRecoveryProcessAction = new QAction(QIcon(), tr("New architecture recovery process"), this);
- connect(newArchitectureRecoveryProcessAction, SIGNAL(triggered()), this, SLOT(newArchitectureRecoveryProcess()));
- ICore::self()->uiController()->addAction(newArchitectureRecoveryProcessAction, tr("menu_File"));
- qRegisterMetaType<ClassFunctions>("ClassFunctions");
return true;
}
-void GccXmlArchitectureRecoveryBackendPlugin::setRootProjectDir(const QDir &rootProjectDir)
-{
- _rootProjectDir = rootProjectDir;
-}
-
-void GccXmlArchitectureRecoveryBackendPlugin::newArchitectureRecoveryProcess()
-{
- QString directory = QFileDialog::getExistingDirectory(0, tr("Open code tree"), QDir::currentPath());
- _rootProjectDir = QDir(directory);
- components();
-}
QObjectList GccXmlArchitectureRecoveryBackendPlugin::components()
{
QObjectList components;
- QStringList headers = _rootProjectDir.entryList(QStringList("*.h"), QDir::Files | QDir::NoSymLinks);
- QStringList xmlFiles = generateXmlFiles(headers);
- int xmlFilesSize = xmlFiles.size();
- for (int i = 0; i < xmlFilesSize; ++i) {
- _xmlFileName = xmlFiles.at(i).toLocal8Bit().constData();
-
- QObject *component = extractComponent();
- components.append(component);
- }
+ QObject *componentsDependencyRelations = new QObject;
+ componentsDependencyRelations->setProperty("components", QVariant::fromValue(_dependencyRelations));
+ componentsDependencyRelations->setProperty("systemDirectory", QVariant::fromValue(_rootProjectDirectoryString));
+ components.append(componentsDependencyRelations);
return components;
}
QObjectList GccXmlArchitectureRecoveryBackendPlugin::connectors()
{
- return QObjectList();
+ QObjectList connectors;
+
+ return connectors;
}
-QStringList GccXmlArchitectureRecoveryBackendPlugin::generateXmlFiles(const QStringList &codeFiles) const
+void GccXmlArchitectureRecoveryBackendPlugin::run()
{
- int codeFilesSize = codeFiles.size();
-
- for (int i = 0; i < codeFilesSize; ++i) {
- QString file = codeFiles.at(i).toLocal8Bit().constData();
- QString fileDir = _rootProjectDir.absolutePath() + "/" + file;
- QString xmlFileDir = _rootProjectDir.absolutePath() + "/" + file.replace(".h", ".xml");
-
- QProcess process;
- process.start("gccxml " + fileDir + " -fxml=" + xmlFileDir);
- process.waitForFinished();
- }
-
- return _rootProjectDir.entryList(QStringList("*.xml"), QDir::Files | QDir::NoSymLinks);
+ runGccXml();
+ recoverDependencyRelations();
}
-bool GccXmlArchitectureRecoveryBackendPlugin::openXmlFile(const QString &filePath)
+void GccXmlArchitectureRecoveryBackendPlugin::runGccXml()
{
- _xmlFile.setFileName(filePath);
- _xmlReader = new QXmlStreamReader(&_xmlFile);
+ _rootProjectDirectoryString = QFileDialog::getExistingDirectory(0, "Escolha o diretório raíz do projeto", QDir::currentPath());
- if (!_xmlFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- return false;
+ if (_rootProjectDirectoryString.isEmpty()) {
+ QMessageBox errorMessage;
+ errorMessage.setInformativeText("Diretório inválido.");
+ errorMessage.show();
+ } else {
+ _rootProjectDirectory = QDir(_rootProjectDirectoryString);
+ _xmlFilesList = _xmlFileManager->generateXmlFiles(_rootProjectDirectory);
+ _xmlCount = _xmlFilesList.count();
}
-
- return true;
}
-QStringList GccXmlArchitectureRecoveryBackendPlugin::findConstructorsFromXml()
+void GccXmlArchitectureRecoveryBackendPlugin::recoverDependencyRelations()
{
- QStringList constructors;
+ QString fileName;
- openXmlFile(_rootProjectDir.absolutePath() + "/" + _xmlFileName);
- QString className = _xmlFileName;
- className.replace(".xml", "");
- while (!_xmlReader->atEnd() && !_xmlReader->hasError()) {
- QXmlStreamReader::TokenType token = _xmlReader->readNext();
+ for (int i = 0; i < _xmlCount; ++i) {
+ fileName = _xmlFilesList.at(i).toLocal8Bit().constData();
- if (token == QXmlStreamReader::StartElement) {
- if (_xmlReader->name() == "Constructor") {
- QXmlStreamAttributes attributes = _xmlReader->attributes();
+ _reader = new XmlFileReader(_rootProjectDirectory.absolutePath(), fileName);
- QString attribute = attributes.value("demangled").toString();
- if (attribute.contains(className + "::", Qt::CaseInsensitive)) {
- constructors.append(attribute);
- }
- }
- }
- }
- if (_xmlFile.isOpen()) {
- _xmlFile.close();
- }
-
- return constructors;
-}
+ _reader->fillTagContainers();
-QObject *GccXmlArchitectureRecoveryBackendPlugin::extractComponent()
-{
- QObject *component = new QObject;
- QString className;
- QStringList constructors = findConstructorsFromXml();
+ _fileClasses.insert(fileName, _reader->fileClasses());
+ _fileFields.insert(fileName, _reader->fileFields());
+ _filePointers.insert(fileName, _reader->filePointers());
+ _fileBases.insert(fileName, _reader->fileBases());
+ _fileArguments.insert(fileName, _reader->fileArguments());
- if (!constructors.isEmpty()) {
- QString expression = constructors.last();
- QStringList elements = expression.split("::");
- className = elements.at(0) + "::" + elements.at(1);
+ fieldAdjacencies();
+ baseAdjacencies();
+ argumentsAdjacencies();
- component->setObjectName(className);
- } else {
- className = _xmlFileName;
- className.replace(".xml", "");
- component->setObjectName(className);
+ qDebug() << "Tamanho de dependencyRelations: " << _dependencyRelations.count();
}
-
- findFunctionsFromXml(component);
-
- return component;
}
-void GccXmlArchitectureRecoveryBackendPlugin::findFunctionsFromXml(QObject *component)
+void GccXmlArchitectureRecoveryBackendPlugin::fieldAdjacencies()
{
- QHash<QString, QMultiHash<QString, QString> > classFunctions;
-
- openXmlFile(_rootProjectDir.absolutePath() + "/" + _xmlFileName);
-
- QStringList expression = component->objectName().split("::");
- QString classNamespace = expression.first();
-
- while (!_xmlReader->atEnd() && !_xmlReader->hasError()) {
- QXmlStreamReader::TokenType token = _xmlReader->readNext();
-
- if (token == QXmlStreamReader::StartElement) {
- if ((_xmlReader->name() == "Method") ||
- (_xmlReader->name() == "Constructor") ||
- (_xmlReader->name() == "Destructor")) {
- QString attribute = _xmlReader->attributes().value("demangled").toString();
+ QString fileName;
+
+ for (int i = 0; i < _xmlCount; ++i) {
+
+ fileName = _xmlFilesList.at(i).toLocal8Bit().constData();
+
+ QMap<QString, QString> classes = _fileClasses.value(fileName);
+ QList<QPair<QString, QString> > fields = _fileFields.value(fileName);
+ QMap<QString, QString> pointers = _filePointers.value(fileName);
+
+ QString dependent;
+ QString dependency;
+
+ QStringList classIds = classes.keys();
+ foreach (QString classId, classIds) {
+ dependent = classes.value(classId);
+ for (int i = 0; i < fields.size(); ++i) {
+ QPair<QString, QString> field = fields.at(i);
+ if (classId == field.first) {
+ if (classes.value(field.second).isEmpty()) {
+ QStringList pointersId = pointers.keys();
+ foreach (QString pointerId, pointersId) {
+ if (field.second == pointerId) {
+ if (!classes.value(pointers.value(pointerId)).isEmpty()) {
+ dependency = classes.value(pointers.value(pointerId));
+ }
+ }
+ }
+ } else {
+ dependency = classes.value(field.second);
+ }
+ }
- if (attribute.contains(classNamespace + "::", Qt::CaseInsensitive)) {
- classFunctions = classFunctionsContainer(attribute, classFunctions);
+ if (!_dependencyRelations.keys().contains(dependent)) {
+ if (!dependent.isEmpty() && !dependency.isEmpty()) {
+ _dependencyRelations.insert(dependent, dependency);
+ }
+ } else {
+ bool isNewDependencie = false;
+ QStringList dependencies = _dependencyRelations.values(dependent);
+ foreach (QString d, dependencies) {
+ if (dependency == d) {
+ isNewDependencie = true;
+ }
+ }
+ if (isNewDependencie == false) {
+ if (!dependent.isEmpty() && !dependency.isEmpty()) {
+ _dependencyRelations.insert(dependent, dependency);
+ }
+ }
}
+
+ dependency = "";
}
}
}
- if (_xmlFile.isOpen()) {
- _xmlFile.close();
- }
-
- component->setProperty("Functions", QVariant::fromValue(classFunctions));
}
-QHash<QString, QMultiHash<QString, QString> > GccXmlArchitectureRecoveryBackendPlugin::classFunctionsContainer(QString xmlAttribute, QHash<QString, QMultiHash<QString, QString> > &classFunctions)
+void GccXmlArchitectureRecoveryBackendPlugin::baseAdjacencies()
{
- QMultiHash<QString, QString> function;
+ QString fileName;
- QStringList signature = xmlAttribute.split("::");
- QString className = signature.at(0) + "::" + signature.at(1);
- QString functionName = signature.at(2).left(signature.at(2).indexOf("("));
+ for (int i = 0; i < _xmlCount; ++i) {
- findFunctionParameters(functionName, function);
- classFunctions.insert(className, function);
+ fileName = _xmlFilesList.at(i).toLocal8Bit().constData();
- return classFunctions;
-}
+ QMap<QString, QString> classes = _fileClasses.value(fileName);
+ QList<QPair<QString, QString> > bases = _fileBases.value(fileName);
-void GccXmlArchitectureRecoveryBackendPlugin::findFunctionParameters(const QString &functionName, QMultiHash<QString, QString> &function)
-{
- while (_xmlReader->readNextStartElement()) {
- if (!_xmlReader->attributes().value("name").toString().isEmpty()) {
- QString parameterName = _xmlReader->attributes().value("name").toString();
- QString typeID = _xmlReader->attributes().value("type").toString();
-
- QString parameterTypeNumber = findTypeNumber(typeID);
- QString parameterType = findType(parameterTypeNumber);
- if (parameterType == "") {
- parameterType = findType(typeID);
- }
+ QString dependent;
+ QString dependency;
- function.insert(functionName, parameterName + " " + parameterType);
- }
- }
-}
-
-QString GccXmlArchitectureRecoveryBackendPlugin::findTypeNumber(const QString &typeID)
-{
- QFile file(_rootProjectDir.absolutePath() + "/" + _xmlFileName);
- QXmlStreamReader *typeNumberCollector = new QXmlStreamReader(&file);
- file.open(QIODevice::ReadOnly | QIODevice::Text);
-
- while (!typeNumberCollector->atEnd() && !typeNumberCollector->hasError()) {
- QXmlStreamReader::TokenType token = typeNumberCollector->readNext();
+ QStringList classIds = classes.keys();
+ foreach (QString classId, classIds) {
+ dependent = classes.value(classId);
+ for (int i = 0; i < bases.size(); ++i) {
+ QPair<QString, QString> base = bases.at(i);
+ if (classId == base.first) {
+ dependency = classes.value(base.second);
+ }
+ }
- if (token == QXmlStreamReader::StartElement) {
- if (typeNumberCollector->name() == "PointerType") {
- if (typeNumberCollector->attributes().value("id").toString() == typeID) {
- break;
+ if (!_dependencyRelations.keys().contains(dependent)) {
+ if (!dependent.isEmpty() && !dependency.isEmpty()) {
+ _dependencyRelations.insert(dependent, dependency);
+ }
+ } else {
+ bool isNewDependencie = false;
+ QStringList dependencies = _dependencyRelations.values(dependent);
+ foreach (QString d, dependencies) {
+ if (dependency == d) {
+ isNewDependencie = true;
+ }
+ }
+ if (isNewDependencie == false) {
+ if (!dependent.isEmpty() && !dependency.isEmpty()) {
+ _dependencyRelations.insert(dependent, dependency);
+ }
}
}
+
+ dependency = "";
}
}
-
- QString typeNumber = typeNumberCollector->attributes().value("type").toString();
-
- file.close();
- delete typeNumberCollector;
-
- return typeNumber;
}
-QString GccXmlArchitectureRecoveryBackendPlugin::findType(const QString &typeNumber)
+void GccXmlArchitectureRecoveryBackendPlugin::argumentsAdjacencies()
{
- QFile file(_rootProjectDir.absolutePath() + "/" + _xmlFileName);
- QXmlStreamReader *typeCollector = new QXmlStreamReader(&file);
- file.open(QIODevice::ReadOnly | QIODevice::Text);
-
- while (!typeCollector->atEnd() && !typeCollector->hasError()) {
- QXmlStreamReader::TokenType token = typeCollector->readNext();
+ QString fileName;
+
+ for (int i = 0; i < _xmlCount; ++i) {
+
+ fileName = _xmlFilesList.at(i).toLocal8Bit().constData();
+
+ QMap<QString, QString> classes = _fileClasses.value(fileName);
+ QList<QPair<QString, QString> > arguments = _fileArguments.value(fileName);
+ QMap<QString, QString> pointers = _filePointers.value(fileName);
+
+ QString dependent;
+ QString dependency;
+
+ QStringList classIds = classes.keys();
+ foreach (QString classId, classIds) {
+ dependent = classes.value(classId);
+ for (int i = 0; i < arguments.size(); ++i) {
+ QPair<QString, QString> argument = arguments.at(i);
+ if (classId == argument.first) {
+ if (classes.value(argument.second).isEmpty()) {
+ QStringList pointersId = pointers.keys();
+ foreach (QString pointerId, pointersId) {
+ if (argument.second == pointerId) {
+ if (!classes.value(pointers.value(pointerId)).isEmpty()) {
+ dependency = classes.value(pointers.value(pointerId));
+ }
+ }
+ }
+ } else {
+ dependency = classes.value(argument.second);
+ }
+ }
+ }
- if (token == QXmlStreamReader::StartElement) {
- if (typeCollector->name() == "Class") {
- if (typeCollector->attributes().value("id").toString() == typeNumber) {
- break;
+ if (!_dependencyRelations.keys().contains(dependent)) {
+ if (!dependent.isEmpty() && !dependency.isEmpty()) {
+ _dependencyRelations.insert(dependent, dependency);
+ }
+ } else {
+ bool isNewDependencie = false;
+ QStringList dependencies = _dependencyRelations.values(dependent);
+ foreach (QString d, dependencies) {
+ if (dependency == d) {
+ isNewDependencie = true;
+ }
+ }
+ if (isNewDependencie == false) {
+ if (!dependent.isEmpty() && !dependency.isEmpty()) {
+ _dependencyRelations.insert(dependent, dependency);
+ }
}
}
+
+ dependency = "";
}
}
-
- QString type = typeCollector->attributes().value("name").toString();
-
- file.close();
- delete typeCollector;
-
- return type;
}
}
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.h b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.h
index 8c14f3c1..e83efce8 100644
--- a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.h
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/gccxmlarchitecturerecoverybackendplugin.h
@@ -47,10 +47,16 @@
#include <QtCore/QDir>
#include <QtCore/QHash>
#include <QtCore/QObjectList>
+#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QMetaType>
#include <QtCore/QVariant>
+#include "xmlfilemanager.h"
+#include "xmlfilereader.h"
+
+#include "gccxmlarchitecturerecoverybackend_export.h"
+
QT_BEGIN_NAMESPACE
class QXmlStreamReader;
QT_END_NAMESPACE
@@ -58,7 +64,7 @@ QT_END_NAMESPACE
namespace DuSE
{
-class GccXmlArchitectureRecoveryBackendPlugin : public IPlugin, public IArchitectureRecoveryBackend
+class GCCXMLARCHITECTURERECOVERYBACKEND_EXPORT GccXmlArchitectureRecoveryBackendPlugin : public IPlugin, public IArchitectureRecoveryBackend
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.liveblue.DuSE.IPlugin" FILE "gccxmlarchitecturerecoverybackend.json")
@@ -68,35 +74,36 @@ public:
virtual bool initialize();
- void setRootProjectDir(const QDir &rootProjectDir);
-
virtual QObjectList components();
virtual QObjectList connectors();
+ void run();
+ void runGccXml();
+ void recoverDependencyRelations();
+ void fieldAdjacencies();
+ void baseAdjacencies();
+ void argumentsAdjacencies();
private Q_SLOTS:
- void newArchitectureRecoveryProcess();
private:
- QStringList generateXmlFiles(const QStringList &codeFiles) const;
- bool openXmlFile(const QString &filePath);
- QStringList findConstructorsFromXml();
- QObject *extractComponent();
- void findFunctionsFromXml(QObject *component);
- QHash<QString, QMultiHash<QString, QString> > classFunctionsContainer(QString xmlAttribute, QHash<QString, QMultiHash<QString, QString> > &classFunctions);
- void findFunctionParameters(const QString &functionName, QMultiHash<QString, QString> &function);
- QString findTypeNumber(const QString &typeID);
- QString findType(const QString &typeNumber);
-
- QDir _rootProjectDir;
- QFile _xmlFile;
- QString _xmlFileName;
- QXmlStreamReader *_xmlReader;
+ int _xmlCount;
+ QDir _rootProjectDirectory;
+ QString _rootProjectDirectoryString;
+ QStringList _xmlFilesList;
+ XmlFileManager *_xmlFileManager;
+ XmlFileReader *_reader;
+ QMap<QString, QMap<QString, QString> > _fileClasses;
+ QMap<QString, QList<QPair<QString, QString> > > _fileFields;
+ QMap<QString, QMap<QString, QString> > _filePointers;
+ QMap<QString, QList<QPair<QString, QString> > > _fileBases;
+ QMap<QString, QList<QPair<QString, QString> > > _fileArguments;
+ QMultiMap<QString, QString> _dependencyRelations;
};
-typedef QHash<QString, QMultiHash<QString, QString> > ClassFunctions;
+typedef QMultiMap<QString, QString> DependencyRelations;
#endif // GCCXMLARCHITECTURERECOVERYBACKENDPLUGIN
}
-Q_DECLARE_METATYPE(DuSE::ClassFunctions);
+Q_DECLARE_METATYPE(DuSE::DependencyRelations);
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.cpp b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.cpp
new file mode 100644
index 00000000..fee7f8d5
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "xmlfilemanager.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QProcess>
+#include <QtCore/QXmlStreamReader>
+
+namespace DuSE
+{
+
+XmlFileManager::XmlFileManager()
+{
+}
+
+QStringList XmlFileManager::generateXmlFiles(const QDir &rootProjectDir) const
+{
+ QStringList headers = rootProjectDir.entryList(QStringList("*.h"), QDir::Files | QDir::NoSymLinks);
+
+ int codeFilesSize = headers.size();
+
+ for (int i = 0; i < codeFilesSize; ++i) {
+ QString file = headers.at(i).toLocal8Bit().constData();
+ QString fileDir = rootProjectDir.absolutePath() + "/" + file;
+ QString xmlFileDir = rootProjectDir.absolutePath() + "/" + file.replace(".h", ".xml");
+
+ QProcess process;
+ process.start("gccxml " + fileDir + " -fxml=" + xmlFileDir);
+ process.waitForFinished();
+ }
+
+ return rootProjectDir.entryList(QStringList("*.xml"), QDir::Files | QDir::NoSymLinks);
+}
+
+QXmlStreamReader *XmlFileManager::openXmlFile(const QString &filePath)
+{
+ _xmlFile.setFileName(filePath);
+ _xmlReader = new QXmlStreamReader(&_xmlFile);
+
+ if (!_xmlFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ return new QXmlStreamReader;
+ }
+
+ return _xmlReader;
+}
+
+void XmlFileManager::closeXmlFile()
+{
+ if (_xmlFile.isOpen()) {
+ _xmlFile.close();
+ }
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.h b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.h
new file mode 100644
index 00000000..cad93994
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilemanager.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef XMLFILEMANAGER_H
+#define XMLFILEMANAGER_H
+
+#include <QtCore/QFile>
+#include <QtCore/QStringList>
+
+QT_BEGIN_NAMESPACE
+class QDir;
+class QXmlStreamReader;
+QT_END_NAMESPACE
+
+namespace DuSE
+{
+
+class XmlFileManager
+{
+public:
+ XmlFileManager();
+
+ ~XmlFileManager();
+
+ QStringList generateXmlFiles(const QDir &rootProjectDir) const;
+ QXmlStreamReader* openXmlFile(const QString &filePath);
+ void closeXmlFile();
+
+private:
+ QFile _xmlFile;
+ QXmlStreamReader *_xmlReader;
+};
+
+}
+
+#endif // XMLFILEMANAGER_H
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.cpp b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.cpp
new file mode 100644
index 00000000..79ce4297
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.cpp
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "xmlfilereader.h"
+
+#include <QXmlStreamAttributes>
+
+namespace DuSE
+{
+
+XmlFileReader::XmlFileReader(QString rootDirectory, QString fileName)
+ : _rootProjectDir(rootDirectory), _fileName(fileName)
+{
+ _xmlFileManager = new XmlFileManager;
+}
+
+void XmlFileReader::fillTagContainers()
+{
+ _xmlReader = _xmlFileManager->openXmlFile(_rootProjectDir + "/" + _fileName);
+
+ while (!_xmlReader->atEnd() & !_xmlReader->hasError()) {
+ QXmlStreamReader::TokenType token = _xmlReader->readNext();
+ QPair<QString, QString> auxPair;
+
+ if (token == QXmlStreamReader::StartElement) {
+ QXmlStreamAttributes attributes;
+
+ if (_xmlReader->name() == "Class") {
+ attributes = _xmlReader->attributes();
+ QString classId = attributes.value("id").toString();
+ QString className = attributes.value("name").toString();
+ if (!_fileClasses.values().contains(className)) {
+ _fileClasses.insert(classId, className);
+ }
+
+ do {
+ if (_xmlReader->readNextStartElement()) {
+ if (_xmlReader->name() == "Base") {
+ attributes = _xmlReader->attributes();
+ QString baseType = attributes.value("type").toString();
+ auxPair.first = classId;
+ auxPair.second = baseType;
+ _fileBases.append(auxPair);
+ }
+ }
+ } while (_xmlReader->name() == "Base");
+ }
+
+ if (_xmlReader->name() == "Field") {
+ attributes = _xmlReader->attributes();
+ QString fieldContext = attributes.value("context").toString();
+ QString fieldType = attributes.value("type").toString();
+ auxPair.first = fieldContext;
+ auxPair.second = fieldType;
+ _fileFields.append(auxPair);
+ }
+
+ if (_xmlReader->name() == "PointerType") {
+ attributes = _xmlReader->attributes();
+ QString pointerId = attributes.value("id").toString();
+ QString pointerType = attributes.value("type").toString();
+ auxPair.first = pointerId;
+ auxPair.second = pointerType;
+ _filePointers.insert(pointerId, pointerType);
+ }
+
+
+ if (_xmlReader->name() == "Method") {
+ attributes = _xmlReader->attributes();
+ QString methodContext = attributes.value("context").toString();
+
+ do {
+ if (_xmlReader->readNextStartElement()) {
+ if (_xmlReader->name() == "Argument") {
+ attributes = _xmlReader->attributes();
+ QString argumentType = attributes.value("type").toString();
+ auxPair.first = methodContext;
+ auxPair.second = argumentType;
+ _fileArguments.append(auxPair);
+ }
+ }
+ } while (_xmlReader->name() == "Argument");
+ }
+ }
+ } _xmlFileManager->closeXmlFile();
+}
+
+QMap<QString, QString> XmlFileReader::fileClasses()
+{
+ return _fileClasses;
+}
+
+QList<QPair<QString, QString> > XmlFileReader::fileFields()
+{
+ return _fileFields;
+}
+
+QMap<QString, QString> XmlFileReader::filePointers()
+{
+ return _filePointers;
+}
+
+QList<QPair<QString, QString> > XmlFileReader::fileBases()
+{
+ return _fileBases;
+}
+
+QList<QPair<QString, QString> > XmlFileReader::fileArguments()
+{
+ return _fileArguments;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.h b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.h
new file mode 100644
index 00000000..6059c8f5
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/gccxmlarchitecturerecoverybackend/xmlfilereader.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef XMLFILEREADER_H
+#define XMLFILEREADER_H
+
+#include <QHash>
+#include <QList>
+#include <QMultiMap>
+#include <QtCore/QStringList>
+
+QT_BEGIN_NAMESPACE
+class QXmlStreamReader;
+QT_END_NAMESPACE
+
+#include "xmlfilemanager.h"
+
+namespace DuSE
+{
+
+class XmlFileReader
+{
+public:
+ XmlFileReader(QString rootDirectory, QString fileName);
+ ~XmlFileReader();
+
+ void fillTagContainers();
+ QMap<QString, QString> fileClasses();
+ QList<QPair<QString, QString> > fileFields();
+ QMap<QString, QString> filePointers();
+ QList<QPair<QString, QString> > fileBases();
+ QList<QPair<QString, QString> > fileArguments();
+
+private:
+ QString _rootProjectDir;
+ QString _fileName;
+ QXmlStreamReader *_xmlReader;
+ XmlFileManager *_xmlFileManager;
+ QMap<QString, QString> _fileClasses;
+ QList<QPair<QString, QString> > _fileFields;
+ QMap<QString, QString> _filePointers;
+ QList<QPair<QString, QString> > _fileBases;
+ QList<QPair<QString, QString> > _fileArguments;
+};
+
+}
+
+#endif // XMLFILEREADER_H
diff --git a/examples/uml/duse-mt/src/plugins/plugins.pro b/examples/uml/duse-mt/src/plugins/plugins.pro
index 9361759b..288a90aa 100644
--- a/examples/uml/duse-mt/src/plugins/plugins.pro
+++ b/examples/uml/duse-mt/src/plugins/plugins.pro
@@ -14,4 +14,7 @@ qtHaveModule(quick): SUBDIRS += welcomedashboard \
qtHaveModule(script):qtHaveModule(quick): SUBDIRS += designspaceexplorer
SUBDIRS += architecturerecoverycore \
- gccxmlarchitecturerecoverybackend
+ gccxmlarchitecturerecoverybackend \
+ acdcarchitecturerecoveryalgorithm \
+ umlmodelingnotation \
+ architecturerecoverypanel
diff --git a/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.json b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.json
new file mode 100644
index 00000000..1952997f
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.json
@@ -0,0 +1,8 @@
+{
+ "Category": "Architecture Recovery",
+ "Vendor": "Qt Project",
+ "Version": "1.0",
+ "DependencyList": [
+ "ArchitectureRecoveryCorePlugin"
+ ]
+}
diff --git a/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.pro b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.pro
new file mode 100644
index 00000000..acd61e57
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation.pro
@@ -0,0 +1,21 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2014-08-14T03:21:41
+#
+#-------------------------------------------------
+
+include(../../duse-mt-plugin.pri)
+
+QT -= widgets gui
+QT += modeling uml
+
+DEFINES += UMLMODELINGNOTATION_LIBRARY
+
+HEADERS += \
+ umlmodelingnotation_export.h \
+ umlmodelingnotationplugin.h
+
+SOURCES += \
+ umlmodelingnotationplugin.cpp
+
+OTHER_FILES += umlmodelingnotation.json
diff --git a/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_dependencies.pri b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_dependencies.pri
new file mode 100644
index 00000000..7a6dd211
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_dependencies.pri
@@ -0,0 +1,4 @@
+DUSEMT_PLUGIN_NAME = UmlModelingNotation
+
+DUSEMT_PLUGIN_DEPENDS += \
+ architecturerecoverycore
diff --git a/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_export.h b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_export.h
new file mode 100644
index 00000000..b5e46f50
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotation_export.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UMLMODELINGNOTATION_EXPORT_H
+#define UMLMODELINGNOTATION_EXPORT_H
+
+#include <qglobal.h>
+
+#if defined(UMLMODELINGNOTATION_LIBRARY)
+# define UMLMODELINGNOTATION_EXPORT Q_DECL_EXPORT
+#else
+# define UMLMODELINGNOTATION_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // UMLMODELINGNOTATION_EXPORT_H
diff --git a/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.cpp b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.cpp
new file mode 100644
index 00000000..c06b6474
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "umlmodelingnotationplugin.h"
+
+#include <QtModeling/QXmiWriter>
+
+namespace DuSE
+{
+
+UmlModelingNotationPlugin::UmlModelingNotationPlugin(QObject *parent)
+ : IPlugin(parent)
+{
+ _name = "UML Notation";
+}
+
+bool UmlModelingNotationPlugin::initialize()
+{
+ return true;
+}
+
+void UmlModelingNotationPlugin::generateDiagram(const QString &name)
+{
+ QFile file(QString(name + "/output.xmi"));
+
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ qDebug() << "Cannot write file !";
+ } else {
+ QXmiWriter writer;
+ QList<QModelingObject *> list;
+ foreach (QUmlPackage *subsystem, _subsystems) {
+ list<< subsystem->asQModelingObject();
+ }
+
+ if (writer.writeFile(list, &file)) {
+ qDebug() << "XMI file saved !";
+ } else {
+ qDebug() << "Error when writing XMI file !";
+ }
+ }
+
+ file.close();
+}
+
+void UmlModelingNotationPlugin::loadSubsystems()
+{
+ foreach (QStringList clusterElements, _clusterList) {
+ QUmlPackage *subsystem = new QUmlPackage;
+ subsystem->setName(clusterElements.at(0));
+ for (int i = 1; i < clusterElements.count(); ++i) {
+ QUmlPackage *subsystemElement = new QUmlPackage;
+ subsystemElement->setName(clusterElements.at(i));
+ subsystem->addPackagedElement(subsystemElement);
+ }
+ _subsystems.append(subsystem);
+ }
+}
+
+void UmlModelingNotationPlugin::setClusterList(QList<QStringList> m_clusterList)
+{
+ _clusterList = m_clusterList;
+}
+
+}
diff --git a/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.h b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.h
new file mode 100644
index 00000000..fb1f76c3
--- /dev/null
+++ b/examples/uml/duse-mt/src/plugins/umlmodelingnotation/umlmodelingnotationplugin.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Sandro S. Andrade <sandroandrade@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtUml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef UMLMODELINGNOTATIONPLUGIN_H
+#define UMLMODELINGNOTATIONPLUGIN_H
+
+#include <duseinterfaces/iplugin.h>
+#include <architecturerecoverycore/imodelingnotation.h>
+
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
+#include <QtUml/QtUml>
+
+#include "umlmodelingnotation_export.h"
+
+namespace DuSE
+{
+
+class UMLMODELINGNOTATION_EXPORT UmlModelingNotationPlugin : public IPlugin, public IModelingNotation
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.liveblue.DuSE.IPlugin" FILE "umlmodelingnotation.json")
+
+public:
+ UmlModelingNotationPlugin(QObject *parent = 0);
+
+ virtual bool initialize();
+ virtual void generateDiagram(const QString &name);
+ void loadSubsystems();
+
+ void setClusterList(QList<QStringList> m_clusterList);
+
+private:
+ QList<QStringList> _clusterList;
+ QList<QUmlPackage *> _subsystems;
+};
+
+}
+
+#endif // UMLMODELINGNOTATIONPLUGIN_H