diff options
Diffstat (limited to 'examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin')
15 files changed, 0 insertions, 1101 deletions
diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlAssociation.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlAssociation.qml deleted file mode 100644 index fe3468fe..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlAssociation.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtModeling.Uml 1.0 -import "util.js" as Util - -Relationship { - name: element.name - relationshipType: "association" - source: Util.findQuickItem(parent, element.memberEnds[0].class_.name) - target: Util.findQuickItem(parent, element.memberEnds[0].type.name) - sourceAggregation: aggregation(element.memberEnds[0].aggregation); - targetAggregation: aggregation(element.memberEnds[1].aggregation); - sourceMultiplicity: element.memberEnds[0].lowerValue.value + ".." + element.memberEnds[0].upperValue.value - targetMultiplicity: element.memberEnds[1].lowerValue.value + ".." + element.memberEnds[1].upperValue.value - function aggregation(aggregationEnum) - { - switch (aggregationEnum) { - case 0: return "none" - case 1: return "shared" - case 2: return "composite" - } - } -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml deleted file mode 100644 index bb85764a..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlClass.qml +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -UmlElement { - UmlSlot { - id: nameSlot - anchors.top: parent.top - Text { - id: label - text: element.name - anchors.centerIn: parent - font { family: "Korolev"; italic: element.isAbstract } - } - } - UmlSlot { - id: attributeSlot - anchors { top: nameSlot.bottom; topMargin: -1 } - height: (parent.height - nameSlot.height)/2 - ListView { - model: element.ownedAttributes - anchors { fill: parent; margins: 4 } - delegate: Text { - text: visibility(modelData.visibility) + modelData.name + ": " + (modelData.type ? modelData.type.name:"<no type>") - font { family: "Korolev" } - } - } - } - UmlSlot { - anchors { top: attributeSlot.bottom; topMargin: -1; bottom: parent.bottom } - ListView { - model: element.ownedOperations - anchors { fill: parent; margins: 4 } - delegate: Text { - text: visibility(modelData.visibility) + modelData.name + operationSignature(model) - font { family: "Korolev" } - } - } - } - function visibility(visibilityEnum) - { - switch (visibilityEnum) { - case 0: return " " - case 1: return "+" - case 2: return "-" - case 3: return "#" - case 4: return "~" - } - } - function operationSignature(model) - { - var generalString = "("; - var returnString = ": "; - var list = element.ownedOperations[model.index].ownedParameters; - var count = list.length; - for (var i = 0; i < count ; ++i) - { - if (list[i].direction === 4) - returnString = returnString + list[i].type.name; - else - generalString = generalString + list[i].type.name + ", "; - } - if (returnString == ": ") - returnString = returnString + "void"; - generalString = generalString + ")" + returnString; - generalString = generalString.replace(', )',')'); - return generalString; - } -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlComponent.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlComponent.qml deleted file mode 100644 index a0639d5b..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlComponent.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -UmlElement { - UmlSlot { - id: nameSlot - anchors.top: parent.top - Text { - text: element.name - anchors.centerIn: parent - font { family: "Korolev"; italic: element.isAbstract } - } - Rectangle { - border.width: 1 - width: 18; height: 18 - anchors { right: parent.right; rightMargin: 6; verticalCenter: parent.verticalCenter } - Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 3 } - Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 10 } - } - } - UmlSlot { - id: partSlot - anchors { top: nameSlot.bottom; topMargin: -1; bottom: parent.bottom } - } - Row { - width: parent.width - spacing: (parent.width - 14*ports.length)/(ports.length-1) - anchors { bottom: parent.bottom; bottomMargin: -7 } - Repeater { - model: ports.length - Rectangle { - border.width: 1 - width: 14; height: 14 - } - } - } - Component.onCompleted: { - var component = Qt.createComponent("UmlProperty.qml") - if (component.status == Component.Ready) { - var partLength = parts.length - for (var i = 0; i < partLength; ++i) { - component.createObject(partSlot, { name: parts[i].name + ":" + parts[i].type.name }) - } - } - } -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlElement.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlElement.qml deleted file mode 100644 index 3d7bce0b..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlElement.qml +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -Rectangle { - id: element - - width: 120 - height: 80 - - // Drag area - MouseArea { - anchors.fill: parent - drag { target: parent; minimumX: 0; minimumY: 0 } - onPressed: parent.focus = true - } - - // Selection marks (begin) - Rectangle { - visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 - anchors { right: parent.right; top: parent.top; rightMargin: -2; topMargin: -2 } - } - Rectangle { - visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 - anchors { right: parent.right; bottom: parent.bottom; rightMargin: -2; bottomMargin: -2 } - } - Rectangle { - visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 - anchors { left: parent.left; top: parent.top; leftMargin: -2; topMargin: -2 } - } - Rectangle { - visible: parent.focus; color: "black"; width: 6; height: 6; z: 2 - anchors { left: parent.left; bottom: parent.bottom; leftMargin: -2; bottomMargin: -2 } - } - // Selection marks (end) - - // Resize mark - Image { - id: resizeMark - visible: parent.focus - source: "images/resize-mark.png" - anchors { right: parent.right; bottom: parent.bottom } - z: 1 - MouseArea { - enabled: element.focus - - anchors.fill: parent - drag.target: resizeMark - - property int oldMouseX - property int oldMouseY - - hoverEnabled: true - - onPressed: { - element.focus = true; - oldMouseX = mouseX - oldMouseY = mouseY - } - - onPositionChanged: { - if (pressed) { - element.width = Math.max(element.width + (mouseX - oldMouseX), 80) - element.height = Math.max(element.height + (mouseY - oldMouseY), 50) - } - } - } - } - gradient: Gradient { - GradientStop { position: 0.0; color: "#FFFFF5" } - GradientStop { position: 1.0; color: "#FFFFE1" } - } -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlGeneralization.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlGeneralization.qml deleted file mode 100644 index 4928a5ca..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlGeneralization.qml +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtModeling.Uml 1.0 -import "util.js" as Util - -Relationship { - relationshipType: "generalization" - source: Util.findQuickItem(parent, element.specific.name) - target: Util.findQuickItem(parent, element.general.name) -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlProperty.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlProperty.qml deleted file mode 100644 index 1972afa8..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlProperty.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -UmlElement { - width: 60 - height: 40 - property alias name: label.text - property alias portsLength: repeater.model - UmlSlot { - anchors { top: parent.top; bottom: parent.bottom } - Text { - id: label - anchors.centerIn: parent - font { family: "Korolev"; italic: element.isAbstract } - } - Rectangle { - border.width: 1 - width: 18; height: 18 - anchors { right: parent.right; rightMargin: 6; verticalCenter: parent.verticalCenter } - Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 3 } - Rectangle { border.width: 1; width: 12; height: 5; x: -6; y: 10 } - } - } - Row { - width: parent.width - spacing: (parent.width - 14*ports.length)/(ports.length-1) - anchors { bottom: parent.bottom; bottomMargin: -7 } - Repeater { - id: repeater - Rectangle { - border.width: 1 - width: 14; height: 14 - } - } - } -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlSlot.qml b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlSlot.qml deleted file mode 100644 index 23f22ded..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/UmlSlot.qml +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -Rectangle { - width: parent.width - height: childrenRect.height + 10 - border { width: 1; color: "black" } - clip: true - color: "transparent" -} diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/images/resize-mark.png b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/images/resize-mark.png Binary files differdeleted file mode 100644 index b3697697..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/images/resize-mark.png +++ /dev/null diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/qmldir b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/qmldir deleted file mode 100644 index a344dd61..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/qmldir +++ /dev/null @@ -1,9 +0,0 @@ -module QtModeling.Uml -internal UmlElement UmlElement.qml -internal UmlSlot UmlSlot.qml -UmlClass 1.0 UmlClass.qml -UmlComponent 1.0 UmlComponent.qml -UmlProperty 1.0 UmlProperty.qml -UmlAssociation 1.0 UmlAssociation.qml -UmlGeneralization 1.0 UmlGeneralization.qml -plugin qtmodelingumlplugin diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/qmlplugin.pro b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/qmlplugin.pro deleted file mode 100644 index 709fd65f..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/qmlplugin.pro +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2013-10-25T17:38:51 -# -#------------------------------------------------- - -TARGET = qtmodelingumlplugin -TARGETPATH = QtModeling/Uml - -QT += quick-private - -# Qml -QML_FILES = \ - UmlElement.qml \ - UmlSlot.qml \ - UmlClass.qml \ - UmlComponent.qml \ - UmlProperty.qml \ - UmlAssociation.qml \ - UmlGeneralization.qml - -# JavaScript - -QML_FILES += \ - util.js - -# Images -QML_FILES += \ - images/resize-mark.png \ - -HEADERS += \ - umlconcretesyntaxqmlplugin.h \ - relationshipitem.h - -SOURCES += \ - umlconcretesyntaxqmlplugin.cpp \ - relationshipitem.cpp - -CONFIG += no_cxx_module -load(qml_plugin) diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp deleted file mode 100644 index 47fc8037..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/**************************************************************************** -** -** 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 "relationshipitem.h" - -#include <QtGui/QPainter> - -#include <QtWidgets/QApplication> - -#include "private/qquickrectangle_p.h" - -RelationshipItem::RelationshipItem(QQuickItem *parent) - : QQuickPaintedItem(parent), - _source(0), - _target(0), - _relationshipType("association"), - _sourceAggregation("none"), - _targetAggregation("none") -{ - setAntialiasing(true); -} - -void RelationshipItem::paint(QPainter *painter) -{ - if (!_source || !_target) - return; - - qreal x1 = _source->x(); qreal y1 = _source->y(); qreal w1 = _source->width(); qreal h1 = _source->height(); - qreal x2 = _target->x(); qreal y2 = _target->y(); qreal w2 = _target->width(); qreal h2 = _target->height(); - - QLineF originalLine(x1 + w1/2, y1 + h1/2, x2 + w2/2, y2 + h2/2); - QPointF p1, p2; - - if (originalLine.intersect(QLineF(x1 , y1 , x1 + w1, y1 ), &p1) == QLineF::BoundedIntersection) {} else - if (originalLine.intersect(QLineF(x1 , y1 + h1, x1 + w1, y1 + h1), &p1) == QLineF::BoundedIntersection) {} else - if (originalLine.intersect(QLineF(x1 , y1 , x1 , y1 + h1), &p1) == QLineF::BoundedIntersection) {} else - if (originalLine.intersect(QLineF(x1 + w1, y1 , x1 + w1, y1 + h1), &p1) == QLineF::BoundedIntersection) {} - - if (originalLine.intersect(QLineF(x2 , y2 , x2 + w2, y2 ), &p2) == QLineF::BoundedIntersection) {} else - if (originalLine.intersect(QLineF(x2 , y2 + h2, x2 + w2, y2 + h2), &p2) == QLineF::BoundedIntersection) {} else - if (originalLine.intersect(QLineF(x2 , y2 , x2 , y2 + h2), &p2) == QLineF::BoundedIntersection) {} else - if (originalLine.intersect(QLineF(x2 + w2, y2 , x2 + w2, y2 + h2), &p2) == QLineF::BoundedIntersection) {} - - painter->drawLine(p1.x()-x(), p1.y()-y(), p2.x()-x(), p2.y()-y()); - QPolygonF arrow(QVector<QPointF>() << QPointF(-12, -8) << QPointF(0, 0) << QPointF(-12, 8)); - QTransform transform; - transform.translate(p2.x()-x(), p2.y()-y()); - transform.rotate(-originalLine.angle()); - if (_relationshipType == "association") { - painter->drawPolyline(transform.map(arrow)); - QFont font("Korolev"); - QFontMetrics metrics(font); - painter->setFont(font); - painter->drawText(p1.x()-x()+(p2.x()-x()-(p1.x()-x()))/2+10, p1.y()-y()+(p2.y()-y()-(p1.y()-y()))/2, _name); - painter->drawText(p2.x()-x()+10, p2.y()-y()-10, _sourceMultiplicity); - painter->drawText(p1.x()-x()+10, p1.y()-y()-10, _targetMultiplicity); - } - else if (_relationshipType == "generalization") { - painter->setBrush(QBrush(Qt::white)); - painter->drawPolygon(transform.map(arrow)); - } - - if (_relationshipType == "association" && (_sourceAggregation == "composite" || _sourceAggregation == "shared")) { - painter->setBrush(QBrush(_sourceAggregation == "composite" ? Qt::black:Qt::white)); - QPolygon diamond(QVector<QPoint>() << QPoint(0, 0) << QPoint(12, -8) << QPoint(24, 0) << QPoint(12, 8)); - QTransform transform; - transform.translate(p1.x()-x(), p1.y()-y()); - transform.rotate(-originalLine.angle()); - painter->drawPolygon(transform.map(diamond)); - } -} - -QString RelationshipItem::name() const -{ - return _name; -} - -void RelationshipItem::setName(QString name) -{ - _name = name; -} - -QQuickRectangle *RelationshipItem::source() const -{ - return _source; -} - -void RelationshipItem::setSource(QQuickRectangle *source) -{ - if (source != _source) { - if (_source) { - disconnect(source, &QQuickRectangle::xChanged, this, &RelationshipItem::updateCoordinates); - disconnect(source, &QQuickRectangle::yChanged, this, &RelationshipItem::updateCoordinates); - } - _source = source; - if (!_target) { - setX(_source->x()); - setY(_source->y()); - } - else { - updateCoordinates(); - } - connect(source, &QQuickRectangle::xChanged, this, &RelationshipItem::updateCoordinates); - connect(source, &QQuickRectangle::yChanged, this, &RelationshipItem::updateCoordinates); - } -} - -QQuickRectangle *RelationshipItem::target() const -{ - return _target; -} - -void RelationshipItem::setTarget(QQuickRectangle *target) -{ - if (target != _target) { - if (_target) { - disconnect(target, &QQuickRectangle::xChanged, this, &RelationshipItem::updateCoordinates); - disconnect(target, &QQuickRectangle::yChanged, this, &RelationshipItem::updateCoordinates); - } - _target = target; - if (!_source) { - setX(_target->x()); - setY(_target->y()); - } - else { - updateCoordinates(); - } - connect(target, &QQuickRectangle::xChanged, this, &RelationshipItem::updateCoordinates); - connect(target, &QQuickRectangle::yChanged, this, &RelationshipItem::updateCoordinates); - } -} - -QString RelationshipItem::relationshipType() const -{ - return _relationshipType; -} - -void RelationshipItem::setRelationshipType(QString relationshipType) -{ - _relationshipType = relationshipType; -} - -QString RelationshipItem::sourceAggregation() const -{ - return _sourceAggregation; -} - -void RelationshipItem::setSourceAggregation(QString sourceAggregation) -{ - _sourceAggregation = sourceAggregation; -} - -QString RelationshipItem::targetAggregation() const -{ - return _targetAggregation; -} - -void RelationshipItem::setTargetAggregation(QString targetAggregation) -{ - _targetAggregation = targetAggregation; -} - -QString RelationshipItem::sourceMultiplicity() const -{ - return _sourceMultiplicity; -} - -void RelationshipItem::setSourceMultiplicity(QString sourceMultiplicity) -{ - _sourceMultiplicity = sourceMultiplicity; -} - -QString RelationshipItem::targetMultiplicity() const -{ - return _targetMultiplicity; -} - -void RelationshipItem::setTargetMultiplicity(QString targetMultiplicity) -{ - _targetMultiplicity = targetMultiplicity; -} - -void RelationshipItem::updateCoordinates() -{ - QQuickRectangle *minRectX = _source->x() < _target->x() ? _source:_target; - QQuickRectangle *minRectY = _source->y() < _target->y() ? _source:_target; - QQuickRectangle *maxRectX = minRectX == _source ? _target:_source; - QQuickRectangle *maxRectY = minRectY == _source ? _target:_source; - setX(minRectX->x()); - setY(minRectY->y()); - setWidth(qMax(maxRectX->x() + maxRectX->width() - minRectX->x(), qMax(_source->width(), _target->width()))); - setHeight(qMax(maxRectY->y() + maxRectY->height() - minRectY->y(), qMax(_source->height(), _target->height()))); -} - diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.h b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.h deleted file mode 100644 index aeab5f8a..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/relationshipitem.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** 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 RELATIONSHIPITEM_H -#define RELATIONSHIPITEM_H - -#include <QtQuick/QQuickPaintedItem> - -QT_BEGIN_NAMESPACE -class QQuickRectangle; -QT_END_NAMESPACE - -class RelationshipItem : public QQuickPaintedItem -{ - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QQuickRectangle * source READ source WRITE setSource) - Q_PROPERTY(QQuickRectangle * target READ target WRITE setTarget) - Q_PROPERTY(QString relationshipType READ relationshipType WRITE setRelationshipType) - Q_PROPERTY(QString sourceAggregation READ sourceAggregation WRITE setSourceAggregation) - Q_PROPERTY(QString targetAggregation READ targetAggregation WRITE setTargetAggregation) - Q_PROPERTY(QString sourceMultiplicity READ sourceMultiplicity WRITE setSourceMultiplicity) - Q_PROPERTY(QString targetMultiplicity READ targetMultiplicity WRITE setTargetMultiplicity) - -public: - RelationshipItem(QQuickItem *parent = 0); - - void paint(QPainter *painter); - - QString name() const; - void setName(QString name); - - QQuickRectangle *source() const; - void setSource(QQuickRectangle *source); - - QQuickRectangle *target() const; - void setTarget(QQuickRectangle *target); - - QString relationshipType() const; - void setRelationshipType(QString relationshipType); - - QString sourceAggregation() const; - void setSourceAggregation(QString sourceAggregation); - - QString targetAggregation() const; - void setTargetAggregation(QString targetAggregation); - - QString sourceMultiplicity() const; - void setSourceMultiplicity(QString sourceMultiplicity); - - QString targetMultiplicity() const; - void setTargetMultiplicity(QString targetMultiplicity); - -private Q_SLOTS: - void updateCoordinates(); - -private: - QString _name; - QQuickRectangle *_source; - QQuickRectangle *_target; - QString _relationshipType; - QString _sourceAggregation; - QString _targetAggregation; - QString _sourceMultiplicity; - QString _targetMultiplicity; -}; - -#endif // RELATIONSHIPITEM_H - diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/umlconcretesyntaxqmlplugin.cpp b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/umlconcretesyntaxqmlplugin.cpp deleted file mode 100644 index e640fcd0..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/umlconcretesyntaxqmlplugin.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 "umlconcretesyntaxqmlplugin.h" - -#include <QtQml/QQmlEngine> - -#include "relationshipitem.h" - -void UmlConcreteSyntaxQmlPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(uri == QLatin1String("QtModeling.Uml")); - // @uri QtModeling.Uml - qmlRegisterType<RelationshipItem>(uri, 1, 0, "Relationship"); -} - diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/umlconcretesyntaxqmlplugin.h b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/umlconcretesyntaxqmlplugin.h deleted file mode 100644 index bf5438f6..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/umlconcretesyntaxqmlplugin.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** 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 UMLCONCRETESYNTAXQMLPLUGIN_H -#define UMLCONCRETESYNTAXQMLPLUGIN_H - -#include <QtQml/QQmlExtensionPlugin> - -class UmlConcreteSyntaxQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") - -public: - void registerTypes(const char *uri); -}; - -#endif // UMLCONCRETESYNTAXQMLPLUGIN_H - diff --git a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/util.js b/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/util.js deleted file mode 100644 index b8438d3f..00000000 --- a/examples/uml/duse-mt/src/plugins/umlconcretesyntax/qmlplugin/util.js +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -function findElement(owner, elementName) { - console.log("Procurando " + elementName + " in " + owner.name); - console.log(owner.ownedElements); - var ret; - for (var i = 0; i < owner.ownedElements.length; ++i) { - console.log("Analyzing " + owner.ownedElements[i].name); - ret = findElement(owner.ownedElements[i], elementName); - if (ret != null) - break; - } - if (ret == null && owner.objectName == elementName) - ret = owner; - return ret; -} - -function findQuickItem(parent, objectName) { - var ret = null; - for (var i = 0; i < parent.children.length; ++i) { - ret = findQuickItem(parent.children[i], objectName); - if (ret != null) - break; - } - if (ret == null && parent.objectName == objectName) { - ret = parent; - } - return ret; -} |