Skip to content

Commit

Permalink
Ticket:5610 Implemented IconMap and DiagramMap support
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Aug 14, 2019
1 parent 85d9636 commit 4697192
Show file tree
Hide file tree
Showing 16 changed files with 253 additions and 115 deletions.
16 changes: 4 additions & 12 deletions OMEdit/OMEdit/OMEditGUI/Annotations/BitmapAnnotation.cpp
Expand Up @@ -38,7 +38,7 @@
#include <QMessageBox>

BitmapAnnotation::BitmapAnnotation(QString classFileName, QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
mpComponent = 0;
mClassFileName = classFileName;
Expand All @@ -52,28 +52,20 @@ BitmapAnnotation::BitmapAnnotation(QString classFileName, QString annotation, Gr
}

BitmapAnnotation::BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
: ShapeAnnotation(pParent), mpComponent(pParent)
: ShapeAnnotation(pShapeAnnotation, pParent), mpComponent(pParent)
{
updateShape(pShapeAnnotation);
setPos(mOrigin);
setRotation(mRotation);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

BitmapAnnotation::BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, pShapeAnnotation, 0)
{
mpComponent = 0;
updateShape(pShapeAnnotation);
setShapeFlags(true);
mpGraphicsView->addItem(this);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

/*!
Expand All @@ -84,7 +76,7 @@ BitmapAnnotation::BitmapAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsVi
* \param pGraphicsView
*/
BitmapAnnotation::BitmapAnnotation(QString classFileName, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, 0, 0)
{
mpComponent = 0;
mClassFileName = classFileName;
Expand Down
14 changes: 3 additions & 11 deletions OMEdit/OMEdit/OMEditGUI/Annotations/EllipseAnnotation.cpp
Expand Up @@ -36,7 +36,7 @@
#include "Modeling/Commands.h"

EllipseAnnotation::EllipseAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
// set the default values
GraphicItem::setDefaults();
Expand All @@ -49,27 +49,19 @@ EllipseAnnotation::EllipseAnnotation(QString annotation, GraphicsView *pGraphics
}

EllipseAnnotation::EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(pShapeAnnotation, pParent)
{
updateShape(pShapeAnnotation);
setPos(mOrigin);
setRotation(mRotation);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

EllipseAnnotation::EllipseAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, pShapeAnnotation, 0)
{
updateShape(pShapeAnnotation);
setShapeFlags(true);
mpGraphicsView->addItem(this);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

void EllipseAnnotation::parseShapeAnnotation(QString annotation)
Expand Down
26 changes: 9 additions & 17 deletions OMEdit/OMEdit/OMEditGUI/Annotations/LineAnnotation.cpp
Expand Up @@ -41,7 +41,7 @@
#include <QMessageBox>

LineAnnotation::LineAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
setLineType(LineAnnotation::ShapeType);
setStartComponent(0);
Expand Down Expand Up @@ -69,7 +69,7 @@ LineAnnotation::LineAnnotation(QString annotation, GraphicsView *pGraphicsView)
}

LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(pShapeAnnotation, pParent)
{
updateShape(pShapeAnnotation);
setLineType(LineAnnotation::ComponentType);
Expand All @@ -90,26 +90,18 @@ LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pPa
setActiveState(false);
setPos(mOrigin);
setRotation(mRotation);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, pShapeAnnotation, 0)
{
updateShape(pShapeAnnotation);
setShapeFlags(true);
mpGraphicsView->addItem(this);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

LineAnnotation::LineAnnotation(LineAnnotation::LineType lineType, Component *pStartComponent, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
setFlag(QGraphicsItem::ItemIsSelectable);
mLineType = lineType;
Expand Down Expand Up @@ -177,7 +169,7 @@ LineAnnotation::LineAnnotation(LineAnnotation::LineType lineType, Component *pSt
}

LineAnnotation::LineAnnotation(QString annotation, Component *pStartComponent, Component *pEndComponent, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
setFlag(QGraphicsItem::ItemIsSelectable);
mLineType = LineAnnotation::ConnectionType;
Expand Down Expand Up @@ -217,7 +209,7 @@ LineAnnotation::LineAnnotation(QString annotation, Component *pStartComponent, C

LineAnnotation::LineAnnotation(QString annotation, QString text, Component *pStartComponent, Component *pEndComponent, QString condition,
QString immediate, QString reset, QString synchronize, QString priority, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
setFlag(QGraphicsItem::ItemIsSelectable);
mLineType = LineAnnotation::TransitionType;
Expand Down Expand Up @@ -256,7 +248,7 @@ LineAnnotation::LineAnnotation(QString annotation, QString text, Component *pSta
}

LineAnnotation::LineAnnotation(QString annotation, Component *pComponent, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
setFlag(QGraphicsItem::ItemIsSelectable);
mLineType = LineAnnotation::InitialStateType;
Expand Down Expand Up @@ -295,7 +287,7 @@ LineAnnotation::LineAnnotation(QString annotation, Component *pComponent, Graphi
}

LineAnnotation::LineAnnotation(Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(0, pParent)
{
setLineType(LineAnnotation::ComponentType);
setStartComponent(0);
Expand Down Expand Up @@ -332,7 +324,7 @@ LineAnnotation::LineAnnotation(Component *pParent)
}

LineAnnotation::LineAnnotation(GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, 0, 0)
{
setLineType(LineAnnotation::ShapeType);
setStartComponent(0);
Expand Down
16 changes: 4 additions & 12 deletions OMEdit/OMEdit/OMEditGUI/Annotations/PolygonAnnotation.cpp
Expand Up @@ -36,7 +36,7 @@
#include "Modeling/Commands.h"

PolygonAnnotation::PolygonAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
// set the default values
GraphicItem::setDefaults();
Expand All @@ -49,31 +49,23 @@ PolygonAnnotation::PolygonAnnotation(QString annotation, GraphicsView *pGraphics
}

PolygonAnnotation::PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(pShapeAnnotation, pParent)
{
updateShape(pShapeAnnotation);
setPos(mOrigin);
setRotation(mRotation);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

PolygonAnnotation::PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, pShapeAnnotation, 0)
{
updateShape(pShapeAnnotation);
setShapeFlags(true);
mpGraphicsView->addItem(this);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

PolygonAnnotation::PolygonAnnotation(Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(0, pParent)
{
// set the default values
GraphicItem::setDefaults();
Expand Down
18 changes: 5 additions & 13 deletions OMEdit/OMEdit/OMEditGUI/Annotations/RectangleAnnotation.cpp
Expand Up @@ -36,7 +36,7 @@
#include "Modeling/Commands.h"

RectangleAnnotation::RectangleAnnotation(QString annotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(false, pGraphicsView, 0)
: ShapeAnnotation(false, pGraphicsView, 0, 0)
{
// set the default values
GraphicItem::setDefaults();
Expand All @@ -49,31 +49,23 @@ RectangleAnnotation::RectangleAnnotation(QString annotation, GraphicsView *pGrap
}

RectangleAnnotation::RectangleAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(pShapeAnnotation, pParent)
{
updateShape(pShapeAnnotation);
setPos(mOrigin);
setRotation(mRotation);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

RectangleAnnotation::RectangleAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, pShapeAnnotation, 0)
{
updateShape(pShapeAnnotation);
setShapeFlags(true);
mpGraphicsView->addItem(this);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded()));
connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged()));
connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted()));
}

RectangleAnnotation::RectangleAnnotation(Component *pParent)
: ShapeAnnotation(pParent)
: ShapeAnnotation(0, pParent)
{
// set the default values
GraphicItem::setDefaults();
Expand All @@ -97,7 +89,7 @@ RectangleAnnotation::RectangleAnnotation(Component *pParent)
* \param pGraphicsView
*/
RectangleAnnotation::RectangleAnnotation(GraphicsView *pGraphicsView)
: ShapeAnnotation(true, pGraphicsView, 0)
: ShapeAnnotation(true, pGraphicsView, 0, 0)
{
// set the default values
GraphicItem::setDefaults();
Expand Down

0 comments on commit 4697192

Please sign in to comment.