Index: /branches/OMEdit/OMEditGUI/BitmapAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/BitmapAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/BitmapAnnotation.cpp	(revision 13537)
@@ -35,338 +35,2 @@
 
 #include "BitmapAnnotation.h"
-
-BitmapAnnotation::BitmapAnnotation(QString shape, Component *pParent)
-  : ShapeAnnotation(pParent), mpComponent(pParent)
-{
-  initializeFields();
-  parseShapeAnnotation(shape, mpComponent->getOMCProxy());
-}
-
-BitmapAnnotation::BitmapAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  initializeFields();
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  mFileName = ":/Resources/icons/bitmap-shape.png";
-
-  QFile* file = new QFile(":/Resources/icons/bitmap-shape.png");
-  file->open(QIODevice::ReadOnly);
-  QByteArray image = file->readAll();
-  mImageSource = QString(image.toBase64());
-
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-BitmapAnnotation::BitmapAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mIsCustomShape = true;
-  parseShapeAnnotation(shape, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy());
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-QRectF BitmapAnnotation::boundingRect() const
-{
-  return shape().boundingRect();
-}
-
-QPainterPath BitmapAnnotation::shape() const
-{
-  QPainterPath path;
-  path.addRoundedRect(getBoundingRect(), mCornerRadius, mCornerRadius);
-  return path;
-}
-
-void BitmapAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-
-  if(!mImageSource.isEmpty())
-  {
-    //open file from image source
-    QByteArray data = QByteArray::fromBase64(mImageSource.toLatin1());
-    QImage image;
-    if(image.loadFromData(data))
-      painter->drawImage(getBoundingRect(), image.mirrored());
-  }
-  else
-  {
-    QImage image(mFileName);
-    painter->drawImage(getBoundingRect(), image.mirrored());
-  }
-}
-
-void BitmapAnnotation::addPoint(QPointF point)
-{
-  mExtent.append(point);
-}
-
-void BitmapAnnotation::updatePoint(int index, QPointF point)
-{
-  mExtent.replace(index, point);
-}
-
-void BitmapAnnotation::updateEndPoint(QPointF point)
-{
-  mExtent.back() = point;
-}
-
-void BitmapAnnotation::drawRectangleCornerItems()
-{
-  mIsFinishedCreatingShape = true;
-  for (int i = 0 ; i < this->mExtent.size() ; i++)
-  {
-    QPointF point = this->mExtent.at(i);
-    RectangleCornerItem *rectangleCornerItem = new RectangleCornerItem(point.x(), point.y(), i, this);
-    mRectangleCornerItemsList.append(rectangleCornerItem);
-  }
-  emit updateShapeAnnotation();
-}
-
-QString BitmapAnnotation::getShapeAnnotation()
-{
-  QString annotationString;
-  annotationString.append("Bitmap(");
-
-  if (!mVisible)
-  {
-    annotationString.append("visible=false,");
-  }
-
-  annotationString.append("rotation=").append(QString::number(this->rotation())).append(",");
-
-  annotationString.append("extent={{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).y())).append("},{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).y()));
-  annotationString.append("}}");
-
-  if(mImageSource.isEmpty())
-  {
-    annotationString.append(", fileName=");
-    annotationString.append('"');
-    annotationString.append(mFileName);
-    annotationString.append('"');
-
-    annotationString.append(", imageSource=");
-    annotationString.append('"');
-    annotationString.append('"');
-  }
-  else
-  {
-    annotationString.append(", fileName=");
-    annotationString.append('"');
-    annotationString.append('"');
-
-    annotationString.append(", imageSource=");
-    annotationString.append('"');
-    annotationString.append(mImageSource);
-    annotationString.append('"');
-  }
-
-  annotationString.append(")");
-  return annotationString;
-}
-
-void BitmapAnnotation::setFileName(QString fileName)
-{
-  mFileName = fileName;
-}
-
-void BitmapAnnotation::updateAnnotation()
-{
-  emit updateShapeAnnotation();
-}
-
-void BitmapAnnotation::parseShapeAnnotation(QString shape, OMCProxy *omc)
-{
-  shape = shape.replace("{", "");
-  shape = shape.replace("}", "");
-
-  // parse the shape to get the list of attributes of bitmap.
-  QStringList list = StringHandler::getStrings(shape);
-  //    if (list.size() < 16)
-  //    {
-  //        return;
-  //    }
-
-  // if first item of list is true then the Rectangle should be visible.
-  this->mVisible = static_cast<QString>(list.at(0)).contains("true");
-
-  int index = 0;
-  mOrigin.setX(static_cast<QString>(list.at(1)).toFloat());
-  mOrigin.setY(static_cast<QString>(list.at(2)).toFloat());
-  mRotation = static_cast<QString>(list.at(3)).toFloat();
-  index = 3;
-  // 4,5,6,7 items of the list contains the extent points of rectangle.
-  index = index + 1;
-  qreal x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  qreal y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p1 (x, y);
-  index = index + 1;
-  x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p2 (x, y);
-
-  this->mExtent.append(p1);
-  this->mExtent.append(p2);
-
-  //8 Item contains filename
-  index = index + 1;
-  QString tempFileName = StringHandler::removeFirstLastQuotes(list.at(index));
-  QDir dir(tempFileName);
-
-  if(dir.isAbsolute())
-    this->mFileName = tempFileName;
-  else
-  {
-    if(tempFileName.startsWith("/"))
-      this->mFileName = tempFileName;
-    else
-    {
-      tempFileName.insert(0, QString("/"));
-      this->mFileName = tempFileName;
-    }
-  }
-
-  //If not customshape create absolute path.
-  if(!mIsCustomShape)
-  {
-    QString modelPath = mpComponent->getOMCProxy()->getSourceFile(mpComponent->getClassName());
-    QFileInfo qFile(modelPath);
-    this->mFileName = qFile.absolutePath() + "/" + tempFileName;
-  }
-
-  //9 Item contains imagesource
-  if(tempFileName.isEmpty())
-  {
-    index = index + 1;
-    this->mImageSource = StringHandler::removeFirstLastQuotes(list.at(index));
-  }
-}
-
-void BitmapAnnotation::setImageSource(QString imageSource)
-{
-  mImageSource = imageSource;
-}
-
-QString BitmapAnnotation::getFileName()
-{
-  return mFileName;
-}
-
-//Bitmapwidget declarations...
-
-BitmapWidget::BitmapWidget(BitmapAnnotation *pBitmapShape, MainWindow *parent)
-  : QDialog(parent, Qt::WindowTitleHint)
-{
-  setWindowTitle(QString(Helper::applicationName).append(" - Open bitmap"));
-  setAttribute(Qt::WA_DeleteOnClose);
-  setMaximumSize(175, 150);
-  mpMainWindow = parent;
-  mpBitmapAnnotation = pBitmapShape;
-  setUpForm();
-}
-
-void BitmapWidget::setUpForm()
-{
-  mpBrowseBox = new QLineEdit(tr(""));
-
-  mpBrowseButton = new QPushButton(tr("Browse"));
-  mpBrowseButton->setAutoDefault(true);
-  connect(mpBrowseButton, SIGNAL(clicked()), this, SLOT(browse()));
-
-  mpCheckBox = new QCheckBox("Store picture in model", this);
-
-  mpOkButton = new QPushButton(tr("OK"));
-  mpOkButton->setAutoDefault(false);
-  connect(mpOkButton, SIGNAL(clicked()), this, SLOT(edit()));
-
-  mpCancelButton = new QPushButton(tr("Cancel"));
-  mpCancelButton->setAutoDefault(false);
-  connect(mpCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
-
-  mpButtonBox = new QDialogButtonBox(Qt::Horizontal);
-  mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole);
-  mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);
-
-  QGridLayout *mainLayout = new QGridLayout;
-
-  mainLayout->addWidget(mpBrowseBox, 0, 0);
-  mainLayout->addWidget(mpBrowseButton, 0, 1);
-  mainLayout->addWidget(mpCheckBox, 2, 0);
-  mainLayout->addWidget(mpButtonBox, 3, 0);
-
-  setLayout(mainLayout);
-}
-
-void BitmapWidget::edit()
-{
-  if(!(mpBrowseBox->text().endsWith("png") || mpBrowseBox->text().endsWith("bmp") || mpBrowseBox->text().endsWith("jpg")))
-  {
-    QMessageBox *msgBox = new QMessageBox(mpMainWindow);
-    msgBox->setWindowTitle(QString(Helper::applicationName));
-    msgBox->setIcon(QMessageBox::Critical);
-    msgBox->setText(QString("Unknown file format"));
-    msgBox->setStandardButtons(QMessageBox::Ok);
-    msgBox->setDefaultButton(QMessageBox::Ok);
-    int answer = msgBox->exec();
-    return;
-  }
-
-  //Set file name as picture path relative to model directory...
-  QString modelPath = mpMainWindow->getModelWidgetContainer()->getCurrentModelWidget()->getLibraryTreeNode()->getFileName();
-  QFileInfo qfile(modelPath);
-  QDir dir(qfile.absolutePath());
-  QString relativePath;
-  relativePath = dir.relativeFilePath(mpBrowseBox->text());
-  mpBitmapAnnotation->setFileName("/" + relativePath);
-
-  if(!dir.exists(relativePath))
-  {
-    QMessageBox *msgBox = new QMessageBox(mpMainWindow);
-    msgBox->setWindowTitle(QString(Helper::applicationName));
-    msgBox->setIcon(QMessageBox::Critical);
-    msgBox->setText(QString("File doesn't exist"));
-    msgBox->setStandardButtons(QMessageBox::Ok);
-    msgBox->setDefaultButton(QMessageBox::Ok);
-    msgBox->exec();
-  }
-
-  //Store imageSource base64 of the image if checked
-  if(mpCheckBox->isChecked())
-  {
-    QFile* file = new QFile(mpBrowseBox->text());
-    file->open(QIODevice::ReadOnly);
-    QByteArray image = file->readAll();
-    QString imageSource = QString(image.toBase64());
-
-    mpBitmapAnnotation->setImageSource(imageSource);
-  }
-  else
-    mpBitmapAnnotation->setImageSource("");
-
-  accept();
-  mpBitmapAnnotation->updateAnnotation();
-}
-
-void BitmapWidget::show()
-{
-  setVisible(true);
-}
-
-void BitmapWidget::browse()
-{
-  QString name = QFileDialog::getOpenFileName(this, tr("Open Image"),
-                                              QDir::currentPath() + QString("/../.."),
-                                              tr("Image Files (*.png *.bmp *.jpg)"));
-  mpBrowseBox->setText(name);
-}
Index: /branches/OMEdit/OMEditGUI/BitmapAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/BitmapAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/BitmapAnnotation.h	(revision 13537)
@@ -42,56 +42,3 @@
 class OMCProxy;
 
-class  BitmapAnnotation : public ShapeAnnotation
-{
-  Q_OBJECT
-public:
-  BitmapAnnotation(QString shape, Component *pParent);
-  BitmapAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  BitmapAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  QRectF boundingRect() const;
-  QPainterPath shape() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  void addPoint(QPointF point);
-  void updateEndPoint(QPointF point);
-  void drawRectangleCornerItems();
-  QString getShapeAnnotation();
-  void parseShapeAnnotation(QString shape, OMCProxy *omc);
-  void setFileName(QString fileName);
-  void updateAnnotation();
-  void setImageSource(QString imageSource);
-  QString getFileName();
-
-  Component *mpComponent;
-private:
-  QString mFileName;
-  QString mImageSource;
-public slots:
-  void updatePoint(int index, QPointF point);
-};
-
-//! @brief The popup when you create a bitmap shape
-
-class BitmapWidget : public QDialog
-{
-  Q_OBJECT
-public:
-  BitmapWidget(BitmapAnnotation *pBitmapShape, MainWindow *parent);
-
-  void setUpForm();
-  void show();
-
-  MainWindow *mpMainWindow;
-private:
-  QLineEdit *mpBrowseBox;
-  QPushButton *mpBrowseButton;
-  QPushButton *mpOkButton;
-  QPushButton *mpCancelButton;
-  QDialogButtonBox *mpButtonBox;
-  QCheckBox *mpCheckBox;
-  BitmapAnnotation *mpBitmapAnnotation;
-public slots:
-  void edit();
-  void browse();
-};
-
 #endif // BITMAPANNOTATION_H
Index: /branches/OMEdit/OMEditGUI/Component.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/Component.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/Component.cpp	(revision 13537)
@@ -36,6 +36,6 @@
 #include "Component.h"
 
-Component_OMC::Component_OMC(QString annotation, QString name, QString className, StringHandler::ModelicaClasses type, QString transformation,
-                             QPointF position, OMCProxy *pOMCProxy, GraphicsView *pGraphicsView, Component_OMC *pParent)
+Component::Component(QString annotation, QString name, QString className, StringHandler::ModelicaClasses type, QString transformation,
+                             QPointF position, OMCProxy *pOMCProxy, GraphicsView *pGraphicsView, Component *pParent)
   : QGraphicsItem(pParent), mName(name), mClassName(className), mType(type), mpOMCProxy(pOMCProxy), mpGraphicsView(pGraphicsView),
     mpParentComponent(pParent)
@@ -67,9 +67,9 @@
   // if type is connector and component is not a library component.
   if (mType == StringHandler::CONNECTOR && !isLibraryComponent())
-    connect(this, SIGNAL(componentClicked(Component_OMC*)), mpGraphicsView, SLOT(addConnection(Component_OMC*)));
+    connect(this, SIGNAL(componentClicked(Component*)), mpGraphicsView, SLOT(addConnection(Component*)));
 }
 
 /* Called for inheritance annotation instance */
-Component_OMC::Component_OMC(QString annotation, QString className, StringHandler::ModelicaClasses type, Component_OMC *pParent)
+Component::Component(QString annotation, QString className, StringHandler::ModelicaClasses type, Component *pParent)
   : QGraphicsItem(pParent), mName(""), mClassName(className), mType(type), mpParentComponent(pParent)
 {
@@ -85,10 +85,10 @@
   // if type is connector and component is not a library component.
   if (mType == StringHandler::CONNECTOR && !isLibraryComponent() && mpParentComponent->getType() != StringHandler::CONNECTOR)
-    connect(this, SIGNAL(componentClicked(Component_OMC*)), mpGraphicsView, SLOT(addConnection(Component_OMC*)));
+    connect(this, SIGNAL(componentClicked(Component*)), mpGraphicsView, SLOT(addConnection(Component*)));
 }
 
 /* Called for component annotation instance */
-Component_OMC::Component_OMC(QString annotation, QString transformationString, ComponentInfo *pComponentInfo,
-                             StringHandler::ModelicaClasses type, Component_OMC *pParent)
+Component::Component(QString annotation, QString transformationString, ComponentInfo *pComponentInfo,
+                             StringHandler::ModelicaClasses type, Component *pParent)
   : QGraphicsItem(pParent), mpComponentInfo(pComponentInfo), mType(type), mpParentComponent(pParent)
 {
@@ -107,9 +107,9 @@
   // if type is connector and component is not a library component.
   if (mType == StringHandler::CONNECTOR && !isLibraryComponent() && mpParentComponent->getType() != StringHandler::CONNECTOR)
-    connect(this, SIGNAL(componentClicked(Component_OMC*)), mpGraphicsView, SLOT(addConnection(Component_OMC*)));
+    connect(this, SIGNAL(componentClicked(Component*)), mpGraphicsView, SLOT(addConnection(Component*)));
 }
 
 /* Used for Library Component */
-Component_OMC::Component_OMC(QString annotation, QString className, OMCProxy *pOMCProxy, Component_OMC *pParent)
+Component::Component(QString annotation, QString className, OMCProxy *pOMCProxy, Component *pParent)
   : QGraphicsItem(pParent), mName(className), mClassName(className), mpParentComponent(pParent)
 {
@@ -127,5 +127,5 @@
 }
 
-void Component_OMC::initialize()
+void Component::initialize()
 {
   mVisible = true;
@@ -163,10 +163,10 @@
 }
 
-bool Component_OMC::isLibraryComponent()
+bool Component::isLibraryComponent()
 {
   return mIsLibraryComponent;
 }
 
-void Component_OMC::getClassInheritedComponents(bool isRootComponent)
+void Component::getClassInheritedComponents(bool isRootComponent)
 {
   // read the component inheritance
@@ -191,11 +191,11 @@
     else
       annotationString = mpOMCProxy->getIconAnnotation(inheritedClass);
-    Component_OMC *pInheritedComponent;
-    pInheritedComponent  = new Component_OMC(annotationString, inheritedClass, isConnector, this);
+    Component *pInheritedComponent;
+    pInheritedComponent  = new Component(annotationString, inheritedClass, isConnector, this);
     mpInheritanceList.append(pInheritedComponent);
   }
 }
 
-void Component_OMC::parseAnnotationString(QString annotation)
+void Component::parseAnnotationString(QString annotation)
 {
   // parse the annotation string
@@ -236,5 +236,5 @@
       shape = shape.mid(QString("Line").length());
       shape = StringHandler::removeFirstLastBrackets(shape);
-      LineAnnotation_OMC *pLineAnnotation = new LineAnnotation_OMC(shape, this);
+      LineAnnotation *pLineAnnotation = new LineAnnotation(shape, this);
       mpShapesList.append(pLineAnnotation);
     }
@@ -243,5 +243,5 @@
       shape = shape.mid(QString("Polygon").length());
       shape = StringHandler::removeFirstLastBrackets(shape);
-      PolygonAnnotation_OMC *pPolygonAnnotation = new PolygonAnnotation_OMC(shape, this);
+      PolygonAnnotation *pPolygonAnnotation = new PolygonAnnotation(shape, this);
       mpShapesList.append(pPolygonAnnotation);
     }
@@ -250,5 +250,5 @@
       shape = shape.mid(QString("Rectangle").length());
       shape = StringHandler::removeFirstLastBrackets(shape);
-      RectangleAnnotation_OMC *pRectangleAnnotation = new RectangleAnnotation_OMC(shape, this);
+      RectangleAnnotation *pRectangleAnnotation = new RectangleAnnotation(shape, this);
       mpShapesList.append(pRectangleAnnotation);
     }
@@ -257,5 +257,5 @@
       shape = shape.mid(QString("Ellipse").length());
       shape = StringHandler::removeFirstLastBrackets(shape);
-      EllipseAnnotation_OMC *pEllipseAnnotation = new EllipseAnnotation_OMC(shape, this);
+      EllipseAnnotation *pEllipseAnnotation = new EllipseAnnotation(shape, this);
       mpShapesList.append(pEllipseAnnotation);
     }
@@ -268,5 +268,5 @@
         shape = shape.mid(QString("Text").length());
         shape = StringHandler::removeFirstLastBrackets(shape);
-        TextAnnotation_OMC *pTextAnnotation = new TextAnnotation_OMC(shape, this);
+        TextAnnotation *pTextAnnotation = new TextAnnotation(shape, this);
         mpShapesList.append(pTextAnnotation);
       }
@@ -282,7 +282,7 @@
 }
 
-void Component_OMC::getClassComponents()
-{
-  foreach (Component_OMC *pInheritedComponent, mpInheritanceList)
+void Component::getClassComponents()
+{
+  foreach (Component *pInheritedComponent, mpInheritanceList)
   {
     pInheritedComponent->getClassComponents();
@@ -310,5 +310,5 @@
       {
         QString result = mpOMCProxy->getIconAnnotation(pComponentInfo->getClassName());
-        Component_OMC *pComponent = new Component_OMC(result, componentsAnnotations.at(i), pComponentInfo, StringHandler::CONNECTOR,
+        Component *pComponent = new Component(result, componentsAnnotations.at(i), pComponentInfo, StringHandler::CONNECTOR,
                                                       getRootParentComponent());
         mpComponentsList.append(pComponent);
@@ -319,5 +319,5 @@
 }
 
-void Component_OMC::createActions()
+void Component::createActions()
 {
   // Properties Action
@@ -331,5 +331,5 @@
 }
 
-void Component_OMC::createResizerItems()
+void Component::createResizerItems()
 {
   qreal x1, y1, x2, y2;
@@ -369,5 +369,5 @@
 }
 
-void Component_OMC::getResizerItemsPositions(qreal *x1, qreal *y1, qreal *x2, qreal *y2)
+void Component::getResizerItemsPositions(qreal *x1, qreal *y1, qreal *x2, qreal *y2)
 {
   qreal x11, y11, x22, y22;
@@ -395,5 +395,5 @@
 }
 
-void Component_OMC::showResizerItems()
+void Component::showResizerItems()
 {
   qreal x1, y1, x2, y2;
@@ -413,5 +413,5 @@
 }
 
-void Component_OMC::hideResizerItems()
+void Component::hideResizerItems()
 {
   mpBottomLeftResizerItem->setPassive();
@@ -421,5 +421,5 @@
 }
 
-QRectF Component_OMC::boundingRect() const
+QRectF Component::boundingRect() const
 {
   qreal left = mpCoOrdinateSystem->getExtent().at(0).x();
@@ -430,5 +430,5 @@
 }
 
-void Component_OMC::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void Component::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
   Q_UNUSED(painter);
@@ -437,37 +437,37 @@
 }
 
-QString Component_OMC::getName()
+QString Component::getName()
 {
   return mName;
 }
 
-QString Component_OMC::getClassName()
+QString Component::getClassName()
 {
   return mClassName;
 }
 
-StringHandler::ModelicaClasses Component_OMC::getType()
+StringHandler::ModelicaClasses Component::getType()
 {
   return mType;
 }
 
-OMCProxy* Component_OMC::getOMCProxy()
+OMCProxy* Component::getOMCProxy()
 {
   return mpOMCProxy;
 }
 
-GraphicsView* Component_OMC::getGraphicsView()
+GraphicsView* Component::getGraphicsView()
 {
   return mpGraphicsView;
 }
 
-Component_OMC* Component_OMC::getParentComponent()
+Component* Component::getParentComponent()
 {
   return mpParentComponent;
 }
 
-Component_OMC* Component_OMC::getRootParentComponent()
-{
-  Component_OMC *pComponent;
+Component* Component::getRootParentComponent()
+{
+  Component *pComponent;
   pComponent = this;
   while (pComponent->mpParentComponent)
@@ -476,45 +476,45 @@
 }
 
-Transformation* Component_OMC::getTransformation()
+Transformation* Component::getTransformation()
 {
   return mpTransformation;
 }
 
-QList<Component_OMC*> Component_OMC::getInheritanceList()
+QList<Component*> Component::getInheritanceList()
 {
   return mpInheritanceList;
 }
 
-ComponentInfo* Component_OMC::getComponentInfo()
+ComponentInfo* Component::getComponentInfo()
 {
   return mpComponentInfo;
 }
 
-QList<ShapeAnnotation_OMC*> Component_OMC::getShapesList()
+QList<ShapeAnnotation*> Component::getShapesList()
 {
   return mpShapesList;
 }
 
-QList<Component_OMC*> Component_OMC::getComponentsList()
+QList<Component*> Component::getComponentsList()
 {
   return mpComponentsList;
 }
 
-void Component_OMC::setOldPosition(QPointF oldPosition)
+void Component::setOldPosition(QPointF oldPosition)
 {
   mOldPosition = oldPosition;
 }
 
-QPointF Component_OMC::getOldPosition()
+QPointF Component::getOldPosition()
 {
   return mOldPosition;
 }
 
-void Component_OMC::setMousePressed(bool On)
+void Component::setMousePressed(bool On)
 {
   mIsMousePressed = On;
 }
 
-void Component_OMC::setComponentFlags()
+void Component::setComponentFlags()
 {
   // set the item flags
@@ -527,5 +527,5 @@
 }
 
-void Component_OMC::unsetComponentFlags()
+void Component::unsetComponentFlags()
 {
   // unset the item flags
@@ -538,5 +538,5 @@
 }
 
-void Component_OMC::getExtents(QPointF *pExtent1, QPointF *pExtent2)
+void Component::getExtents(QPointF *pExtent1, QPointF *pExtent2)
 {
   qreal x1, y1, x2, y2;
@@ -568,5 +568,5 @@
 }
 
-QString Component_OMC::getTransformationAnnotationString()
+QString Component::getTransformationAnnotationString()
 {
   QString annotationString;
@@ -590,5 +590,5 @@
 }
 
-QString Component_OMC::getPlacementAnnotation()
+QString Component::getPlacementAnnotation()
 {
   // create the placement annotation string
@@ -600,6 +600,6 @@
     {
       // first get the component from diagram view and get the transformations
-      Component_OMC *pComponent;
-      pComponent = mpGraphicsView->getModelWidget()->getDiagramGraphicsView()->getComponent_OMCObject(getName());
+      Component *pComponent;
+      pComponent = mpGraphicsView->getModelWidget()->getDiagramGraphicsView()->getComponentObject(getName());
       if (pComponent)
         placementAnnotationString.append(", ").append(pComponent->getTransformationAnnotationString());
@@ -612,6 +612,6 @@
       placementAnnotationString.append(", ").append(getTransformationAnnotationString());
       // then get the icon transformations
-      Component_OMC *pComponent;
-      pComponent = mpGraphicsView->getModelWidget()->getIconGraphicsView()->getComponent_OMCObject(getName());
+      Component *pComponent;
+      pComponent = mpGraphicsView->getModelWidget()->getIconGraphicsView()->getComponentObject(getName());
       if (pComponent)
         placementAnnotationString.append(", ").append(pComponent->getTransformationAnnotationString());
@@ -626,5 +626,5 @@
 }
 
-void Component_OMC::updatePlacementAnnotation()
+void Component::updatePlacementAnnotation()
 {
   // Add component annotation.
@@ -636,5 +636,5 @@
 }
 
-void Component_OMC::applyRotation(qreal angle)
+void Component::applyRotation(qreal angle)
 {
   mpTransformation->setRotateAngle(angle);
@@ -646,5 +646,5 @@
 }
 
-void Component_OMC::addConnectionDetails(LineAnnotation_OMC *pConnectorLineAnnotation)
+void Component::addConnectionDetails(LineAnnotation *pConnectorLineAnnotation)
 {
   // handle component position, rotation and scale changes
@@ -659,10 +659,10 @@
 }
 
-void Component_OMC::updateConnection()
+void Component::updateConnection()
 {
   emit componentTransformHasChanged();
 }
 
-void Component_OMC::prepareResizeShape(ResizerItem *pResizerItem)
+void Component::prepareResizeShape(ResizerItem *pResizerItem)
 {
   hideResizerItems();
@@ -699,5 +699,5 @@
 }
 
-void Component_OMC::resizeShape(int index, QPointF newPosition)
+void Component::resizeShape(int index, QPointF newPosition)
 {
   Q_UNUSED(index);
@@ -741,5 +741,5 @@
 }
 
-void Component_OMC::finishResizeShape()
+void Component::finishResizeShape()
 {
   qreal x1, y1, x2, y2;
@@ -813,5 +813,5 @@
 }
 
-void Component_OMC::updateShapePosition()
+void Component::updateShapePosition()
 {
   // update the placement annotation of the component
@@ -820,8 +820,8 @@
 }
 
-void Component_OMC::deleteMe()
+void Component::deleteMe()
 {
   // delete the component from model
-  mpGraphicsView->deleteComponent_OMCObject(this);
+  mpGraphicsView->deleteComponentObject(this);
   // remove the component from the scene
   mpGraphicsView->scene()->removeItem(this);
@@ -831,5 +831,5 @@
 }
 
-void Component_OMC::rotateClockwise()
+void Component::rotateClockwise()
 {
   qreal oldRotation = mpTransformation->getRotateAngle();
@@ -845,5 +845,5 @@
 }
 
-void Component_OMC::rotateAntiClockwise()
+void Component::rotateAntiClockwise()
 {
   qreal oldRotation = mpTransformation->getRotateAngle();
@@ -863,5 +863,5 @@
 //! @see moveLeft()
 //! @see moveRight()
-void Component_OMC::moveUp()
+void Component::moveUp()
 {
   mpTransformation->setOrigin(QPointF(mpTransformation->getOrigin().x(), mpTransformation->getOrigin().y() + 1));
@@ -876,5 +876,5 @@
 //! @see moveLeft()
 //! @see moveRight()
-void Component_OMC::moveDown()
+void Component::moveDown()
 {
   mpTransformation->setOrigin(QPointF(mpTransformation->getOrigin().x(), mpTransformation->getOrigin().y() - 1));
@@ -889,5 +889,5 @@
 //! @see moveDown()
 //! @see moveRight()
-void Component_OMC::moveLeft()
+void Component::moveLeft()
 {
   mpTransformation->setOrigin(QPointF(mpTransformation->getOrigin().x() - 1, mpTransformation->getOrigin().y()));
@@ -902,5 +902,5 @@
 //! @see moveDown()
 //! @see moveLeft()
-void Component_OMC::moveRight()
+void Component::moveRight()
 {
   mpTransformation->setOrigin(QPointF(mpTransformation->getOrigin().x() + 1, mpTransformation->getOrigin().y()));
@@ -911,5 +911,5 @@
 }
 
-void Component_OMC::mousePressEvent(QGraphicsSceneMouseEvent *event)
+void Component::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
   // if user is viewing the component in Icon View
@@ -937,5 +937,5 @@
 
 //! Event when mouse cursor enters component icon.
-void Component_OMC::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
+void Component::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
 {
   Q_UNUSED(event);
@@ -946,5 +946,5 @@
 
 //! Event when mouse cursor leaves component icon.
-void Component_OMC::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
+void Component::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
 {
   Q_UNUSED(event);
@@ -954,5 +954,5 @@
 }
 
-void Component_OMC::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
+void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
 {
   // if we are viewing some readonly component then don't show the contextmenu
@@ -960,5 +960,5 @@
     return;
   setSelected(true);
-  Component_OMC *pComponent = getRootParentComponent();
+  Component *pComponent = getRootParentComponent();
   QMenu menu(mpGraphicsView);
   menu.icon();
@@ -973,5 +973,5 @@
 }
 
-QVariant Component_OMC::itemChange(GraphicsItemChange change, const QVariant &value)
+QVariant Component::itemChange(GraphicsItemChange change, const QVariant &value)
 {
   QGraphicsItem::itemChange(change, value);
@@ -1057,1058 +1057,4 @@
 }
 
-
-
-
-
-
-
-
-
-
-Component::Component(QString value, QString name, QString className, QString transformationString, QPointF position, bool connector,
-                     OMCProxy *omc, GraphicsView *graphicsView, Component *pParent)
-  : ShapeAnnotation(graphicsView, pParent), mAnnotationString(value), mName(name), mClassName(className),
-    mTransformationString(transformationString), mIsConnector(connector), mpOMCProxy(omc), mpGraphicsView(graphicsView)
-{
-  mIsLibraryComponent = false;
-  mpParentComponent = pParent;
-  initialize();
-  mpTransformation->parseTransformationString(transformationString, boundingRect().width(), boundingRect().height());
-  if (transformationString.isEmpty())
-  {
-    mpTransformation->setOrigin(position);
-    mpTransformation->setExtent1(QPointF(mInitialScale * mRectangle.left(), mInitialScale * mRectangle.top()));
-    mpTransformation->setExtent2(QPointF(mInitialScale * mRectangle.right(), mInitialScale * mRectangle.bottom()));
-    mpTransformation->setRotateAngle(0.0);
-  }
-  setTransform(mpTransformation->getTransformationMatrix());
-  if (mpGraphicsView->getModelWidget()->getLibraryTreeNode()->isReadOnly())
-  {
-    getClassInheritedComponents();
-    parseAnnotationString(value);
-    getClassComponents();
-  }
-  else
-  {
-    setComponentFlags();
-    setAcceptHoverEvents(true);
-    getClassInheritedComponents();
-    parseAnnotationString(value);
-    getClassComponents();
-    createResizerItems();
-    createActions();
-  }
-  // if everything is fine with icon then add it to scene
-  mpGraphicsView->scene()->addItem(this);
-  // if type is diagram then allow connections not for icon view
-  if (mIsConnector && !isLibraryComponent())
-    connect(this, SIGNAL(componentClicked(Component*)), mpGraphicsView, SLOT(addConnector(Component*)));
-}
-
-/* Called for inheritance annotation instance */
-Component::Component(QString value, QString className, bool connector, Component *pParent)
-  : ShapeAnnotation(pParent), mAnnotationString(value), mClassName(className), mIsConnector(connector)
-{
-  mpParentComponent = pParent;
-  mIsLibraryComponent = mpParentComponent->isLibraryComponent() ? true : false;
-  mpOMCProxy = pParent->mpOMCProxy;
-  mpComponentProperties = 0;
-  mpTransformation = 0;
-  mpGraphicsView = isLibraryComponent() ? 0 : pParent->mpGraphicsView;
-  initialize();
-  getClassInheritedComponents();
-  parseAnnotationString(mAnnotationString);
-}
-
-/* Called for component annotation instance */
-Component::Component(QString value, QString transformationString, ComponentInfo *pComponentInfo, bool connector,
-                     Component *pParent)
-  : ShapeAnnotation(pParent), mAnnotationString(value), mTransformationString(transformationString),
-    mpComponentProperties(pComponentInfo), mIsConnector(connector)
-{
-  mName = mpComponentProperties->getName();
-  mClassName = mpComponentProperties->getClassName();
-  mpParentComponent = pParent;
-  mIsLibraryComponent = mpParentComponent->isLibraryComponent() ? true : false;
-  mpOMCProxy = pParent->mpOMCProxy;
-  mpGraphicsView = isLibraryComponent() ? 0 : pParent->mpGraphicsView;
-  initialize();
-  parseAnnotationString(mAnnotationString);
-  mpTransformation->parseTransformationString(transformationString, boundingRect().width(), boundingRect().height());
-  setTransform(mpTransformation->getTransformationMatrix());
-  // if is connector then allow connections
-  if (mIsConnector && !isLibraryComponent())
-    connect(this, SIGNAL(componentClicked(Component*)), mpGraphicsView, SLOT(addConnector(Component*)));
-}
-
-/* Used for Library Component */
-Component::Component(QString value, QString className, bool connector, OMCProxy *omc, Component *pParent)
-  : ShapeAnnotation(pParent), mAnnotationString(value), mClassName(className), mIsConnector(connector), mpOMCProxy(omc)
-{
-  mIsLibraryComponent = true;
-  mpParentComponent = pParent;
-  mpComponentProperties = 0;
-  // parse the annotation string
-  initialize();
-  getClassInheritedComponents();
-  parseAnnotationString(value);
-  getClassComponents();
-}
-
-Component::Component(Component *pComponent, QString name, QString transformationString, QPointF position, bool connector,
-                     GraphicsView *graphicsView, Component *pParent)
-  : ShapeAnnotation(graphicsView, pParent), mName(name), mTransformationString(transformationString), mIsConnector(connector),
-    mpGraphicsView(graphicsView)
-{
-  mIsLibraryComponent = false;
-  mpParentComponent = pParent;
-  mClassName = pComponent->mClassName;
-  mpOMCProxy = mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy();
-  mAnnotationString = pComponent->mAnnotationString;
-  // Assing the Graphics View of this component to passed component. In order to avoid exceptions
-  pComponent->mpGraphicsView = mpGraphicsView;
-  initialize();
-  mpTransformation->parseTransformationString(transformationString, boundingRect().width(), boundingRect().height());
-  if (transformationString.isEmpty())
-  {
-    mpTransformation->setOrigin(position);
-    mpTransformation->setExtent1(QPointF(mInitialScale * mRectangle.left(), mInitialScale * mRectangle.top()));
-    mpTransformation->setExtent2(QPointF(mInitialScale * mRectangle.right(), mInitialScale * mRectangle.bottom()));
-    mpTransformation->setRotateAngle(0.0);
-  }
-  setTransform(mpTransformation->getTransformationMatrix());
-  mpChildComponentInfo = pComponent->mpChildComponentInfo;
-  if (mpGraphicsView->getModelWidget()->getLibraryTreeNode()->isReadOnly())
-  {
-    copyClassInheritedComponents(pComponent);
-    parseAnnotationString(mAnnotationString);
-    copyClassComponents(pComponent);
-  }
-  else
-  {
-    setComponentFlags();
-    setAcceptHoverEvents(true);
-    copyClassInheritedComponents(pComponent);
-    parseAnnotationString(mAnnotationString);
-    copyClassComponents(pComponent);
-    createResizerItems();
-    createActions();
-    mpGraphicsView->scene()->clearSelection();
-    setSelected(true);
-  }
-  // if everything is fine with icon then add it to scene
-  mpGraphicsView->scene()->addItem(this);
-  // if type is diagram then allow connections not for icon view
-  if (mIsConnector && !isLibraryComponent())
-    connect(this, SIGNAL(componentClicked(Component*)), mpGraphicsView, SLOT(addConnector(Component*)));
-}
-
-Component::~Component()
-{
-  // delete all the list of shapes
-  foreach(ShapeAnnotation *shape, mpShapesList)
-  {
-    delete shape;
-  }
-
-  //    // delete the list of all components
-  //    foreach(Component *component, mpComponentsList)
-  //        delete component;
-
-  //    // delete the list of all inherited components
-  //    foreach(Component *component, mpInheritanceList)
-  //        delete component;
-}
-
-bool Component::getIsConnector()
-{
-  return mIsConnector;
-}
-
-void Component::initialize()
-{
-  mRectangle = QRectF (-100, -100, 200, 200);
-  mPreserveAspectRatio = true;
-  mInitialScale = 0.1;
-  mGrid.append(2.0);
-  mGrid.append(2.0);
-}
-
-//! Parses the result of getIconAnnotation command.
-//! @param value is the result of getIconAnnotation command obtained from OMC.
-bool Component::parseAnnotationString(QString value)
-{
-  foreach(ShapeAnnotation *shape, mpShapesList)
-  {
-    mpShapesList.removeOne(shape);
-    delete shape;
-  }
-  // parse the annotation string
-  value = StringHandler::removeFirstLastCurlBrackets(value);
-  if (value.isEmpty())
-  {
-    return false;
-  }
-  QStringList list = StringHandler::getStrings(value);
-  if (list.size() < 9)
-    return false;
-  // read the coordinate system
-  qreal x1, x2, y1, y2, width, height;
-  x1 = static_cast<QString>(list.at(0)).toFloat();
-  y1 = static_cast<QString>(list.at(1)).toFloat();
-  x2 = static_cast<QString>(list.at(2)).toFloat();
-  y2 = static_cast<QString>(list.at(3)).toFloat();
-  width = fabs(x1 - x2);
-  height = fabs(y1 - y2);
-  mRectangle = QRectF (x1, y1, width, height);
-  // if the list is less that 5 then return
-  if (list.size() < 5)
-    return true;
-  // read aspectratio, scale, grid and shapes
-  QStringList shapesList;
-  mPreserveAspectRatio = static_cast<QString>(list.at(4)).contains("true");
-  mInitialScale = static_cast<QString>(list.at(5)).toFloat();
-  mGrid.append(static_cast<QString>(list.at(6)).toFloat());
-  mGrid.append(static_cast<QString>(list.at(7)).toFloat());
-  shapesList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(8)), '(', ')');
-  // Now parse the shapes available in list
-  foreach (QString shape, shapesList)
-  {
-    shape = StringHandler::removeFirstLastCurlBrackets(shape);
-    if (shape.startsWith("Line"))
-    {
-      shape = shape.mid(QString("Line").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      LineAnnotation *lineAnnotation = new LineAnnotation(shape, this);
-      mpShapesList.append(lineAnnotation);
-    }
-    if (shape.startsWith("Polygon"))
-    {
-      shape = shape.mid(QString("Polygon").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      PolygonAnnotation *polygonAnnotation = new PolygonAnnotation(shape, this);
-      mpShapesList.append(polygonAnnotation);
-    }
-    if (shape.startsWith("Rectangle"))
-    {
-      shape = shape.mid(QString("Rectangle").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      RectangleAnnotation *rectangleAnnotation = new RectangleAnnotation(shape, this);
-      mpShapesList.append(rectangleAnnotation);
-    }
-    if (shape.startsWith("Ellipse"))
-    {
-      shape = shape.mid(QString("Ellipse").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      EllipseAnnotation *ellipseAnnotation = new EllipseAnnotation(shape, this);
-      mpShapesList.append(ellipseAnnotation);
-    }
-    // don't parse the text annotation for library icon
-    //! @todo We don't show text for Library Icons.
-    if (!isLibraryComponent())
-    {
-      if (shape.startsWith("Text"))
-      {
-        shape = shape.mid(QString("Text").length());
-        shape = StringHandler::removeFirstLastBrackets(shape);
-        TextAnnotation *textAnnotation = new TextAnnotation(shape, this);
-        mpShapesList.append(textAnnotation);
-      }
-    }
-    if (shape.startsWith("Bitmap"))
-    {
-      shape = shape.mid(QString("Bitmap").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      BitmapAnnotation *bitmapAnnotation = new BitmapAnnotation(shape, this);
-      mpShapesList.append(bitmapAnnotation);
-    }
-  }
-}
-
-QRectF Component::boundingRect() const
-{
-  return mRectangle;
-}
-
-void Component::createActions()
-{
-  // Icon Attributes Action
-  mpIconAttributesAction = new QAction(tr("Attributes"), mpGraphicsView);
-  mpIconAttributesAction->setStatusTip(tr("Shows the item attributes"));
-  connect(mpIconAttributesAction, SIGNAL(triggered()), SLOT(openIconAttributes()));
-  // Icon Properties Action
-  mpIconPropertiesAction = new QAction(QIcon(":/Resources/icons/tool.png"), tr("Properties"), mpGraphicsView);
-  mpIconPropertiesAction->setStatusTip(tr("Shows the item properties"));
-  connect(mpIconPropertiesAction, SIGNAL(triggered()), SLOT(openIconProperties()));
-}
-
-void Component::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  //Q_UNUSED(painter);
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-  //painter->drawRect(boundingRect());
-}
-
-void Component::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
-  MainWindow *pMainWindow = mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow();
-  // if user is viewing the component in Icon View
-  if ((mpGraphicsView->getViewType() == StringHandler::ICON) or (mpGraphicsView->getModelWidget()->getLibraryTreeNode()->isReadOnly()))
-    return;
-
-  // if component is a connector type then emit the componentClicked signal
-  if (event->button() == Qt::LeftButton  && pMainWindow->getConnectModeAction()->isChecked() && mIsConnector)
-  {
-    emit componentClicked(this);
-  }
-
-  // if we are creating the connector then make sure user can not select and move components
-  if ((mpGraphicsView->isCreatingConnection()) and !mpParentComponent)
-  {
-    unsetComponentFlags();
-    return;
-  }
-  // if user not creating connector then check if the item flags are active or not
-  else if (!mpParentComponent)
-  {
-    setComponentFlags();
-  }
-
-  // call the mouse press event only if component is the root component
-//  if (!mpParentComponent)
-//  {
-//    QGraphicsItem::mousePressEvent(event);
-//  }
-  QGraphicsItem::mousePressEvent(event);
-}
-
-void Component::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
-  QGraphicsItem::mouseReleaseEvent(event);
-}
-
-//! Event when mouse cursor enters component icon.
-void Component::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
-{
-  Q_UNUSED(event);
-  // if we are creating the connector then don't show selection box on hover events
-  if (mpGraphicsView->isCreatingConnection())
-    return;
-  if (!isSelected())
-    setResizerItemsHover();
-}
-
-//! Event when mouse cursor leaves component icon.
-void Component::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
-{
-  Q_UNUSED(event);
-  if(!isSelected())
-    hideResizerItems();
-}
-
-void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
-{
-  // if we are viewing some readonly component then don't show the contextmenu
-  if (mpGraphicsView->getModelWidget()->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  // get the root component, it could be either icon or diagram
-  setSelected(true);
-  Component *pComponent = getRootParentComponent();
-  QMenu menu(pComponent->mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-  menu.addAction(pComponent->mpGraphicsView->mpRotateIconAction);
-  menu.addAction(pComponent->mpGraphicsView->mpRotateAntiIconAction);
-  menu.addAction(pComponent->mpGraphicsView->mpResetRotation);
-  //menu.addAction(pComponent->mpGraphicsView->mpHorizontalFlipAction);
-  //menu.addAction(pComponent->mpGraphicsView->mpVerticalFlipAction);
-  menu.addSeparator();
-  menu.addAction(pComponent->mpGraphicsView->mpDeleteIconAction);
-  //menu.addAction(pComponent->mpGraphicsView->mpCopyComponentAction);
-//  if (pComponent->mType == StringHandler::ICON)
-//  {
-//    menu.addSeparator();
-//    menu.addAction(pComponent->mpIconAttributesAction);
-//    menu.addAction(pComponent->mpIconPropertiesAction);
-//    menu.addSeparator();
-//    //    if(mIsConnector==true)
-//    //menu.addAction(pComponent->mpIsConnectModeAction);
-//  }
-  menu.exec(event->screenPos());
-}
-
-QVariant Component::itemChange(GraphicsItemChange change, const QVariant &value)
-{
-  QGraphicsItem::itemChange(change, value);
-
-  if (change == QGraphicsItem::ItemSelectedHasChanged)
-  {
-    if (isSelected())
-    {
-      showResizerItems();
-      setCursor(Qt::SizeAllCursor);
-      connect(mpGraphicsView->mpHorizontalFlipAction, SIGNAL(triggered()), SLOT(flipHorizontal()));
-      connect(mpGraphicsView->mpVerticalFlipAction, SIGNAL(triggered()), SLOT(flipVertical()));
-      connect(mpGraphicsView->mpRotateIconAction, SIGNAL(triggered()), SLOT(rotateClockwise()));
-      connect(mpGraphicsView->mpRotateAntiIconAction, SIGNAL(triggered()), SLOT(rotateAntiClockwise()));
-      connect(mpGraphicsView->mpResetRotation, SIGNAL(triggered()), SLOT(resetRotation()));
-      connect(mpGraphicsView->mpDeleteIconAction, SIGNAL(triggered()), SLOT(deleteMe()));
-      connect(mpGraphicsView->mpCopyComponentAction, SIGNAL(triggered()), SLOT(copyComponent()));
-      connect(mpGraphicsView, SIGNAL(keyPressDelete()), SLOT(deleteMe()));
-      connect(mpGraphicsView, SIGNAL(keyPressUp()), SLOT(moveUp()));
-      connect(mpGraphicsView, SIGNAL(keyPressDown()), SLOT(moveDown()));
-      connect(mpGraphicsView, SIGNAL(keyPressLeft()), SLOT(moveLeft()));
-      connect(mpGraphicsView, SIGNAL(keyPressRight()), SLOT(moveRight()));
-      connect(mpGraphicsView, SIGNAL(keyPressRotateClockwise()), SLOT(rotateClockwise()));
-      connect(mpGraphicsView, SIGNAL(keyPressRotateAntiClockwise()), SLOT(rotateAntiClockwise()));
-    }
-    else
-    {
-      if (!mpBottomLeftResizerItem->isPressed())
-        if (!mpTopLeftResizerItem->isPressed())
-          if (!mpTopRightResizerItem->isPressed())
-            if (!mpBottomRightResizerItem->isPressed())
-              hideResizerItems();
-      unsetCursor();
-      disconnect(mpGraphicsView->mpHorizontalFlipAction, SIGNAL(triggered()), this, SLOT(flipHorizontal()));
-      disconnect(mpGraphicsView->mpVerticalFlipAction, SIGNAL(triggered()), this, SLOT(flipVertical()));
-      disconnect(mpGraphicsView->mpRotateIconAction, SIGNAL(triggered()), this, SLOT(rotateClockwise()));
-      disconnect(mpGraphicsView->mpRotateAntiIconAction, SIGNAL(triggered()), this, SLOT(rotateAntiClockwise()));
-      disconnect(mpGraphicsView->mpResetRotation, SIGNAL(triggered()), this, SLOT(resetRotation()));
-      disconnect(mpGraphicsView->mpDeleteIconAction, SIGNAL(triggered()), this, SLOT(deleteMe()));
-      disconnect(mpGraphicsView->mpCopyComponentAction, SIGNAL(triggered()), this, SLOT(copyComponent()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressDelete()), this, SLOT(deleteMe()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressUp()), this, SLOT(moveUp()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressDown()), this, SLOT(moveDown()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressLeft()), this, SLOT(moveLeft()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressRight()), this, SLOT(moveRight()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressRotateClockwise()), this, SLOT(rotateClockwise()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressRotateAntiClockwise()), this, SLOT(rotateAntiClockwise()));
-    }
-  }
-  else if (change == QGraphicsItem::ItemPositionHasChanged)
-  {
-    emit componentMoved();
-    // if user has changed the postion using the keyboard then update annotations
-    // if user changes the position with mouse we handle it in mouse events of graphicsview
-    if (!mIsMousePressed)
-    {
-      if (mIsConnector)
-      {
-        Component *pComponent;
-        if (mpGraphicsView->getViewType() == StringHandler::ICON)
-        {
-          pComponent = mpGraphicsView->getModelWidget()->getDiagramGraphicsView()->getComponentObject(getName());
-          pComponent->setPos(pos());
-        }
-        else if(mpGraphicsView->getViewType() == StringHandler::DIAGRAM)
-        {
-          //Component *pComponent;
-          pComponent = mpGraphicsView->getModelWidget()->getIconGraphicsView()->getComponentObject(getName());
-          pComponent->setPos(pos());
-        }
-        //if component is a connector, synchronize the position in its diagram view with the icon view
-        pComponent->updateAnnotationString();
-      }
-      updateAnnotationString();
-      // update connectors annotations that are associated to this component
-      emit componentPositionChanged();
-      ModelWidget *pModelWidget = mpGraphicsView->getModelWidget();
-      pModelWidget->getModelicaTextWidget()->getModelicaTextEdit()->setPlainText(mpOMCProxy->list(pModelWidget->getLibraryTreeNode()->getNameStructure()));
-    }
-  }
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0))
-  else if (change == QGraphicsItem::ItemRotationHasChanged)
-  {
-    emit componentRotated(true);
-    updateAnnotationString();
-    ModelWidget *pModelWidget = mpGraphicsView->getModelWidget();
-    pModelWidget->getModelicaTextWidget()->getModelicaTextEdit()->setPlainText(mpOMCProxy->list(pModelWidget->getLibraryTreeNode()->getNameStructure()));
-  }
-#endif
-  return value;
-}
-
-void Component::addConnector(Connector *item)
-{
-  connect(this, SIGNAL(componentMoved()), item, SLOT(drawConnector()));
-  connect(this, SIGNAL(componentPositionChanged()), item, SLOT(updateConnectionAnnotationString()));
-
-  connect(this, SIGNAL(componentRotated(bool)), item, SLOT(drawConnector(bool)));
-  connect(this, SIGNAL(componentRotated(bool)), item, SLOT(updateConnectionAnnotationString()));
-
-  connect(this, SIGNAL(componentScaled()), item, SLOT(drawConnector()));
-  connect(this, SIGNAL(componentScaled()), item, SLOT(updateConnectionAnnotationString()));
-}
-
-void Component::setComponentFlags()
-{
-  // set the item flags
-  if(!flags().testFlag((QGraphicsItem::ItemIsMovable)))
-    setFlag(QGraphicsItem::ItemIsMovable);
-  if(!flags().testFlag((QGraphicsItem::ItemIsSelectable)))
-    setFlag(QGraphicsItem::ItemIsSelectable);
-  if(!flags().testFlag((QGraphicsItem::ItemSendsGeometryChanges)))
-    setFlag(QGraphicsItem::ItemSendsGeometryChanges);
-}
-
-void Component::unsetComponentFlags()
-{
-  // unset the item flags
-  if(flags().testFlag((QGraphicsItem::ItemIsMovable)))
-    setFlag(QGraphicsItem::ItemIsMovable, false);
-  if(flags().testFlag((QGraphicsItem::ItemIsSelectable)))
-    setFlag(QGraphicsItem::ItemIsSelectable, false);
-  if(flags().testFlag((QGraphicsItem::ItemSendsGeometryChanges)))
-    setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
-}
-
-QString Component::getTransformationAnnotationString()
-{
-  QString annotationString;
-  if (mpGraphicsView->getViewType() == StringHandler::ICON)
-    annotationString.append("iconTransformation=transformation(origin=");
-  else if (mpGraphicsView->getViewType() == StringHandler::DIAGRAM)
-    annotationString.append("transformation=transformation(origin=");
-  // add the icon origin
-  annotationString.append("{").append(QString::number(scenePos().x())).append(",");
-  annotationString.append(QString::number(scenePos().y())).append("}, ");
-  // add extent points
-  qreal x1, y1, x2, y2;
-  boundingRect().getCoords(&x1, &y1, &x2, &y2);
-  QPointF extent1, extent2;
-  extent1.setX(mapToScene(x1, y1).x() - scenePos().x());
-  extent1.setY(mapToScene(x1, y1).y() - scenePos().y());
-  extent2.setX(mapToScene(x2, y2).x() - scenePos().x());
-  extent2.setY(mapToScene(x2, y2).y() - scenePos().y());
-  if (mpTransformation->getFlipHorizontal())
-  {
-    extent1.setX(fabs(extent1.x()));
-    extent2.setX(-(fabs(extent2.x())));
-  }
-  else
-  {
-    extent1.setX(-(fabs(extent1.x())));
-    extent2.setX(fabs(extent2.x()));
-  }
-  if (mpTransformation->getFlipVertical())
-  {
-    extent1.setY(fabs(extent1.y()));
-    extent2.setY(-(fabs(extent2.y())));
-  }
-  else
-  {
-    extent1.setY(-(fabs(extent1.y())));
-    extent2.setY(fabs(extent2.y()));
-  }
-  annotationString.append("extent={").append("{").append(QString::number(extent1.x()));
-  annotationString.append(",").append(QString::number(extent1.y())).append("},");
-  annotationString.append("{").append(QString::number(extent2.x())).append(",");
-  annotationString.append(QString::number(extent2.y())).append("}}, ");
-  // add icon rotation
-  annotationString.append("rotation=").append(QString::number(mpTransformation->getRotateAngle())).append(")");
-  return annotationString;
-}
-
-void Component::updateAnnotationString(bool updateBothViews)
-{
-  // create the annotation string
-  QString annotationString = "annotate=Placement(";
-  annotationString.append("visible=true, ");
-  if (mIsConnector and updateBothViews)
-  {
-    if (mpGraphicsView->getViewType() == StringHandler::ICON)
-    {
-      // first get the component from diagram view and get the transformations
-      Component *pComponent;
-      pComponent = mpGraphicsView->getModelWidget()->getDiagramGraphicsView()->getComponentObject(getName());
-      if (pComponent)
-        annotationString.append(pComponent->getTransformationAnnotationString());
-      // then get the icon transformations
-      annotationString.append(QString(", ").append(getTransformationAnnotationString()));
-    }
-    else if (mpGraphicsView->getViewType() == StringHandler::DIAGRAM)
-    {
-      // first get the component from diagram view and get the transformations
-      annotationString.append(getTransformationAnnotationString());
-      // then get the icon transformations
-      Component *pComponent;
-      pComponent = mpGraphicsView->getModelWidget()->getIconGraphicsView()->getComponentObject(getName());
-      if (pComponent)
-        annotationString.append(QString(", ").append(pComponent->getTransformationAnnotationString()));
-    }
-  }
-  else
-  {
-    annotationString.append(getTransformationAnnotationString());
-  }
-  annotationString.append(")");
-  // Add component annotation.
-  mpOMCProxy->updateComponent(mName, mClassName, mpGraphicsView->getModelWidget()->getLibraryTreeNode()->getNameStructure(), annotationString);
-  // call the addclassannotation if the graphicsview is icon, so the icon in the tree is also updated
-  if (mpGraphicsView->getViewType() == StringHandler::ICON || mIsConnector)
-    mpGraphicsView->addClassAnnotation();
-}
-
-//! Tells the component to ask its parent to delete it.
-void Component::deleteMe(bool update)
-{
-  // make sure you disconnect all signals before deleting the object
-  disconnect(mpGraphicsView->mpHorizontalFlipAction, SIGNAL(triggered()), this, SLOT(flipHorizontal()));
-  disconnect(mpGraphicsView->mpVerticalFlipAction, SIGNAL(triggered()), this, SLOT(flipVertical()));
-  disconnect(mpGraphicsView->mpRotateIconAction, SIGNAL(triggered()), this, SLOT(rotateClockwise()));
-  disconnect(mpGraphicsView->mpRotateAntiIconAction, SIGNAL(triggered()), this, SLOT(rotateAntiClockwise()));
-  disconnect(mpGraphicsView->mpResetRotation, SIGNAL(triggered()), this, SLOT(resetRotation()));
-  disconnect(mpGraphicsView->mpDeleteIconAction, SIGNAL(triggered()), this, SLOT(deleteMe()));
-  disconnect(mpGraphicsView->mpCopyComponentAction, SIGNAL(triggered()), this, SLOT(copyComponent()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressDelete()), this, SLOT(deleteMe()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressUp()), this, SLOT(moveUp()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressDown()), this, SLOT(moveDown()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressLeft()), this, SLOT(moveLeft()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressRight()), this, SLOT(moveRight()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressRotateClockwise()), this, SLOT(rotateClockwise()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressRotateAntiClockwise()), this, SLOT(rotateAntiClockwise()));
-  // delete the object
-  GraphicsView *pGraphicsView = qobject_cast<GraphicsView*>(const_cast<QObject*>(sender()));
-  // delete the component from model
-  mpGraphicsView->deleteComponentObject(this, update);
-  // remove the component from the scene
-  mpGraphicsView->scene()->removeItem(this);
-  // if the signal is not send by graphicsview then call addclassannotation
-  if (!pGraphicsView)
-  {
-    if (mpGraphicsView->getViewType() == StringHandler::ICON)
-      mpGraphicsView->addClassAnnotation(update);
-  }
-  deleteLater();
-}
-
-
-//copying a component or a selected scene, currently non functional,just works for a single
-//component, to do
-void Component::copyComponent()
-{
-  GraphicsView *pGraphicsView = qobject_cast<GraphicsView*>(const_cast<QObject*>(sender()));
-
-  Component *newComponent;
-  QString name = mpGraphicsView->getUniqueComponentName(getName().toLower());
-  QPointF point;
-  point= QPointF((pos().x()) +1.0 ,(pos().y()) +1.0);
-  //newComponent = new Component(this,name,point,getIsConnector(),mpGraphicsView);
-  //remove the component from the scene
-  //mpGraphicsView->scene()->removeItem(this);
-  //if the signal is not send by graphicsview then call addclassannotation
-  //    if (!pGraphicsView)
-  //    {
-  //        if (mpGraphicsView->mIconType == StringHandler::ICON)
-  //            mpGraphicsView->addClassAnnotation();
-  //    }
-  //    delete(this);
-  //mpGraphicsView->addComponentObject(newComponent);
-
-  QClipboard *clipboard = QApplication::clipboard();
-
-
-  clipboard->setText(getName());
-
-  //if(!clipboard->text().isEmpty())
-  //mpGraphicsView->mpPasteComponentAction->setDisabled(false);
-}
-
-void Component::openIconProperties()
-{
-  IconProperties *iconProperties = new IconProperties(this, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-  iconProperties->show();
-}
-
-void Component::openIconAttributes()
-{
-  IconAttributes *iconAttributes = new IconAttributes(this, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-  iconAttributes->show();
-}
-
-QString Component::getName()
-{
-  return mName;
-}
-
-void Component::updateName(QString newName)
-{
-  // check in icon text annotation
-  foreach (ShapeAnnotation *shapeAnnotation, mpShapesList)
-  {
-    if (dynamic_cast<TextAnnotation*>(shapeAnnotation))
-    {
-      TextAnnotation *textAnnotation = dynamic_cast<TextAnnotation*>(shapeAnnotation);
-      if (textAnnotation->getTextString() == mName)
-      {
-        textAnnotation->setTextString(newName);
-        mName = newName;
-        return;
-      }
-    }
-  }
-
-  // check in icon's inheritance text annotation
-  foreach (Component *inheritance, mpInheritanceList)
-    foreach (ShapeAnnotation *shapeAnnotation, inheritance->mpShapesList)
-    {
-      if (dynamic_cast<TextAnnotation*>(shapeAnnotation))
-      {
-        TextAnnotation *textAnnotation = dynamic_cast<TextAnnotation*>(shapeAnnotation);
-        if (textAnnotation->getTextString() == mName)
-        {
-          textAnnotation->setTextString(newName);
-          mName = newName;
-          return;
-        }
-      }
-    }
-
-  // check in icon's components text annotation
-  foreach (Component *component, mpComponentsList)
-    foreach (ShapeAnnotation *shapeAnnotation, component->mpShapesList)
-    {
-      if (dynamic_cast<TextAnnotation*>(shapeAnnotation))
-      {
-        TextAnnotation *textAnnotation = dynamic_cast<TextAnnotation*>(shapeAnnotation);
-        if (textAnnotation->getTextString() == mName)
-        {
-          textAnnotation->setTextString(newName);
-          mName = newName;
-          return;
-        }
-      }
-    }
-}
-
-void Component::updateParameterValue(QString oldValue, QString newValue)
-{
-  // check in icon text annotation
-  foreach (ShapeAnnotation *shapeAnnotation, mpShapesList)
-  {
-    if (dynamic_cast<TextAnnotation*>(shapeAnnotation))
-    {
-      TextAnnotation *textAnnotation = dynamic_cast<TextAnnotation*>(shapeAnnotation);
-      if (textAnnotation->getTextString() == oldValue)
-      {
-        textAnnotation->setTextString(newValue);
-        return;
-      }
-    }
-  }
-}
-
-QString Component::getClassName()
-{
-  return mClassName;
-}
-
-OMCProxy* Component::getOMCProxy()
-{
-  return mpOMCProxy;
-}
-
-GraphicsView* Component::getGraphicsView()
-{
-  return mpGraphicsView;
-}
-
-Component* Component::getParentComponent()
-{
-  if (!mpParentComponent)
-    return this;
-  else
-    return mpParentComponent;
-}
-
-Component* Component::getRootParentComponent(bool secondLast)
-{
-  Component *pComponent, *pPreviousComponent;
-  pComponent = this;
-  pPreviousComponent = this;
-  while (pComponent->mpParentComponent)
-  {
-    pPreviousComponent = pComponent;
-    pComponent = pComponent->mpParentComponent;
-  }
-
-  if (secondLast)
-    return pPreviousComponent;
-  else
-    return pComponent;
-}
-
-QList<Component*> Component::getInheritanceList()
-{
-  return mpInheritanceList;
-}
-
-QList<ShapeAnnotation*> Component::getShapesList()
-{
-  return mpShapesList;
-}
-
-QList<Component*> Component::getComponentsList()
-{
-  return mpComponentsList;
-}
-
-ComponentInfo* Component::getComponentInfo()
-{
-  return mpComponentProperties;
-}
-
-QList<ComponentInfo*> Component::getChildComponentInfo()
-{
-  return mpChildComponentInfo;
-}
-
-QRectF Component::getRectangle()
-{
-  return mRectangle;
-}
-
-QString Component::getTransformationString()
-{
-  return mTransformationString;
-}
-
-bool Component::isLibraryComponent()
-{
-  return mIsLibraryComponent;
-}
-
-void Component::setOldPosition(QPointF oldPosition)
-{
-  mOldPosition = oldPosition;
-}
-
-QPointF Component::getOldPosition()
-{
-  return mOldPosition;
-}
-
-void Component::setMousePressed(bool On)
-{
-  mIsMousePressed = On;
-}
-
-void Component::getClassInheritedComponents()
-{
-  // read the component inheritance
-  int inheritanceCount = mpOMCProxy->getInheritanceCount(mClassName);
-  for(int i = 1 ; i <= inheritanceCount ; i++)
-  {
-    QString inheritedClass = mpOMCProxy->getNthInheritedClass(mClassName, i);
-    // avoid cycles
-    if (inheritedClass.compare(mClassName) == 0)
-      return;
-    // If the inherited class is one of the builtin type such as Real we can
-    // stop here, because the class can not contain any components, etc.
-    if (mpOMCProxy->isBuiltinType(inheritedClass))
-    {
-      //mpInheritanceList.append(new Component("", inheritedClass, mpOMCProxy->isWhat(StringHandler::CONNECTOR, inheritedClass), this));
-      return;
-    }
-    // get the inherited class annotation
-    QString annotationString = mpOMCProxy->getIconAnnotation(inheritedClass);
-    Component *inheritance;
-    inheritance  = new Component(annotationString, inheritedClass, mpOMCProxy->isWhat(StringHandler::CONNECTOR, inheritedClass), this);
-    mpInheritanceList.append(inheritance);
-  }
-}
-
-//! this function is called for icon view
-void Component::getClassComponents()
-{
-  foreach (Component *pInheritedComponent, mpInheritanceList)
-  {
-    pInheritedComponent->getClassComponents();
-  }
-  // get components
-  QList<ComponentInfo*> componentInfoList = mpOMCProxy->getComponents(mClassName);
-  mpChildComponentInfo = componentInfoList;
-  QStringList componentsAnnotationsList = mpOMCProxy->getComponentAnnotations(mClassName);
-  int i = 0;
-  foreach (ComponentInfo *pComponentInfo, componentInfoList)
-  {
-    // just to be on safe-side.
-    if (componentsAnnotationsList.size() <= i)
-      continue;
-    if (static_cast<QString>(componentsAnnotationsList.at(i)).toLower().contains("error"))
-    {
-      i++;
-      continue;
-    }
-    // if component is protected we don't show it in the diagram layer.
-    if (pComponentInfo->getProtected())
-    {
-      i++;
-      continue;
-    }
-    if (StringHandler::removeFirstLastCurlBrackets(componentsAnnotationsList.at(i)).length() > 0)
-    {
-      if (mpOMCProxy->isWhat(StringHandler::CONNECTOR, pComponentInfo->getClassName()))
-      {
-        QString result = mpOMCProxy->getIconAnnotation(pComponentInfo->getClassName());
-        Component *component;
-        if (mIsLibraryComponent)
-        {
-          component = new Component(result, componentsAnnotationsList.at(i), pComponentInfo, true, getRootParentComponent());
-        }
-        else
-        {
-          component = new Component(result, componentsAnnotationsList.at(i), pComponentInfo, true, getRootParentComponent());
-        }
-        mpComponentsList.append(component);
-      }
-    }
-    i++;
-  }
-}
-
-//! this function is called for diagram view
-//void Component::getClassComponents(QString className, int type, Component *pParent)
-//{
-//  // if component type is diagram then
-//  if (type == StringHandler::DIAGRAM)
-//  {
-//    // get the diagram connections
-//    int connections = mpOMCProxy->getConnectionCount(className);
-
-//    for (int i = 1 ; i <= connections ; i++)
-//    {
-//      QString result = mpOMCProxy->getNthConnectionAnnotation(className, i);
-//      QStringList shapesList;
-//      shapesList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(result), '(', ')');
-//      // Now parse the shapes available in list
-//      foreach (QString shape, shapesList)
-//      {
-//        shape = StringHandler::removeFirstLastCurlBrackets(shape);
-//        if (shape.startsWith("Line"))
-//        {
-//          shape = shape.mid(QString("Line").length());
-//          result = StringHandler::removeFirstLastBrackets(shape);
-//          LineAnnotation *lineAnnotation = new LineAnnotation(result, pParent);
-//          Q_UNUSED(lineAnnotation);
-//        }
-//      }
-//    }
-//  }
-
-//  int inheritanceCount = mpOMCProxy->getInheritanceCount(className);
-
-//  for(int i = 1 ; i <= inheritanceCount ; i++)
-//  {
-//    QString inheritedClass = mpOMCProxy->getNthInheritedClass(className, i);
-//    QString annotationString;
-
-//    // If the inherited class is one of the builtin type such as Real we can
-//    // stop here, because the class can not contain any components, etc.
-//    if (mpOMCProxy->isBuiltinType(inheritedClass))
-//    {
-//      mpInheritanceList.append(new Component("", inheritedClass, mpOMCProxy->isWhat(StringHandler::CONNECTOR, inheritedClass), this));
-//      return;
-//    }
-//    if (type == StringHandler::ICON)
-//      annotationString = mpOMCProxy->getIconAnnotation(inheritedClass);
-//    else if (type == StringHandler::DIAGRAM)
-//      annotationString = mpOMCProxy->getDiagramAnnotation(inheritedClass);
-//    Component *inheritance;
-//    inheritance = new Component(annotationString, inheritedClass, mpOMCProxy->isWhat(StringHandler::CONNECTOR, inheritedClass), pParent);
-//    mpInheritanceList.append(inheritance);
-//    // avoid cycles
-//    if (inheritedClass.compare(className) == 0)
-//    {
-//      return;
-//    }
-//    getClassComponents(inheritedClass, type, inheritance);
-//  }
-
-//  QList<ComponentsProperties*> components = mpOMCProxy->getComponents(className);
-//  mpChildComponentProperties=components;
-
-//  QStringList componentsAnnotationsList = mpOMCProxy->getComponentAnnotations(className);
-//  int i = 0;
-//  foreach (ComponentsProperties *componentProperties, components)
-//  {
-//    if (static_cast<QString>(componentsAnnotationsList.at(i)).toLower().contains("error"))
-//      continue;
-
-//    if (type == StringHandler::ICON)
-//    {
-//      if (StringHandler::removeFirstLastCurlBrackets(componentsAnnotationsList.at(i)).length() > 0)
-//      {
-//        if (mpOMCProxy->isWhat(StringHandler::CONNECTOR, componentProperties->getClassName()))
-//        {
-//          QString result = mpOMCProxy->getIconAnnotation(componentProperties->getClassName());
-//          Component *component;
-//          component = new Component(result, componentsAnnotationsList.at(i), componentProperties, true, pParent);
-//          mpComponentsList.append(component);
-//          getClassComponents(componentProperties->getClassName(), StringHandler::ICON, component);
-//        }
-//      }
-//      else
-//      {
-//        //! @todo Change it to add all components.............
-//        mpComponentProperties = components.at(0);
-//      }
-//    }
-//    else if (type == StringHandler::DIAGRAM)
-//    {
-//      if (StringHandler::removeFirstLastCurlBrackets(componentsAnnotationsList.at(i)).length() > 0)
-//      {
-//        if (mpOMCProxy->isWhat(StringHandler::CONNECTOR, componentProperties->getClassName()))
-//        {
-//          QString result = mpOMCProxy->getDiagramAnnotation(componentProperties->getClassName());
-//          Component *component;
-//          component = new Component(result, componentsAnnotationsList.at(i), componentProperties, true, pParent);
-//          mpComponentsList.append(component);
-//          getClassComponents(componentProperties->getClassName(), StringHandler::DIAGRAM, component);
-//        }
-//        else
-//        {
-//          QString result = mpOMCProxy->getIconAnnotation(componentProperties->getClassName());
-//          Component *component;
-//          component = new Component(result, componentsAnnotationsList.at(i), componentProperties, true, pParent);
-//          mpComponentsList.append(component);
-//          getClassComponents(componentProperties->getClassName(), StringHandler::ICON, component);
-//        }
-//      }
-//    }
-//    i++;
-//  }
-//}
-
-void Component::copyClassInheritedComponents(Component *pComponent)
-{
-  foreach(Component *inheritance, pComponent->mpInheritanceList)
-  {
-    Component *inheritanceComponent = new Component(inheritance->mAnnotationString, inheritance->mClassName, inheritance->mIsConnector, this);
-    inheritanceComponent->mpComponentsList = inheritance->mpComponentsList;
-    mpInheritanceList.append(inheritanceComponent);
-  }
-}
-
-//! this function is called when we need to create a copy of one component
-void Component::copyClassComponents(Component *pComponent)
-{
-  foreach(Component *inheritance, mpInheritanceList)
-  {
-    inheritance->copyClassComponents(inheritance);
-  }
-  foreach(Component *component, pComponent->mpComponentsList)
-  {
-    Component *portComponent = new Component(component->mAnnotationString, component->mTransformationString, component->mpComponentProperties,
-                                             component->mIsConnector, getRootParentComponent());
-    mpComponentsList.append(portComponent);
-  }
-}
-
-
-
-
-
 ComponentInfo::ComponentInfo(QString value)
 {
@@ -2133,4 +1079,5 @@
   mCasuality = "";
   mArrayIndex = "";
+  mIsArray = false;
   parseString(value);
 }
@@ -2217,4 +1164,6 @@
   // read the array index value
   mArrayIndex = StringHandler::removeFirstLastCurlBrackets(list.at(11));
+  if ((mArrayIndex.compare("n") == 0) || (mArrayIndex.compare(":") == 0))
+    mIsArray = true;
 }
 
@@ -2283,2 +1232,7 @@
   return mArrayIndex;
 }
+
+bool ComponentInfo::isArray()
+{
+  return mIsArray;
+}
Index: /branches/OMEdit/OMEditGUI/Component.h
===================================================================
--- /branches/OMEdit/OMEditGUI/Component.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/Component.h	(revision 13537)
@@ -68,16 +68,16 @@
 class IconParameters;
 
-class Component_OMC : public QObject, public QGraphicsItem
+class Component : public QObject, public QGraphicsItem
 {
   Q_OBJECT
   Q_INTERFACES(QGraphicsItem)
 public:
-  Component_OMC(QString annotation, QString name, QString className, StringHandler::ModelicaClasses type, QString transformation,
-                QPointF position, OMCProxy *pOMCProxy, GraphicsView *pGraphicsView, Component_OMC *pParent = 0);
-  Component_OMC(QString annotation, QString className, StringHandler::ModelicaClasses type, Component_OMC *pParent);
-  Component_OMC(QString annotation, QString transformationString, ComponentInfo *pComponentInfo, StringHandler::ModelicaClasses type,
-                Component_OMC *pParent);
+  Component(QString annotation, QString name, QString className, StringHandler::ModelicaClasses type, QString transformation,
+                QPointF position, OMCProxy *pOMCProxy, GraphicsView *pGraphicsView, Component *pParent = 0);
+  Component(QString annotation, QString className, StringHandler::ModelicaClasses type, Component *pParent);
+  Component(QString annotation, QString transformationString, ComponentInfo *pComponentInfo, StringHandler::ModelicaClasses type,
+                Component *pParent);
   /* Used for Library Component */
-  Component_OMC(QString annotation, QString className, OMCProxy *pOMCProxy, Component_OMC *pParent = 0);
+  Component(QString annotation, QString className, OMCProxy *pOMCProxy, Component *pParent = 0);
   void initialize();
   bool isLibraryComponent();
@@ -97,11 +97,11 @@
   OMCProxy* getOMCProxy();
   GraphicsView* getGraphicsView();
-  Component_OMC* getParentComponent();
-  Component_OMC* getRootParentComponent();
+  Component* getParentComponent();
+  Component* getRootParentComponent();
   Transformation* getTransformation();
   ComponentInfo* getComponentInfo();
-  QList<Component_OMC*> getInheritanceList();
-  QList<ShapeAnnotation_OMC*> getShapesList();
-  QList<Component_OMC*> getComponentsList();
+  QList<Component*> getInheritanceList();
+  QList<ShapeAnnotation*> getShapesList();
+  QList<Component*> getComponentsList();
   void setOldPosition(QPointF oldPosition);
   QPointF getOldPosition();
@@ -115,5 +115,5 @@
   void applyRotation(qreal angle);
   void applyFlip(StringHandler::Flip flip);
-  void addConnectionDetails(LineAnnotation_OMC *pConnectorLineAnnotation);
+  void addConnectionDetails(LineAnnotation *pConnectorLineAnnotation);
   void updateConnection();
 private:
@@ -123,5 +123,5 @@
   OMCProxy *mpOMCProxy;
   GraphicsView *mpGraphicsView;
-  Component_OMC *mpParentComponent;
+  Component *mpParentComponent;
   bool mIsLibraryComponent;
   bool mVisible;
@@ -143,11 +143,11 @@
   qreal mYFactor;
   ComponentInfo *mpComponentInfo;
-  QList<Component_OMC*> mpInheritanceList;
-  QList<ShapeAnnotation_OMC*> mpShapesList;
-  QList<Component_OMC*> mpComponentsList;
+  QList<Component*> mpInheritanceList;
+  QList<ShapeAnnotation*> mpShapesList;
+  QList<Component*> mpComponentsList;
   QPointF mOldPosition;
   bool mIsMousePressed;
 signals:
-  void componentClicked(Component_OMC*);
+  void componentClicked(Component*);
   void componentTransformChange();
   void componentTransformHasChanged();
@@ -174,108 +174,4 @@
 };
 
-class Component : public ShapeAnnotation
-{
-  Q_OBJECT
-private:
-  QString mAnnotationString;
-  bool mIsConnector;
-  QString mName;
-  QString mClassName;
-  QList<CornerItem1*> mCornerItemsList;
-  CornerItem *mpTopLeftCornerItem;
-  CornerItem *mpTopRightCornerItem;
-  CornerItem *mpBottomLeftCornerItem;
-  CornerItem *mpBottomRightCornerItem;
-  QAction *mpIconPropertiesAction;
-  QAction *mpIconAttributesAction;
-  QAction *mpIsConnectModeAction;
-  QRectF mRectangle;    // stores the extent points
-  QString mTransformationString;
-  bool mPreserveAspectRatio;
-  qreal mInitialScale;
-  QList<qreal> mGrid;
-  Component *mpParentComponent;
-  OMCProxy *mpOMCProxy;
-  GraphicsView *mpGraphicsView;
-  ComponentInfo *mpComponentProperties;
-  QList<ComponentInfo*> mpChildComponentInfo;
-  QList<ShapeAnnotation*> mpShapesList;
-  QList<Component*> mpInheritanceList;
-  QList<Component*> mpComponentsList;
-  //QList<IconParameters*> mIconParametersList;
-  bool mIsLibraryComponent;
-  QPointF mOldPosition;
-  bool mIsMousePressed;
-
-  void createActions();
-public:
-  Component(QString value, QString name, QString className, QString transformationString, QPointF position, bool connector, OMCProxy *omc,
-            GraphicsView *graphicsView, Component *pParent = 0);
-  Component(QString value, QString className, bool connector, Component *pParent = 0);
-  Component(QString value, QString transformationString, ComponentInfo *pComponentInfo, bool connector, Component *pParent = 0);
-  /* Used for Library Component */
-  Component(QString value, QString className, bool connector, OMCProxy *omc, Component *pParent = 0);
-  /* Copy Constructors */
-  Component(Component *pComponent, QString name, QString transformationString, QPointF position, bool connector, GraphicsView *graphicsView,
-            Component *pParent = 0);
-  /* Copy Constructors */
-  ~Component();
-  void initialize();
-  bool parseAnnotationString(QString value);
-  QRectF boundingRect() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  QString getName();
-  void updateName(QString newName);
-  void updateParameterValue(QString oldValue, QString newValue);
-  QString getClassName();
-  OMCProxy* getOMCProxy();
-  GraphicsView* getGraphicsView();
-  Component* getParentComponent();
-  Component* getRootParentComponent(bool secondLast = false);
-  QList<Component*> getInheritanceList();
-  QList<ShapeAnnotation*> getShapesList();
-  QList<Component*> getComponentsList();
-  ComponentInfo *getComponentInfo();
-  QList<ComponentInfo*> getChildComponentInfo();
-  QRectF getRectangle();
-  QString getTransformationString();
-  bool isLibraryComponent();
-  void setOldPosition(QPointF oldPosition);
-  QPointF getOldPosition();
-  void setMousePressed(bool On);
-  void getClassInheritedComponents();
-  void getClassComponents();
-  //void getClassComponents(QString className, int type, Component *pParent);
-  void copyClassInheritedComponents(Component *pComponent);
-  void copyClassComponents(Component *pComponent);
-  void addConnector(Connector *item);
-  void setComponentFlags();
-  void unsetComponentFlags();
-  bool getIsConnector();
-  QString getTransformationAnnotationString();
-signals:
-  void componentClicked(Component*);
-  void connectorComponentClicked(Component*);
-  void componentMoved();
-  void componentPositionChanged();
-  void componentDeleted();
-  void componentSelected();
-  void componentRotated(bool isRotated);
-  void componentScaled();
-public slots:
-  void updateAnnotationString(bool updateBothViews = true);
-  void deleteMe(bool update = true);
-  void copyComponent();
-  void openIconProperties();
-  void openIconAttributes();
-protected:
-  virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
-  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
-  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
-  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
-  virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
-};
-
 class ComponentInfo
 {
@@ -296,4 +192,5 @@
   QString getCasuality();
   QString getArrayIndex();
+  bool isArray();
 private:
   QString mClassName;
@@ -312,4 +209,5 @@
   QString mCasuality;
   QString mArrayIndex;
+  bool mIsArray;
 };
 
Index: /branches/OMEdit/OMEditGUI/CornerItem.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/CornerItem.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/CornerItem.cpp	(revision 13537)
@@ -35,107 +35,4 @@
 
 #include "CornerItem.h"
-
-RectangleCornerItem::RectangleCornerItem(qreal x, qreal y, int connectedPointIndex, ShapeAnnotation *pParent)
-  : QGraphicsItem(pParent), mItemClicked(false), mConnectedPointIndex(connectedPointIndex)
-{
-  setFlags(QGraphicsItem::ItemIgnoresTransformations | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable
-           | QGraphicsItem::ItemSendsGeometryChanges);
-  setAcceptHoverEvents(true);
-  scale(1.0, -1.0);
-  mActivePen = QPen(Qt::red);
-  mHoverPen = QPen(Qt::darkRed);
-  setPos(x, y);
-  mRectangle = QRectF (-3, -3, 6, 6);
-  setActive();
-
-  mpShapeAnnotation = pParent;
-  connect(this, SIGNAL(itemMoved(int,QPointF)), mpShapeAnnotation, SLOT(updatePoint(int,QPointF)));
-  connect(this, SIGNAL(itemClicked()), mpShapeAnnotation, SLOT(doSelect()));
-  connect(this, SIGNAL(itemUnClicked()), mpShapeAnnotation, SLOT(doUnSelect()));
-  connect(this, SIGNAL(itemPositionUpdate()), mpShapeAnnotation->mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-//! Tells the box to become visible and use active style.
-//! @see setPassive();
-//! @see setHovered();
-void RectangleCornerItem::setActive()
-{
-  setVisible(true);
-  mPen = mActivePen;
-  update();
-}
-
-//! Tells the box to become invisible.
-//! @see setActive();
-//! @see setHovered();
-void RectangleCornerItem::setPassive()
-{
-  setVisible(false);
-}
-
-//! Tells the box to become visible and use hovered style.
-//! @see setActive();
-//! @see setPassive();
-void RectangleCornerItem::setHovered()
-{
-  setVisible(true);
-  mPen = mHoverPen;
-}
-
-QRectF RectangleCornerItem::boundingRect() const
-{
-  return mRectangle;
-}
-
-void RectangleCornerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-  painter->setPen(mPen);
-  painter->setBrush(mPen.color());
-  painter->drawRect(mRectangle);
-}
-
-//! Event when mouse cursor enters component icon.
-void RectangleCornerItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
-{
-  Q_UNUSED(event);
-  setCursor(Qt::ArrowCursor);
-}
-
-//! Event when mouse cursor leaves component icon.
-void RectangleCornerItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
-{
-  Q_UNUSED(event);
-  unsetCursor();
-}
-
-void RectangleCornerItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
-  emit itemClicked();
-  mClickPos = mapToScene(event->pos());
-  QGraphicsItem::mousePressEvent(event);
-}
-
-void RectangleCornerItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
-  emit itemUnClicked();
-  if (mClickPos != mapToScene(event->pos()))
-  {
-    emit itemPositionUpdate();
-  }
-  mpShapeAnnotation->setSelected(true);
-  QGraphicsItem::mouseReleaseEvent(event);
-}
-
-QVariant RectangleCornerItem::itemChange(GraphicsItemChange change, const QVariant &value)
-{
-  QGraphicsItem::itemChange(change, value);
-  if (change == QGraphicsItem::ItemPositionHasChanged)
-  {
-    emit itemMoved(mConnectedPointIndex, value.toPointF());
-  }
-  return value;
-}
 
 ResizerItem::ResizerItem(int index, QGraphicsItem *pParent)
Index: /branches/OMEdit/OMEditGUI/CornerItem.h
===================================================================
--- /branches/OMEdit/OMEditGUI/CornerItem.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/CornerItem.h	(revision 13537)
@@ -44,43 +44,7 @@
 #include "Component.h"
 
-class ShapeAnnotation;
 class Component;
-class Component_OMC;
 class GraphicsScene;
 class GraphicsView;
-
-class RectangleCornerItem : public QObject, public QGraphicsItem
-{
-  Q_OBJECT
-  Q_INTERFACES(QGraphicsItem)
-private:
-  QRectF mRectangle;
-  QPen mPen;
-  QPen mActivePen;
-  QPen mHoverPen;
-  bool mItemClicked;
-  QPointF mClickPos;
-  int mConnectedPointIndex;
-public:
-  RectangleCornerItem(qreal x, qreal y, int connectedPointIndex, ShapeAnnotation *pParent = 0);
-  void setActive();
-  void setPassive();
-  void setHovered();
-  QRectF boundingRect() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-
-  ShapeAnnotation *mpShapeAnnotation;
-signals:
-  void itemMoved(int index, QPointF point);
-  void itemClicked();
-  void itemUnClicked();
-  void itemPositionUpdate();
-protected:
-  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
-  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
-  virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
-  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-  QVariant itemChange(GraphicsItemChange change, const QVariant &value);
-};
 
 //This class is the black or red boxes that appears around a selected item or items so the user can scale or rotate
Index: /branches/OMEdit/OMEditGUI/EllipseAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/EllipseAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/EllipseAnnotation.cpp	(revision 13537)
@@ -37,11 +37,11 @@
 
 
-EllipseAnnotation_OMC::EllipseAnnotation_OMC(QString annotation, Component_OMC *pParent)
-  : ShapeAnnotation_OMC(pParent)
+EllipseAnnotation::EllipseAnnotation(QString annotation, Component *pParent)
+  : ShapeAnnotation(pParent)
 {
   parseShapeAnnotation(annotation);
 }
 
-void EllipseAnnotation_OMC::parseShapeAnnotation(QString annotation)
+void EllipseAnnotation::parseShapeAnnotation(QString annotation)
 {
   GraphicItem::parseShapeAnnotation(annotation);
@@ -65,63 +65,4 @@
 }
 
-QRectF EllipseAnnotation_OMC::boundingRect() const
-{
-  return shape().boundingRect();
-}
-
-QPainterPath EllipseAnnotation_OMC::shape() const
-{
-  QPainterPath path;
-  path.addEllipse(getBoundingRect());
-  return addPathStroker(path);
-}
-
-void EllipseAnnotation_OMC::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-  if (transformOriginPoint() != boundingRect().center())
-    setTransformOriginPoint(boundingRect().center());
-  drawEllipseAnnotaion(painter);
-}
-
-void EllipseAnnotation_OMC::drawEllipseAnnotaion(QPainter *painter)
-{
-  applyLinePattern(painter);
-  applyFillPattern(painter);
-  QPainterPath path;
-  path.addEllipse(boundingRect());
-  painter->drawPath(path);
-}
-
-
-EllipseAnnotation::EllipseAnnotation(QString shape, Component *pParent)
-  : ShapeAnnotation(pParent), mpComponent(pParent)
-{
-  initializeFields();
-  parseShapeAnnotation(shape, mpComponent->getOMCProxy());
-}
-
-EllipseAnnotation::EllipseAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-EllipseAnnotation::EllipseAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  parseShapeAnnotation(shape, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy());
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
 QRectF EllipseAnnotation::boundingRect() const
 {
@@ -140,9 +81,6 @@
   Q_UNUSED(option);
   Q_UNUSED(widget);
-
   if (transformOriginPoint() != boundingRect().center())
-  {
     setTransformOriginPoint(boundingRect().center());
-  }
   drawEllipseAnnotaion(painter);
 }
@@ -150,219 +88,8 @@
 void EllipseAnnotation::drawEllipseAnnotaion(QPainter *painter)
 {
+  applyLinePattern(painter);
+  applyFillPattern(painter);
   QPainterPath path;
-
-  switch (this->mFillPattern)
-  {
-    case Qt::LinearGradientPattern:
-    {
-      QLinearGradient gradient(boundingRect().center().x(), boundingRect().center().y(), boundingRect().center().x(), boundingRect().y());
-      gradient.setColorAt(0.0, this->mFillColor);
-      gradient.setColorAt(1.0, this->mLineColor);
-      gradient.setSpread(QGradient::ReflectSpread);
-      painter->setBrush(gradient);
-      break;
-    }
-    case Qt::Dense1Pattern:
-    {
-      QLinearGradient gradient(boundingRect().center().x(), boundingRect().center().y(),
-                               boundingRect().x(), boundingRect().center().y());
-      gradient.setColorAt(0.0, this->mFillColor);
-      gradient.setColorAt(1.0, this->mLineColor);
-      gradient.setSpread(QGradient::ReflectSpread);
-      painter->setBrush(gradient);
-      break;
-    }
-    case Qt::RadialGradientPattern:
-    {
-      QRadialGradient gradient(boundingRect().center().x(), boundingRect().center().y(), boundingRect().width());
-      gradient.setColorAt(0.0, this->mFillColor);
-      gradient.setColorAt(1.0, this->mLineColor);
-      gradient.setSpread(QGradient::ReflectSpread);
-      painter->setBrush(gradient);
-      break;
-    }
-    default:
-      painter->setBrush(QBrush(this->mFillColor, this->mFillPattern));
-      break;
-  }
-  // make the pen width upper rounded, otherwise ellipse is distorted
-  qreal thickness = ceil(mThickness);
-
-  QPen pen(mLineColor, thickness, this->mLinePattern);
-  pen.setCosmetic(true);
-  painter->setPen(pen);
-
   path.addEllipse(boundingRect());
   painter->drawPath(path);
 }
-
-void EllipseAnnotation::addPoint(QPointF point)
-{
-  mExtent.append(point);
-}
-
-void EllipseAnnotation::updateEndPoint(QPointF point)
-{
-  mExtent.back() = point;
-}
-
-void EllipseAnnotation::drawRectangleCornerItems()
-{
-  mIsFinishedCreatingShape = true;
-  for (int i = 0 ; i < this->mExtent.size() ; i++)
-  {
-    QPointF point = this->mExtent.at(i);
-    RectangleCornerItem *rectangleCornerItem = new RectangleCornerItem(point.x(), point.y(), i, this);
-    mRectangleCornerItemsList.append(rectangleCornerItem);
-  }
-  emit updateShapeAnnotation();
-}
-
-QString EllipseAnnotation::getShapeAnnotation()
-{
-  QString annotationString;
-  annotationString.append("Ellipse(");
-
-  if (!mVisible)
-  {
-    annotationString.append("visible=false,");
-  }
-
-  annotationString.append("rotation=").append(QString::number(this->rotation())).append(",");
-
-  annotationString.append("lineColor={");
-  annotationString.append(QString::number(mLineColor.red())).append(",");
-  annotationString.append(QString::number(mLineColor.green())).append(",");
-  annotationString.append(QString::number(mLineColor.blue()));
-  annotationString.append("},");
-
-  annotationString.append("fillColor={");
-  annotationString.append(QString::number(mFillColor.red())).append(",");
-  annotationString.append(QString::number(mFillColor.green())).append(",");
-  annotationString.append(QString::number(mFillColor.blue()));
-  annotationString.append("},");
-
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.value() == mLinePattern)
-    {
-      annotationString.append("pattern=LinePattern.").append(it.key()).append(",");
-      break;
-    }
-  }
-
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = this->mFillPatternsMap.begin(); fill_it != this->mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.value() == mFillPattern)
-    {
-      annotationString.append("fillPattern=FillPattern.").append(fill_it.key()).append(",");
-      break;
-    }
-  }
-
-  annotationString.append("lineThickness=").append(QString::number(mThickness)).append(",");
-  annotationString.append("extent={{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).y())).append("},{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).y()));
-  annotationString.append("}}");
-
-  annotationString.append(")");
-  return annotationString;
-}
-
-void EllipseAnnotation::updatePoint(int index, QPointF point)
-{
-  mExtent.replace(index, point);
-}
-
-void EllipseAnnotation::parseShapeAnnotation(QString shape, OMCProxy *omc)
-{
-  // Remove { } from shape
-
-  shape = shape.replace("{", "");
-  shape = shape.replace("}", "");
-
-  // parse the shape to get the list of attributes of Ellipse.
-  QStringList list = StringHandler::getStrings(shape);
-  if (list.size() < 14)
-  {
-    return;
-  }
-
-  // if first item of list is true then the Ellipse should be visible.
-  this->mVisible = static_cast<QString>(list.at(0)).contains("true");
-
-  int index = 0;
-  mOrigin.setX(static_cast<QString>(list.at(1)).toFloat());
-  mOrigin.setY(static_cast<QString>(list.at(2)).toFloat());
-  mRotation = static_cast<QString>(list.at(3)).toFloat();
-  index = 3;
-  // 2,3,4 items of list contains the line color.
-  index = index + 1;
-  int red, green, blue;
-
-  red = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  green = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  blue = static_cast<QString>(list.at(index)).toInt();
-  this->mLineColor = QColor (red, green, blue);
-
-  // 5,6,7 items of list contains the fill color.
-  index = index + 1;
-  red = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  green = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  blue = static_cast<QString>(list.at(index)).toInt();
-  this->mFillColor = QColor (red, green, blue);
-
-  // 8 item of the list contains the line pattern.
-  index = index + 1;
-  QString linePattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.key().compare(linePattern) == 0)
-    {
-      this->mLinePattern = it.value();
-      break;
-    }
-  }
-
-  // 9 item of the list contains the fill pattern.
-  index = index + 1;
-  QString fillPattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = this->mFillPatternsMap.begin(); fill_it != this->mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.key().compare(fillPattern) == 0)
-    {
-      this->mFillPattern = fill_it.value();
-      break;
-    }
-  }
-
-  // 10 item of the list contains the thickness.
-  index = index + 1;
-  this->mThickness = static_cast<QString>(list.at(index)).toFloat();
-
-  // 11, 12, 13, 14 items of the list contains the extent points of Ellipse.
-  index = index + 1;
-  qreal x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  qreal y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p1 (x, y);
-  index = index + 1;
-  x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p2 (x, y);
-
-  this->mExtent.append(p1);
-  this->mExtent.append(p2);
-}
Index: /branches/OMEdit/OMEditGUI/EllipseAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/EllipseAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/EllipseAnnotation.h	(revision 13537)
@@ -41,11 +41,11 @@
 
 class OMCProxy;
-class Component_OMC;
+class Component;
 
-class EllipseAnnotation_OMC : public ShapeAnnotation_OMC
+class EllipseAnnotation : public ShapeAnnotation
 {
   Q_OBJECT
 public:
-  EllipseAnnotation_OMC(QString annotation, Component_OMC *pParent);
+  EllipseAnnotation(QString annotation, Component *pParent);
   void parseShapeAnnotation(QString annotation);
   QRectF boundingRect() const;
@@ -58,26 +58,3 @@
 };
 
-
-class EllipseAnnotation : public ShapeAnnotation
-{
-  Q_OBJECT
-public:
-  EllipseAnnotation(QString shape, Component *pParent);
-  EllipseAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  EllipseAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  QRectF boundingRect() const;
-  QPainterPath shape() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  void drawEllipseAnnotaion(QPainter *painter);
-  void addPoint(QPointF point);
-  void updateEndPoint(QPointF point);
-  void drawRectangleCornerItems();
-  QString getShapeAnnotation();
-  void parseShapeAnnotation(QString shape, OMCProxy *omc);
-
-  Component *mpComponent;
-public slots:
-  void updatePoint(int index, QPointF point);
-};
-
 #endif // ELLIPSEANNOTATION_H
Index: /branches/OMEdit/OMEditGUI/Helper.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/Helper.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/Helper.cpp	(revision 13537)
@@ -165,4 +165,5 @@
 QString Helper::center;
 QString Helper::right;
+QString Helper::connectArray;
 
 void Helper::initHelperVariables()
@@ -252,4 +253,5 @@
   Helper::center = tr("Center");
   Helper::right = tr("Right");
+  Helper::connectArray = tr("Connect Array");
 }
 
@@ -319,5 +321,5 @@
       return tr("The file <b>%1</b> is not a valid Modelica file. The file format is not supported. You can only open <b>%2</b>.");
     case ENTER_VALID_INTEGER:
-      return tr("Enter a valid Positive Integer");
+      return tr("Enter a valid positive integer index value for <b>%1</b>.");
     case ITEM_DROPPED_ON_ITSELF:
       return tr("You cannot drop an item on itself.");
Index: /branches/OMEdit/OMEditGUI/Helper.h
===================================================================
--- /branches/OMEdit/OMEditGUI/Helper.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/Helper.h	(revision 13537)
@@ -185,4 +185,5 @@
   static QString center;
   static QString right;
+  static QString connectArray;
 };
 
Index: /branches/OMEdit/OMEditGUI/LibraryTreeWidget.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/LibraryTreeWidget.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/LibraryTreeWidget.cpp	(revision 13537)
@@ -572,5 +572,5 @@
 }
 
-Component_OMC* LibraryTreeWidget::getComponentObject(QString className)
+Component* LibraryTreeWidget::getComponentObject(QString className)
 {
   foreach (LibraryComponent *libraryComponent, mLibraryComponentsList)
@@ -839,5 +839,5 @@
   mClassName = className;
   //mpComponent = new Component(value, className, omc->isWhat(StringHandler::CONNECTOR, className), omc);
-  mpComponent = new Component_OMC(value, className, omc);
+  mpComponent = new Component(value, className, omc);
 
   if (mpComponent->boundingRect().width() > 1)
@@ -882,5 +882,5 @@
 }
 
-void LibraryComponent::hasIconAnnotation(Component_OMC *pComponent)
+void LibraryComponent::hasIconAnnotation(Component *pComponent)
 {
   if (!pComponent->getShapesList().isEmpty())
@@ -890,9 +890,9 @@
   else
   {
-    foreach (Component_OMC *inheritedComponent, pComponent->getInheritanceList())
+    foreach (Component *inheritedComponent, pComponent->getInheritanceList())
     {
       hasIconAnnotation(inheritedComponent);
     }
-    foreach (Component_OMC *childComponent, pComponent->getComponentsList())
+    foreach (Component *childComponent, pComponent->getComponentsList())
     {
       hasIconAnnotation(childComponent);
Index: /branches/OMEdit/OMEditGUI/LibraryTreeWidget.h
===================================================================
--- /branches/OMEdit/OMEditGUI/LibraryTreeWidget.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/LibraryTreeWidget.h	(revision 13537)
@@ -41,5 +41,5 @@
 
 class MainWindow;
-class Component_OMC;
+class Component;
 class OMCProxy;
 class LibraryTreeWidget;
@@ -130,5 +130,5 @@
   LibraryTreeNode* getLibraryTreeNode(QString nameStructure);
   void addLibraryComponentObject(LibraryComponent *libraryComponent);
-  Component_OMC *getComponentObject(QString className);
+  Component *getComponentObject(QString className);
   LibraryComponent* getLibraryComponentObject(QString className);
   bool isFileWritAble(QString filePath);
@@ -166,8 +166,8 @@
   ~LibraryComponent();
   QPixmap getComponentPixmap(QSize size);
-  void hasIconAnnotation(Component_OMC *pComponent);
+  void hasIconAnnotation(Component *pComponent);
 
   QString mClassName;
-  Component_OMC *mpComponent;
+  Component *mpComponent;
   QGraphicsView *mpGraphicsView;
   QRectF mRectangle;
Index: /branches/OMEdit/OMEditGUI/LineAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/LineAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/LineAnnotation.cpp	(revision 13537)
@@ -36,12 +36,12 @@
 #include "LineAnnotation.h"
 
-LineAnnotation_OMC::LineAnnotation_OMC(QString annotation, Component_OMC *pParent)
-  : ShapeAnnotation_OMC(pParent)
+LineAnnotation::LineAnnotation(QString annotation, Component *pParent)
+  : ShapeAnnotation(pParent)
 {
   parseShapeAnnotation(annotation);
 }
 
-LineAnnotation_OMC::LineAnnotation_OMC(Component_OMC *pStartComponent, GraphicsView *pGraphicsView)
-  : ShapeAnnotation_OMC(0)
+LineAnnotation::LineAnnotation(Component *pStartComponent, GraphicsView *pGraphicsView)
+  : ShapeAnnotation(0)
 {
   setZValue(-1.0);
@@ -62,5 +62,5 @@
 }
 
-void LineAnnotation_OMC::parseShapeAnnotation(QString annotation)
+void LineAnnotation::parseShapeAnnotation(QString annotation)
 {
   GraphicItem::parseShapeAnnotation(annotation);
@@ -103,5 +103,5 @@
 }
 
-QPainterPath LineAnnotation_OMC::getShape() const
+QPainterPath LineAnnotation::getShape() const
 {
   QPainterPath path;
@@ -154,10 +154,10 @@
 }
 
-QRectF LineAnnotation_OMC::boundingRect() const
+QRectF LineAnnotation::boundingRect() const
 {
   return shape().boundingRect();
 }
 
-QPainterPath LineAnnotation_OMC::shape() const
+QPainterPath LineAnnotation::shape() const
 {
   QPainterPath path = getShape();
@@ -165,5 +165,5 @@
 }
 
-void LineAnnotation_OMC::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void LineAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
   Q_UNUSED(option);
@@ -176,5 +176,5 @@
 }
 
-void LineAnnotation_OMC::drawLineAnnotaion(QPainter *painter)
+void LineAnnotation::drawLineAnnotaion(QPainter *painter)
 {
   applyLinePattern(painter);
@@ -202,5 +202,5 @@
 }
 
-QPolygonF LineAnnotation_OMC::drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const
+QPolygonF LineAnnotation::drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const
 {
   double xA = size / 2;
@@ -257,5 +257,5 @@
 }
 
-QString LineAnnotation_OMC::getShapeAnnotation()
+QString LineAnnotation::getShapeAnnotation()
 {
   QString annotationString;
@@ -294,25 +294,25 @@
 }
 
-void LineAnnotation_OMC::setStartComponent(Component_OMC *pStartComponent)
+void LineAnnotation::setStartComponent(Component *pStartComponent)
 {
   mpStartComponent = pStartComponent;
 }
 
-Component_OMC* LineAnnotation_OMC::getStartComponent()
+Component* LineAnnotation::getStartComponent()
 {
   return mpStartComponent;
 }
 
-void LineAnnotation_OMC::setEndComponent(Component_OMC *pEndComponent)
+void LineAnnotation::setEndComponent(Component *pEndComponent)
 {
   mpEndComponent = pEndComponent;
 }
 
-Component_OMC* LineAnnotation_OMC::getEndComponent()
+Component* LineAnnotation::getEndComponent()
 {
   return mpEndComponent;
 }
 
-void LineAnnotation_OMC::addPoint(QPointF point)
+void LineAnnotation::addPoint(QPointF point)
 {
   //! @todo make it better
@@ -320,33 +320,33 @@
   if(mPoints.size() <= 2 && (fabs(mpStartComponent->getTransformation()->getRotateAngle()) >= 0 && fabs(mpStartComponent->getTransformation()->getRotateAngle()) < 90))
   {
-    mGeometries.push_back(LineAnnotation_OMC::HORIZONTAL);
+    mGeometries.push_back(LineAnnotation::HORIZONTAL);
   }
   else if(mPoints.size() <= 2 && (fabs(mpStartComponent->getTransformation()->getRotateAngle()) >= 90 && fabs(mpStartComponent->getTransformation()->getRotateAngle()) < 180))
   {
-    mGeometries.push_back(LineAnnotation_OMC::VERTICAL);
+    mGeometries.push_back(LineAnnotation::VERTICAL);
   }
   else if(mPoints.size() <= 2 && (fabs(mpStartComponent->getTransformation()->getRotateAngle()) >= 180 && fabs(mpStartComponent->getTransformation()->getRotateAngle()) < 270))
   {
-    mGeometries.push_back(LineAnnotation_OMC::HORIZONTAL);
+    mGeometries.push_back(LineAnnotation::HORIZONTAL);
   }
   else if(mPoints.size() <= 2 && (fabs(mpStartComponent->getTransformation()->getRotateAngle()) >= 270 && fabs(mpStartComponent->getTransformation()->getRotateAngle()) < 360))
   {
-    mGeometries.push_back(LineAnnotation_OMC::VERTICAL);
+    mGeometries.push_back(LineAnnotation::VERTICAL);
   }
   else if (mPoints.size() <= 2)
   {
-    mGeometries.push_back(LineAnnotation_OMC::HORIZONTAL);
-  }
-  else if(mPoints.size() > 2 && mGeometries.back() == LineAnnotation_OMC::HORIZONTAL)
-  {
-    mGeometries.push_back(LineAnnotation_OMC::VERTICAL);
-  }
-  else if(mPoints.size() > 2 && mGeometries.back() == LineAnnotation_OMC::VERTICAL)
-  {
-    mGeometries.push_back(LineAnnotation_OMC::HORIZONTAL);
-  }
-  else if(mPoints.size() > 2 && mGeometries.back() == LineAnnotation_OMC::DIAGONAL)
-  {
-    mGeometries.push_back(LineAnnotation_OMC::DIAGONAL);
+    mGeometries.push_back(LineAnnotation::HORIZONTAL);
+  }
+  else if(mPoints.size() > 2 && mGeometries.back() == LineAnnotation::HORIZONTAL)
+  {
+    mGeometries.push_back(LineAnnotation::VERTICAL);
+  }
+  else if(mPoints.size() > 2 && mGeometries.back() == LineAnnotation::VERTICAL)
+  {
+    mGeometries.push_back(LineAnnotation::HORIZONTAL);
+  }
+  else if(mPoints.size() > 2 && mGeometries.back() == LineAnnotation::DIAGONAL)
+  {
+    mGeometries.push_back(LineAnnotation::DIAGONAL);
     //Give new line correct angle!
   }
@@ -356,5 +356,5 @@
 //! @param point is the new start point.
 //! @see updateEndPoint(QPointF point)
-void LineAnnotation_OMC::updateStartPoint(QPointF point)
+void LineAnnotation::updateStartPoint(QPointF point)
 {
   if (mPoints.size() == 0)
@@ -364,21 +364,21 @@
   if (mPoints.size() != 1)
   {
-    if (mGeometries[0] == LineAnnotation_OMC::HORIZONTAL)
+    if (mGeometries[0] == LineAnnotation::HORIZONTAL)
       mPoints[1] = QPointF(mPoints[1].x(),mPoints[0].y());
-    else if (mGeometries[0] == LineAnnotation_OMC::VERTICAL)
+    else if (mGeometries[0] == LineAnnotation::VERTICAL)
       mPoints[1] = QPointF(mPoints[0].x(),mPoints[1].y());
   }
 }
 
-void LineAnnotation_OMC::updateEndPoint(QPointF point)
+void LineAnnotation::updateEndPoint(QPointF point)
 {
   mPoints.back() = point;
-  if (mGeometries.back() == LineAnnotation_OMC::HORIZONTAL)
+  if (mGeometries.back() == LineAnnotation::HORIZONTAL)
     mPoints[mPoints.size()-2] = QPointF(mPoints[mPoints.size()-2].x(),point.y());
-  else if (mGeometries.back() == LineAnnotation_OMC::VERTICAL)
+  else if (mGeometries.back() == LineAnnotation::VERTICAL)
     mPoints[mPoints.size()-2] = QPointF(point.x(),mPoints[mPoints.size()-2].y());
 }
 
-void LineAnnotation_OMC::moveAllPoints(qreal offsetX, qreal offsetY)
+void LineAnnotation::moveAllPoints(qreal offsetX, qreal offsetY)
 {
   for(int i=0; i != mPoints.size(); ++i)
@@ -388,5 +388,25 @@
 }
 
-void LineAnnotation_OMC::handleComponentMoved()
+void LineAnnotation::setStartComponentName(QString name)
+{
+  mStartComponentName = name;
+}
+
+QString LineAnnotation::getStartComponentName()
+{
+  return mStartComponentName;
+}
+
+void LineAnnotation::setEndComponentName(QString name)
+{
+  mEndComponentName = name;
+}
+
+QString LineAnnotation::getEndComponentName()
+{
+  return mEndComponentName;
+}
+
+void LineAnnotation::handleComponentMoved()
 {
   if (mPoints.size() < 2)
@@ -406,402 +426,132 @@
 }
 
-void LineAnnotation_OMC::updateConnectionAnnotation()
+void LineAnnotation::updateConnectionAnnotation()
 {
   // get the connection line annotation.
   QString annotationString = QString("annotate=").append(getShapeAnnotation());
-  // get the connected components names.
-  QString startComponentName, endComponentName;
-  if (mpStartComponent->getParentComponent())
-    startComponentName = QString(mpStartComponent->getParentComponent()->getName()).append(".").append(mpStartComponent->getComponentInfo()->getName());
-  else
-    startComponentName = mpStartComponent->getName();
-  if (mpEndComponent->getParentComponent())
-    endComponentName = QString(mpEndComponent->getParentComponent()->getName()).append(".").append(mpEndComponent->getComponentInfo()->getName());
-  else
-    endComponentName = mpEndComponent->getName();
   // update the connection
   OMCProxy *pOMCProxy = mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy();
-  pOMCProxy->updateConnection(startComponentName, endComponentName, mpGraphicsView->getModelWidget()->getLibraryTreeNode()->getNameStructure(), annotationString);
-}
-
-
-
-LineAnnotation::LineAnnotation(QString shape, Component *pParent)
-  : ShapeAnnotation(pParent), mpComponent(pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  parseShapeAnnotation(shape);
-}
-
-LineAnnotation::LineAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-LineAnnotation::LineAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  parseShapeAnnotation(shape);
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-QPainterPath LineAnnotation::getShape() const
-{
-  QPainterPath path;
-
-  if (this->mPoints.size() > 0)
-  {
-    if (mSmooth)
+  pOMCProxy->updateConnection(getStartComponentName(), getEndComponentName(),
+                              mpGraphicsView->getModelWidget()->getLibraryTreeNode()->getNameStructure(), annotationString);
+}
+
+ConnectionArray::ConnectionArray(GraphicsView *pGraphicsView, LineAnnotation *pConnectionLineAnnotation, QWidget *pParent)
+  : QDialog(pParent, Qt::WindowTitleHint), mpGraphicsView(pGraphicsView), mpConnectionLineAnnotation(pConnectionLineAnnotation)
+{
+  setWindowTitle(QString(Helper::applicationName).append(" - ").append(Helper::connectArray));
+  setAttribute(Qt::WA_DeleteOnClose);
+  setMinimumSize(375, 140);
+  setModal(true);
+  // heading
+  mpHeading = new Label(Helper::connectArray);
+  mpHeading->setFont(QFont("", Helper::headingFontSize));
+  mpHeading->setAlignment(Qt::AlignTop);
+  // horizontal line
+  mpHorizontalLine = new QFrame();
+  mpHorizontalLine->setFrameShape(QFrame::HLine);
+  mpHorizontalLine->setFrameShadow(QFrame::Sunken);
+  // Description text
+  QString startComponentDescription = QString("<b>").append(pConnectionLineAnnotation->getStartComponent()->getParentComponent()->getName())
+      .append(".").append(pConnectionLineAnnotation->getStartComponent()->getName()).append("</b>");
+  if (pConnectionLineAnnotation->getStartComponent()->getComponentInfo()->isArray())
+    startComponentDescription.append("<b>[index]</b>");
+  QString endComponentDescription = QString("<b>").append(pConnectionLineAnnotation->getEndComponent()->getParentComponent()->getName())
+      .append(".").append(pConnectionLineAnnotation->getEndComponent()->getName()).append("</b>");
+  if (pConnectionLineAnnotation->getEndComponent()->getComponentInfo()->isArray())
+    endComponentDescription.append("<b>[index]</b>");
+  mpDescriptionLabel = new Label(QString("Connect ").append(startComponentDescription).append(" with ").append(endComponentDescription));
+  // start component
+  QIntValidator *pIntValidator = new QIntValidator(this);
+  pIntValidator->setBottom(0);
+  mpStartComponentLabel = new Label(tr("Enter <b>index</b> value for <b>").append(pConnectionLineAnnotation->getStartComponent()->getParentComponent()->getName())
+                                    .append(".").append(pConnectionLineAnnotation->getStartComponent()->getName()).append("<b>"));
+  mpStartComponentTextBox = new QLineEdit;
+  mpStartComponentTextBox->setValidator(pIntValidator);
+  // start component
+  mpEndComponentLabel = new Label(tr("Enter <b>index</b> value for <b>").append(pConnectionLineAnnotation->getEndComponent()->getParentComponent()->getName())
+                                  .append(".").append(pConnectionLineAnnotation->getEndComponent()->getComponentInfo()->getName()).append("</b>"));
+  mpEndComponentTextBox = new QLineEdit;
+  mpEndComponentTextBox->setValidator(pIntValidator);
+  // Create the buttons
+  mpOkButton = new QPushButton(Helper::ok);
+  mpOkButton->setAutoDefault(true);
+  connect(mpOkButton, SIGNAL(clicked()), SLOT(saveArrayIndex()));
+  mpCancelButton = new QPushButton(Helper::cancel);
+  mpCancelButton->setAutoDefault(false);
+  connect(mpCancelButton, SIGNAL(clicked()), SLOT(cancelArrayIndex()));
+  // add buttons
+  mpButtonBox = new QDialogButtonBox(Qt::Horizontal);
+  mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole);
+  mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);
+  // Create a layout
+  QGridLayout *mainLayout = new QGridLayout;
+  mainLayout->addWidget(mpHeading, 0, 0);
+  mainLayout->addWidget(mpHorizontalLine, 1, 0);
+  mainLayout->addWidget(mpDescriptionLabel, 2, 0);
+  int i = 3;
+  if (pConnectionLineAnnotation->getStartComponent()->getComponentInfo()->isArray())
+  {
+    mainLayout->addWidget(mpStartComponentLabel, i, 0);
+    mainLayout->addWidget(mpStartComponentTextBox, i+1, 0);
+    i = i + 2;
+  }
+  if (pConnectionLineAnnotation->getEndComponent()->getComponentInfo()->isArray())
+  {
+    mainLayout->addWidget(mpEndComponentLabel, i, 0);
+    mainLayout->addWidget(mpEndComponentTextBox, i+1, 0);
+    i = i + 2;
+  }
+  mainLayout->addWidget(mpButtonBox, i, 0);
+  setLayout(mainLayout);
+}
+
+void ConnectionArray::saveArrayIndex()
+{
+  QString startComponentName, endComponentName;
+  // set start component name
+  if (mpConnectionLineAnnotation->getStartComponent()->getComponentInfo()->isArray())
+  {
+    startComponentName = QString(mpConnectionLineAnnotation->getStartComponent()->getParentComponent()->getName()).append(".")
+        .append(mpConnectionLineAnnotation->getStartComponent()->getName());
+    if (mpStartComponentTextBox->text().isEmpty())
     {
-      for (int i = 0 ; i < this->mPoints.size() ; i++)
-      {
-        QPointF point3 = this->mPoints.at(i);
-        if (i == 0)
-          path.moveTo(point3);
-        else
-        {
-          // if points are only two then spline acts as simple line
-          if (i < 2)
-          {
-            if (mPoints.size() < 3)
-              path.lineTo(point3);
-          }
-          else
-          {
-            // calculate middle points for bezier curves
-            QPointF point2 = this->mPoints.at(i - 1);
-            QPointF point1 = this->mPoints.at(i - 2);
-            QPointF point12((point1.x() + point2.x())/2, (point1.y() + point2.y())/2);
-            QPointF point23((point2.x() + point3.x())/2, (point2.y() + point3.y())/2);
-
-            path.lineTo(point12);
-            path.cubicTo(point12, point2, point23);
-            // if its the last point
-            if (i == mPoints.size() - 1)
-              path.lineTo(point3);
-          }
-        }
-      }
-    }
-    else
-    {
-      for (int i = 0 ; i < this->mPoints.size() ; i++)
-      {
-        QPointF point1 = this->mPoints.at(i);
-        if (i == 0)
-          path.moveTo(point1);
-        else
-          path.lineTo(point1);
-      }
-    }
-  }
-  return path;
-}
-
-QRectF LineAnnotation::boundingRect() const
-{
-  return shape().boundingRect();
-}
-
-QPainterPath LineAnnotation::shape() const
-{
-  QPainterPath path = getShape();
-  return addPathStroker(path);
-}
-
-void LineAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-
-  if (transformOriginPoint() != boundingRect().center())
-  {
-    setTransformOriginPoint(boundingRect().center());
-  }
-  drawLineAnnotaion(painter);
-}
-
-void LineAnnotation::drawLineAnnotaion(QPainter *painter)
-{
-  qreal thickness;
-
-  // make the pen width upper rounded for spline, otherwise spline is distorted
-  thickness = ceil(mThickness);
-  // this is commented intentionally so that we dont need path stroker. Also helps in svg rendering
-  //    if (mSmooth)
-  //        thickness = ceil(mThickness);
-  //    else
-  //        thickness = mThickness;
-
-  QPen pen(this->mLineColor, thickness, this->mLinePattern);
-  pen.setCosmetic(true);
-  painter->setPen(pen);
-  // draw start arrow
-  if (mStartArrow == ShapeAnnotation::Filled)
-  {
-    painter->save();
-    painter->setBrush(QBrush(mLineColor, Qt::SolidPattern));
-    painter->drawPolygon(drawArrow(mPoints.at(0), mPoints.at(1), mArrowSize * 2, mStartArrow));
-    painter->restore();
-  }
-  else
-    painter->drawPolygon(drawArrow(mPoints.at(0), mPoints.at(1), mArrowSize * 2, mStartArrow));
-
-  painter->drawPath(getShape());
-
-  // draw end arrow
-  if (mEndArrow == ShapeAnnotation::Filled)
-  {
-    painter->save();
-    painter->setBrush(QBrush(mLineColor, Qt::SolidPattern));
-    painter->drawPolygon(drawArrow(mPoints.at(mPoints.size() - 1), mPoints.at(mPoints.size() - 2),
-                                   mArrowSize * 2, mEndArrow));
-    painter->restore();
-  }
-  else
-    painter->drawPolygon(drawArrow(mPoints.at(mPoints.size() - 1), mPoints.at(mPoints.size() - 2),
-                                   mArrowSize * 2, mEndArrow));
-}
-
-void LineAnnotation::addPoint(QPointF point)
-{
-  mPoints.append(point);
-}
-
-void LineAnnotation::updateEndPoint(QPointF point)
-{
-  mPoints.back() = point;
-}
-
-void LineAnnotation::drawRectangleCornerItems()
-{
-  mIsFinishedCreatingShape = true;
-  // remove the last point since mouse double click event has added an extra point to it.....
-  mPoints.remove(mPoints.size() - 1);
-  for (int i = 0 ; i < this->mPoints.size() ; i++)
-  {
-    QPointF point = this->mPoints.at(i);
-    RectangleCornerItem *rectangleCornerItem = new RectangleCornerItem(point.x(), point.y(), i, this);
-    mRectangleCornerItemsList.append(rectangleCornerItem);
-  }
-  emit updateShapeAnnotation();
-}
-
-QString LineAnnotation::getShapeAnnotation()
-{
-  QString annotationString;
-  annotationString.append("Line(");
-
-  if (!mVisible)
-  {
-    annotationString.append("visible=false,");
-  }
-
-  annotationString.append("points={");
-  for (int i = 0 ; i < mPoints.size() ; i++)
-  {
-    annotationString.append("{").append(QString::number(mapToScene(mPoints[i]).x())).append(",");
-    annotationString.append(QString::number(mapToScene(mPoints[i]).y())).append("}");
-    if (i < mPoints.size() - 1)
-      annotationString.append(",");
-  }
-  annotationString.append("},");
-
-  annotationString.append("rotation=").append(QString::number(this->rotation())).append(",");
-
-  annotationString.append("color={");
-  annotationString.append(QString::number(mLineColor.red())).append(",");
-  annotationString.append(QString::number(mLineColor.green())).append(",");
-  annotationString.append(QString::number(mLineColor.blue()));
-  annotationString.append("},");
-
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.value() == mLinePattern)
-    {
-      annotationString.append("pattern=LinePattern.").append(it.key()).append(",");
-      break;
-    }
-  }
-
-  annotationString.append("thickness=").append(QString::number(mThickness));
-  if (mSmooth)
-  {
-    annotationString.append(",smooth=Smooth.Bezier");
-  }
-
-  annotationString.append(")");
-  return annotationString;
-}
-
-void LineAnnotation::updatePoint(int index, QPointF point)
-{
-  mPoints.replace(index, point);
-}
-
-void LineAnnotation::parseShapeAnnotation(QString shape)
-{
-  // parse the shape to get the list of attributes of Line.
-  QStringList list = StringHandler::getStrings(shape);
-  if (list.size() < 8)
-  {
-    return;
-  }
-
-  // if first item of list is true then the Line should be visible.
-  this->mVisible = static_cast<QString>(list.at(0)).contains("true");
-
-  int index = 0;
-  QStringList originList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(1)));
-  mOrigin.setX(static_cast<QString>(originList.at(0)).toFloat());
-  mOrigin.setY(static_cast<QString>(originList.at(1)).toFloat());
-  mRotation = static_cast<QString>(list.at(2)).toFloat();
-  index = 2;
-  // second item of list contains the points.
-  index = index + 1;
-  QStringList pointsList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(index)));
-
-  foreach (QString point, pointsList)
-  {
-    QStringList linePoints = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(point));
-    if (linePoints.size() < 2)
-    {
+      QMessageBox::critical(mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow(),
+                            QString(Helper::applicationName).append(" - ").append(Helper::error),
+                            GUIMessages::getMessage(GUIMessages::ENTER_VALID_INTEGER).arg(startComponentName), Helper::ok);
       return;
     }
-
-    qreal x = static_cast<QString>(linePoints.at(0)).toFloat();
-    qreal y = static_cast<QString>(linePoints.at(1)).toFloat();
-    QPointF p (x, y);
-    this->mPoints.append(p);
-  }
-
-  // third item of list contains the color.
-  index = index + 1;
-  QStringList colorList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(index)));
-  if (colorList.size() < 3)
-  {
-    return;
-  }
-
-  int red = static_cast<QString>(colorList.at(0)).toInt();
-  int green = static_cast<QString>(colorList.at(1)).toInt();
-  int blue = static_cast<QString>(colorList.at(2)).toInt();
-
-  this->mLineColor = QColor (red, green, blue);
-
-  // fourth item of list contains the Line Pattern.
-  index = index + 1;
-  QString linePattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.key().compare(linePattern) == 0)
+    startComponentName = QString(startComponentName).append("[").append(mpStartComponentTextBox->text()).append("]");
+  }
+  else
+  {
+    startComponentName = QString(mpConnectionLineAnnotation->getStartComponent()->getParentComponent()->getName()).append(".")
+        .append(mpConnectionLineAnnotation->getStartComponent()->getName());
+  }
+  // set end component name
+  if (mpConnectionLineAnnotation->getEndComponent()->getComponentInfo()->isArray())
+  {
+    endComponentName = QString(mpConnectionLineAnnotation->getEndComponent()->getParentComponent()->getName()).append(".")
+        .append(mpConnectionLineAnnotation->getEndComponent()->getName());
+    if (mpEndComponentTextBox->text().isEmpty())
     {
-      this->mLinePattern = it.value();
-      break;
+      QMessageBox::critical(mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow(),
+                            QString(Helper::applicationName).append(" - ").append(Helper::error),
+                            GUIMessages::getMessage(GUIMessages::ENTER_VALID_INTEGER).arg(endComponentName), Helper::ok);
+      return;
     }
-  }
-
-  // fifth item of list contains the Line thickness.
-  index = index + 1;
-  this->mThickness = static_cast<QString>(list.at(index)).toFloat();
-
-  // sixth item of list contains the Line Arrows.
-  index = index + 1;
-  QStringList arrowList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(index)));
-  if (arrowList.size() < 2)
-    return;
-
-  QMap<QString, ArrowType>::iterator arrow_it;
-  for (arrow_it = mArrowsMap.begin(); arrow_it != mArrowsMap.end(); ++arrow_it)
-  {
-    if (arrow_it.key().compare(StringHandler::getLastWordAfterDot(arrowList.at(0))) == 0)
-      mStartArrow = arrow_it.value();
-    if (arrow_it.key().compare(StringHandler::getLastWordAfterDot(arrowList.at(1))) == 0)
-      mEndArrow = arrow_it.value();
-  }
-
-  // seventh item of list contains the Line Arrow Size.
-  index = index + 1;
-  mArrowSize = static_cast<QString>(list.at(index)).toFloat();
-
-  // eighth item of list contains the smooth.
-  index = index + 1;
-  this->mSmooth = static_cast<QString>(list.at(index)).toLower().contains("smooth.bezier");
-}
-
-QPolygonF LineAnnotation::drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const
-{
-  double xA = size / 2;
-  double yA = size * sqrt(3) / 2;
-
-  double xB = -xA;
-  double yB = yA;
-
-  switch (arrowType)
-  {
-    case ShapeAnnotation::Filled:
-      break;
-    case ShapeAnnotation::Half:
-      xB = 0;
-      break;
-    case ShapeAnnotation::None:
-      return QPolygonF();
-    case ShapeAnnotation::Open:
-      break;
-  }
-
-  double angle = 0.0f;
-  if (endPos.x() - startPos.x() == 0)
-  {
-    if (endPos.y() - startPos.y() >= 0)
-      angle = 0;
-    else
-      angle = M_PI;
-  }
-  else
-  {
-    angle = -(M_PI / 2 - (atan((endPos.y() - startPos.y())/(endPos.x() - startPos.x()))));
-    if(startPos.x() > endPos.x())
-      angle += M_PI;
-  }
-
-  qreal m11, m12, m13, m21, m22, m23, m31, m32, m33;
-
-  m11 = cos(angle);
-  m12 = -sin(angle);
-  m13 = startPos.x();
-  m21 = sin(angle);
-  m22 = cos(angle);
-  m23 = startPos.y();
-  m31 = 0;
-  m32 = 0;
-  m33 = 1;
-
-  QTransform t1(m11, m12, m13, m21, m22, m23, m31, m32, m33);
-  QTransform t2(xA, 1, 1, yA, 1, 1, 1, 1, 1);
-  QTransform t3 = t1 * t2;
-
-  QPolygonF polygon;
-  polygon << startPos;
-  polygon << QPointF(t3.m11(), t3.m21());
-
-  t2.setMatrix(xB, 1, 1, yB, 1, 1, 1, 1, 1);
-  t3 = t1 * t2;
-
-  polygon << QPointF(t3.m11(), t3.m21());
-  polygon << startPos;
-
-  return polygon;
-}
+    endComponentName = QString(endComponentName).append("[").append(mpEndComponentTextBox->text()).append("]");
+  }
+  else
+  {
+    endComponentName = QString(mpConnectionLineAnnotation->getEndComponent()->getParentComponent()->getName()).append(".")
+        .append(mpConnectionLineAnnotation->getEndComponent()->getName());
+  }
+  mpGraphicsView->createConnection(startComponentName, endComponentName);
+  accept();
+}
+
+void ConnectionArray::cancelArrayIndex()
+{
+  mpGraphicsView->removeConnection();
+  reject();
+}
Index: /branches/OMEdit/OMEditGUI/LineAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/LineAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/LineAnnotation.h	(revision 13537)
@@ -42,13 +42,13 @@
 class RectangleCornerItem;
 class ShapeAnnotation;
-class Component_OMC;
+class Component;
 
-class LineAnnotation_OMC : public ShapeAnnotation_OMC
+class LineAnnotation : public ShapeAnnotation
 {
   Q_OBJECT
 public:
   enum geometryType {VERTICAL, HORIZONTAL, DIAGONAL};
-  LineAnnotation_OMC(QString annotation, Component_OMC *pParent);
-  LineAnnotation_OMC(Component_OMC *pStartComponent, GraphicsView *pGraphicsView);
+  LineAnnotation(QString annotation, Component *pParent);
+  LineAnnotation(Component *pStartComponent, GraphicsView *pGraphicsView);
   void parseShapeAnnotation(QString annotation);
   QPainterPath getShape() const;
@@ -59,18 +59,24 @@
   QPolygonF drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const;
   QString getShapeAnnotation();
-  void setStartComponent(Component_OMC *pStartComponent);
-  Component_OMC* getStartComponent();
-  void setEndComponent(Component_OMC *pEndComponent);
-  Component_OMC* getEndComponent();
+  void setStartComponent(Component *pStartComponent);
+  Component* getStartComponent();
+  void setEndComponent(Component *pEndComponent);
+  Component* getEndComponent();
   void addPoint(QPointF point);
   void updateStartPoint(QPointF point);
   void updateEndPoint(QPointF point);
   void moveAllPoints(qreal offsetX, qreal offsetY);
+  void setStartComponentName(QString name);
+  QString getStartComponentName();
+  void setEndComponentName(QString name);
+  QString getEndComponentName();
 private:
   QList<StringHandler::Arrow> mArrow;
   qreal mArrowSize;
   GraphicsView *mpGraphicsView;
-  Component_OMC *mpStartComponent;
-  Component_OMC *mpEndComponent;
+  Component *mpStartComponent;
+  QString mStartComponentName;
+  Component *mpEndComponent;
+  QString mEndComponentName;
   QList<geometryType> mGeometries;
 public slots:
@@ -79,27 +85,25 @@
 };
 
-
-class LineAnnotation : public ShapeAnnotation
+class ConnectionArray : public QDialog
 {
   Q_OBJECT
 public:
-  LineAnnotation(QString shape, Component *pParent);
-  LineAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  LineAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  QPainterPath getShape() const;
-  QRectF boundingRect() const;
-  QPainterPath shape() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  void drawLineAnnotaion(QPainter *painter);
-  void addPoint(QPointF point);
-  void updateEndPoint(QPointF point);
-  void drawRectangleCornerItems();
-  QString getShapeAnnotation();
-  void parseShapeAnnotation(QString annotation);
-  QPolygonF drawArrow(QPointF startPos, QPointF endPos, qreal size, int arrowType) const;
-
-  Component *mpComponent;
+  ConnectionArray(GraphicsView *pGraphicsView, LineAnnotation *pConnectionLineAnnotation, QWidget *pParent = 0);
+private:
+  GraphicsView *mpGraphicsView;
+  LineAnnotation *mpConnectionLineAnnotation;
+  Label *mpHeading;
+  QFrame *mpHorizontalLine;
+  Label *mpDescriptionLabel;
+  Label *mpStartComponentLabel;
+  QLineEdit *mpStartComponentTextBox;
+  Label *mpEndComponentLabel;
+  QLineEdit *mpEndComponentTextBox;
+  QPushButton *mpOkButton;
+  QPushButton *mpCancelButton;
+  QDialogButtonBox *mpButtonBox;
 public slots:
-  void updatePoint(int index, QPointF point);
+  void saveArrayIndex();
+  void cancelArrayIndex();
 };
 
Index: /branches/OMEdit/OMEditGUI/ModelWidgetContainer.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/ModelWidgetContainer.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/ModelWidgetContainer.cpp	(revision 13537)
@@ -133,17 +133,6 @@
   setIsCreatingConnection(false);
   mIsMovingComponents = false;
-
-
-
-
-  mIsCreatingLine = false;
-  mIsCreatingPolygon = false;
-  mIsCreatingRectangle = false;
-  mIsCreatingEllipse = false;
-  mIsCreatingText = false;
-  mIsCreatingBitmap = false;
   mCustomScale = false;
   createActions();
-  createMenus();
 }
 
@@ -380,6 +369,6 @@
   else
     annotation = pMainWindow->getOMCProxy()->getIconAnnotation(className);
-  Component_OMC *pComponent;
-  pComponent = new Component_OMC(annotation, name, className, type, transformationString, point, pMainWindow->getOMCProxy(), this);
+  Component *pComponent;
+  pComponent = new Component(annotation, name, className, type, transformationString, point, pMainWindow->getOMCProxy(), this);
   // unselect all items
   foreach (QGraphicsItem *pItem, items())
@@ -391,8 +380,8 @@
     addComponentObject(pComponent);
   else
-    mComponents_OMCList.append(pComponent);
-}
-
-void GraphicsView::addComponentObject(Component_OMC *pComponent)
+    mComponentsList.append(pComponent);
+}
+
+void GraphicsView::addComponentObject(Component *pComponent)
 {
   MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
@@ -403,60 +392,5 @@
   mpModelWidget->getModelicaTextWidget()->getModelicaTextEdit()->document()->setModified(true);
   // add the component to the local list
-  mComponents_OMCList.append(pComponent);
-}
-
-void GraphicsView::addComponentoView(QString name, QString className, QString transformationString, QPointF point, bool isConnector,
-                                     bool addObject, bool diagram)
-{
-  MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
-  // Check if the icon is already loaded.
-  Component *oldComponent = 0;//pMainWindow->getLibraryTreeWidget()->getComponentObject(className);
-  Component *newComponent;
-
-  // if the item is a connector then we need to get the diagram annotation of it
-  if (diagram)
-  {
-    QString result = pMainWindow->getOMCProxy()->getDiagramAnnotation(className);
-    newComponent = new Component(result, name, className, transformationString, point, isConnector, pMainWindow->getOMCProxy(), this);
-  }
-  else
-  {
-    if (!oldComponent)
-    {
-      LibraryComponent *libComponent;
-      QString result = pMainWindow->getOMCProxy()->getIconAnnotation(className);
-      libComponent = new LibraryComponent(result, className, pMainWindow->getOMCProxy());
-      // add the component to library widget components lists
-      pMainWindow->getLibraryTreeWidget()->addLibraryComponentObject(libComponent);
-      // create a new component now.
-      newComponent = new Component(result, name, className, transformationString, point, isConnector, pMainWindow->getOMCProxy(), this);
-    }
-    else
-    {
-      newComponent = new Component(oldComponent, name, transformationString, point, isConnector, this);
-    }
-  }
-  if (addObject)
-    addComponentObject(newComponent);
-  else
-    mComponentsList.append(newComponent);
-}
-
-void GraphicsView::addComponentObject(Component *component)
-{
-  MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
-  // Add the component to model in OMC Global Scope.
-  pMainWindow->getOMCProxy()->addComponent(component->getName(), component->getClassName(), mpModelWidget->getLibraryTreeNode()->getNameStructure(), "");
-  // add the annotations of icon
-  if (component->getIsConnector())
-    component->updateAnnotationString(true);
-  else
-    component->updateAnnotationString(false);
-  // only update the modelicatext of model if its a diagram view
-  // for icon view the modeltext is updated in updateannotationstring->addclassannotation
-  if (mViewType == StringHandler::DIAGRAM)
-    mpModelWidget->getModelicaTextWidget()->getModelicaTextEdit()->setPlainText(pMainWindow->getOMCProxy()->list(mpModelWidget->getLibraryTreeNode()->getNameStructure()));
-  // add the component to the local list
-  mComponentsList.append(component);
+  mComponentsList.append(pComponent);
 }
 
@@ -465,5 +399,5 @@
 //! @param update flag is used to check whether we need to update the modelica editor text or not.
 //! @see deleteAllComponentObjects()
-void GraphicsView::deleteComponent_OMCObject(Component_OMC *pComponent)
+void GraphicsView::deleteComponentObject(Component *pComponent)
 {
   // First Remove the Connector associated to this icon
@@ -483,5 +417,5 @@
   }
   // remove the icon now from local list
-  mComponents_OMCList.removeOne(pComponent);
+  mComponentsList.removeOne(pComponent);
   OMCProxy *pOMCProxy = mpModelWidget->getModelWidgetContainer()->getMainWindow()->getOMCProxy();
   // delete the component from OMC
@@ -489,51 +423,7 @@
 }
 
-//! Delete the component and its corresponding connectors from the components list and OMC.
-//! @param component is the object to be deleted.
-//! @param update flag is used to check whether we need to update the modelica editor text or not.
-//! @see deleteAllComponentObjects()
-void GraphicsView::deleteComponentObject(Component *component, bool update)
-{
-  // First Remove the Connector associated to this icon
-  int i = 0;
-  while(i != mConnectorsVector.size())
-  {
-    if((mConnectorsVector[i]->getStartComponent()->getParentComponent()->getName() == component->getName()) or
-       (mConnectorsVector[i]->getEndComponent()->getParentComponent()->getName() == component->getName()))
-    {
-      removeConnector(mConnectorsVector[i], update);
-      i = 0;   //Restart iteration if map has changed
-    }
-    else
-    {
-      ++i;
-    }
-  }
-  // remove the icon now from local list
-  mComponentsList.removeOne(component);
-  OMCProxy *pOMCProxy = mpModelWidget->getModelWidgetContainer()->getMainWindow()->getOMCProxy();
-  // delete the component from OMC
-  pOMCProxy->deleteComponent(component->getName(), mpModelWidget->getLibraryTreeNode()->getNameStructure());
-  if (update)
-  {
-    mpModelWidget->getModelicaTextWidget()->getModelicaTextEdit()->setPlainText(pOMCProxy->list(mpModelWidget->getLibraryTreeNode()->getNameStructure()));
-    //mpModelWidget->getModelWidgetContainer()->getMainWindow()->getModelBrowserTreeWidget()->updateModelBrowserTreeWidget();
-  }
-}
-
-//! Delete all the component and their corresponding connectors from the model.
-//! @see deleteComponentObject(Component *component, bool update)
-void GraphicsView::deleteAllComponentObjects()
-{
-  mComponentsList.clear();
-  //    foreach (Component *component, mComponentsList)
-  //    {
-  //        component->deleteMe(false);
-  //    }
-}
-
-Component_OMC* GraphicsView::getComponent_OMCObject(QString componentName)
-{
-  foreach (Component_OMC *component, mComponents_OMCList)
+Component* GraphicsView::getComponentObject(QString componentName)
+{
+  foreach (Component *component, mComponentsList)
   {
     if (component->getName() == componentName)
@@ -543,19 +433,9 @@
 }
 
-Component* GraphicsView::getComponentObject(QString componentName)
-{
-  foreach (Component *component, mComponentsList)
-  {
-    if (component->getName() == componentName)
-      return component;
-  }
-  return 0;
-}
-
 QString GraphicsView::getUniqueComponentName(QString componentName, int number)
 {
   QString name;
   name = QString(componentName).append(QString::number(number));
-  foreach (Component_OMC *pComponent, mComponents_OMCList)
+  foreach (Component *pComponent, mComponentsList)
   {
     if (pComponent->getName().compare(name, Qt::CaseSensitive) == 0)
@@ -570,5 +450,5 @@
 bool GraphicsView::checkComponentName(QString componentName)
 {
-  foreach (Component_OMC *pComponent, mComponents_OMCList)
+  foreach (Component *pComponent, mComponentsList)
     if (pComponent->getName().compare(componentName, Qt::CaseSensitive) == 0)
       return false;
@@ -576,44 +456,9 @@
 }
 
-void GraphicsView::addShapeObject(ShapeAnnotation *shape)
-{
-  mShapesList.append(shape);
-}
-
-void GraphicsView::deleteShapeObject(ShapeAnnotation *shape)
-{
-  mShapesList.removeOne(shape);
-}
-
-void GraphicsView::deleteAllShapesObject()
-{
-  mShapesList.clear();
-  //    foreach (ShapeAnnotation *shape, mShapesList)
-  //    {
-  //        shape->deleteMe();
-  //    }
-}
-
-void GraphicsView::removeAllConnectors()
-{
-  mConnectorsVector.clear();
-  //    int i = 0;
-  //    while(i != mConnectorsVector.size())
-  //    {
-  //        removeConnector(mConnectorsVector[i], false);
-  //        i = 0;   //Restart iteration if map has changed
-  //    }
-}
-
 //! Defines what happens when the mouse is moving in a GraphicsView.
 //! @param event contains information of the mouse moving operation.
 void GraphicsView::mouseMoveEvent(QMouseEvent *event)
 {
-  // don't send mouse move events to items if we are creating something
-  if (!mIsCreatingLine and !mIsCreatingPolygon and !mIsCreatingRectangle
-      and !mIsCreatingEllipse and !mIsCreatingText and !mIsCreatingBitmap)
-  {
-    QGraphicsView::mouseMoveEvent(event);
-  }
+  QGraphicsView::mouseMoveEvent(event);
   //If creating connector, the end port shall be updated to the mouse position.
   if (isCreatingConnection())
@@ -621,40 +466,4 @@
     mpConnectionLineAnnotation->updateEndPoint(mapToScene(event->pos()));
     mpConnectionLineAnnotation->update();
-  }
-  //If creating line shape, the end points shall be updated to the mouse position.
-  else if (mIsCreatingLine)
-  {
-    mpLineShape->updateEndPoint(mapToScene(event->pos()));
-    mpLineShape->update();
-  }
-  //If creating polygon shape, the end points shall be updated to the mouse position.
-  else if (mIsCreatingPolygon)
-  {
-    mpPolygonShape->updateEndPoint(mapToScene(event->pos()));
-    mpPolygonShape->update();
-  }
-  //If creating rectangle shape, the end points shall be updated to the mouse position.
-  else if (mIsCreatingRectangle)
-  {
-    mpRectangleShape->updateEndPoint(mapToScene(event->pos()));
-    mpRectangleShape->update();
-  }
-  //If creating ellipse shape, the end points shall be updated to the mouse position.
-  else if (mIsCreatingEllipse)
-  {
-    mpEllipseShape->updateEndPoint(mapToScene(event->pos()));
-    mpEllipseShape->update();
-  }
-  //If creating text shape, the end points shall be updated to the mouse position.
-  else if (mIsCreatingText)
-  {
-    mpTextShape->updateEndPoint(mapToScene(event->pos()));
-    mpTextShape->update();
-  }
-  //If creating bitmap shape, the end points shall be updated to the mouse position.
-  else if (mIsCreatingBitmap)
-  {
-    mpBitmapShape->updateEndPoint(mapToScene(event->pos()));
-    mpBitmapShape->update();
   }
 }
@@ -670,40 +479,4 @@
     mpConnectionLineAnnotation->addPoint(mapToScene(event->pos()));
   }
-  // if left button presses and we are starting to create a Line
-  else if ((event->button() == Qt::LeftButton) && pMainWindow->getLineAction()->isChecked())
-  {
-    // if we are starting to create a line then create line object and add to graphicsview
-    createLineShape(mapToScene(event->pos()));
-  }
-  // if left button presses and we are starting to create a Rectangle
-  else if ((event->button() == Qt::LeftButton) && pMainWindow->getRectangleAction()->isChecked())
-  {
-    // if we are starting to create a rectangle then create rectangle object and add to graphicsview
-    createRectangleShape(mapToScene(event->pos()));
-  }
-  // if left button presses and we are starting to create an Ellipse
-  else if ((event->button() == Qt::LeftButton) && pMainWindow->getEllipseAction()->isChecked())
-  {
-    // if we are starting to create a rectangle then create rectangle object and add to graphicsview
-    createEllipseShape(mapToScene(event->pos()));
-  }
-  // if left button presses and we are starting to create a Polygon
-  else if ((event->button() == Qt::LeftButton) && pMainWindow->getPolygonAction()->isChecked())
-  {
-    // if we are starting to create a polygon then create line object and add to graphicsview
-    createPolygonShape(mapToScene(event->pos()));
-  }
-  // if left button presses and we are starting to create a Text
-  else if ((event->button() == Qt::LeftButton) && pMainWindow->getTextAction()->isChecked())
-  {
-    // if we are starting to create a text then create text object and add to graphicsview
-    createTextShape(mapToScene(event->pos()));
-  }
-  // if left button presses and we are starting to create a BITMAP
-  else if ((event->button() == Qt::LeftButton) && pMainWindow->getBitmapAction()->isChecked())
-  {
-    // if we are starting to create a BITMAP then create BITMAP object and add to graphicsview
-    createBitmapShape(mapToScene(event->pos()));
-  }
   // if left button presses and we are not creating a connector
   else if ((event->button() == Qt::LeftButton))
@@ -712,5 +485,5 @@
     mIsMovingComponents = true;
     // save the position of all components
-    foreach (Component_OMC *pComponent, mComponents_OMCList)
+    foreach (Component *pComponent, mComponentsList)
     {
       pComponent->setOldPosition(pComponent->pos());
@@ -718,11 +491,5 @@
     }
   }
-  /* don't send mouse press events to items if we are creating something, only send them if creating a connector
-       because for connector we need to select end port */
-  if (!mIsCreatingLine and !mIsCreatingPolygon and !mIsCreatingRectangle and !mIsCreatingEllipse
-      and !mIsCreatingText and !mIsCreatingBitmap)
-  {
-    QGraphicsView::mousePressEvent(event);
-  }
+  QGraphicsView::mousePressEvent(event);
 }
 
@@ -733,5 +500,5 @@
     mIsMovingComponents = false;
     // if component position is changed then update annotations
-    foreach (Component_OMC *pComponent, mComponents_OMCList)
+    foreach (Component *pComponent, mComponentsList)
     {
       if (pComponent->getOldPosition() != pComponent->pos())
@@ -739,5 +506,5 @@
         pComponent->updatePlacementAnnotation();
         // if there are any connectors associated to component update their annotations as well.
-        foreach (LineAnnotation_OMC *pConnectionLineAnnotation, mConnectionsList)
+        foreach (LineAnnotation *pConnectionLineAnnotation, mConnectionsList)
         {
           if ((pConnectionLineAnnotation->getStartComponent()->getParentComponent() == pComponent) ||
@@ -759,27 +526,4 @@
 void GraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
 {
-  MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
-  if (mIsCreatingLine)
-  {
-    // finish creating the line
-    mIsCreatingLine = false;
-    // add the line to shapes list
-    addShapeObject(mpLineShape);
-    mpLineShape->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-    mpLineShape->drawRectangleCornerItems();
-    // make the toolbar button of line unchecked
-    pMainWindow->getLineAction()->setChecked(false);
-  }
-  else if (mIsCreatingPolygon)
-  {
-    // finish creating the line
-    mIsCreatingPolygon = false;
-    // add the line to shapes list
-    addShapeObject(mpPolygonShape);
-    mpPolygonShape->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-    mpPolygonShape->drawRectangleCornerItems();
-    // make the toolbar button of line unchecked
-    pMainWindow->getPolygonAction()->setChecked(false);
-  }
   QGraphicsView::mouseDoubleClickEvent(event);
 }
@@ -898,47 +642,6 @@
   mpPasteComponentAction->setStatusTip(tr("Copy the item"));
   mpPasteComponentAction->setDisabled(true);
-  connect(mpPasteComponentAction, SIGNAL(triggered()), SLOT(pasteComponent()));
+  //connect(mpPasteComponentAction, SIGNAL(triggered()), SLOT(pasteComponent()));
   //mpPasteComponentAction->setShortcut(QKeySequence("Ctrl+c"));
-}
-
-void GraphicsView::createMenus()
-{
-
-}
-
-//pasting the required copied component or a selection in the present view
-//non functional currently, only works for a single component
-void GraphicsView::pasteComponent()
-{
-
-  QClipboard *clipboard = QApplication::clipboard();
-
-  if(!clipboard->text().isEmpty())
-  {
-    //GraphicsView *pGraphicsView = qobject_cast<GraphicsView*>(const_cast<QObject*>(sender()));
-    Component *oldComponent = getComponentObject(clipboard->text());
-    Component *newComponent;
-    QString name = getUniqueComponentName(oldComponent->getName().toLower());
-
-    //QPointF point;
-    QPointF point (mapToScene(pos()));
-
-    //point= QPointF((pos().x()) +1.0 ,(pos().y()) +1.0);
-    //newComponent = new Component(oldComponent,name,point,oldComponent->getIsConnector(),this);
-    // remove the component from the scene
-    //mpGraphicsView->scene()->removeItem(this);
-    // if the signal is not send by graphicsview then call addclassannotation
-    //if (!pGraphicsView)
-    // {
-    //   if (mpGraphicsView->mIconType == StringHandler::ICON)
-    //     mpGraphicsView->addClassAnnotation();
-    // }
-    // delete(this);
-    //addComponentObject(newComponent);
-  }
-  else
-  {
-    return ;
-  }
 }
 
@@ -947,170 +650,4 @@
   GraphicsViewProperties *pGraphicsViewProperties = new GraphicsViewProperties(this);
   pGraphicsViewProperties->show();
-}
-
-void GraphicsView::createLineShape(QPointF point)
-{
-  if (mpModelWidget->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  if (!mIsCreatingLine)
-  {
-    mIsCreatingLine = true;
-    mpLineShape = new LineAnnotation(this);
-    mpLineShape->addPoint(point);
-    mpLineShape->addPoint(point);
-    scene()->addItem(mpLineShape);
-  }
-  // if we are already creating a line then only add one point.
-  else
-  {
-    mpLineShape->addPoint(point);
-  }
-}
-
-void GraphicsView::createPolygonShape(QPointF point)
-{
-  if (mpModelWidget->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  if (!mIsCreatingPolygon)
-  {
-    mIsCreatingPolygon = true;
-    mpPolygonShape = new PolygonAnnotation(this);
-    mpPolygonShape->addPoint(point);
-    mpPolygonShape->addPoint(point);
-    mpPolygonShape->addPoint(point);
-    scene()->addItem(mpPolygonShape);
-  }
-  // if we are already creating a polygon then only add one point.
-  else
-  {
-    mpPolygonShape->addPoint(point);
-  }
-}
-
-void GraphicsView::createRectangleShape(QPointF point)
-{
-  if (mpModelWidget->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  if (!mIsCreatingRectangle)
-  {
-    mIsCreatingRectangle = true;
-    mpRectangleShape = new RectangleAnnotation(this);
-    mpRectangleShape->addPoint(point);
-    mpRectangleShape->addPoint(point);
-    scene()->addItem(mpRectangleShape);
-  }
-  // if we are already creating a rectangle then simply finish creating it.
-  else
-  {
-    // finish creating the rectangle
-    mIsCreatingRectangle = false;
-    // add the line to shapes list
-    addShapeObject(mpRectangleShape);
-    mpRectangleShape->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-    mpRectangleShape->drawRectangleCornerItems();
-    // make the toolbar button of line unchecked
-    mpModelWidget->getModelWidgetContainer()->getMainWindow()->getRectangleAction()->setChecked(false);
-  }
-}
-
-void GraphicsView::createEllipseShape(QPointF point)
-{
-  if (mpModelWidget->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  if (!mIsCreatingEllipse)
-  {
-    mIsCreatingEllipse = true;
-    mpEllipseShape = new EllipseAnnotation(this);
-    mpEllipseShape->addPoint(point);
-    mpEllipseShape->addPoint(point);
-    scene()->addItem(mpEllipseShape);
-  }
-  // if we are already creating a rectangle then simply finish creating it.
-  else
-  {
-    // finish creating the rectangle
-    mIsCreatingEllipse = false;
-    // add the line to shapes list
-    addShapeObject(mpEllipseShape);
-    mpEllipseShape->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-    mpEllipseShape->drawRectangleCornerItems();
-    // make the toolbar button of line unchecked
-    mpModelWidget->getModelWidgetContainer()->getMainWindow()->getEllipseAction()->setChecked(false);
-  }
-}
-
-void GraphicsView::createTextShape(QPointF point)
-{
-  if (mpModelWidget->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  if (!mIsCreatingText)
-  {
-    mIsCreatingText = true;
-    mpTextShape = new TextAnnotation(this);
-    mpTextShape->addPoint(point);
-    mpTextShape->addPoint(point);
-    scene()->addItem(mpTextShape);
-  }
-  // if we are already creating a text then simply finish creating it.
-  else
-  {
-    // finish creating the text
-    mIsCreatingText = false;
-    // add the line to shapes list
-    addShapeObject(mpTextShape);
-    mpTextShape->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-    mpTextShape->drawRectangleCornerItems();
-    // make the toolbar button of line unchecked
-    mpModelWidget->getModelWidgetContainer()->getMainWindow()->getTextAction()->setChecked(false);
-    // open the text properties dialog
-    mpTextWidget = new TextWidget(mpTextShape, mpModelWidget->getModelWidgetContainer()->getMainWindow());
-    mpTextWidget->show();
-  }
-}
-
-void GraphicsView::createBitmapShape(QPointF point)
-{
-  if (mpModelWidget->getLibraryTreeNode()->isReadOnly())
-    return;
-
-  if (!mIsCreatingBitmap)
-  {
-    //If  model doesnt exist, then alert the user...
-    if(mpModelWidget->getLibraryTreeNode()->getFileName().isEmpty())
-    {
-      QMessageBox *msgBox = new QMessageBox(mpModelWidget->getModelWidgetContainer()->getMainWindow());
-      msgBox->setWindowTitle(QString(Helper::applicationName).append(" - Information"));
-      msgBox->setIcon(QMessageBox::Warning);
-      msgBox->setText(QString("The class needs to be saved before you can insert a bitmap."));
-      msgBox->setStandardButtons(QMessageBox::Ok);
-      msgBox->setDefaultButton(QMessageBox::Ok);
-      msgBox->exec();
-      mpModelWidget->getModelWidgetContainer()->getMainWindow()->getBitmapAction()->setChecked(false);
-      return;
-    }
-    mIsCreatingBitmap = true;
-    mpBitmapShape = new BitmapAnnotation(this);
-    mpBitmapShape->addPoint(point);
-    mpBitmapShape->addPoint(point);
-    scene()->addItem(mpBitmapShape);
-  }
-  else
-  {
-    // finish creating the bitmap
-    mIsCreatingBitmap = false;
-    // add the line to shapes list
-    addShapeObject(mpBitmapShape);
-    mpBitmapShape->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-    mpBitmapShape->drawRectangleCornerItems();
-    // make the toolbar button of line unchecked
-    mpModelWidget->getModelWidgetContainer()->getMainWindow()->getBitmapAction()->setChecked(false);
-    mpBitmapWidget = new BitmapWidget(mpBitmapShape, mpModelWidget->getModelWidgetContainer()->getMainWindow());
-    mpBitmapWidget->show();
-  }
 }
 
@@ -1149,5 +686,5 @@
 }
 
-void GraphicsView::addConnection(Component_OMC *pComponent)
+void GraphicsView::addConnection(Component *pComponent)
 {
   // When clicking the start component
@@ -1155,8 +692,8 @@
   {
     QPointF startPos = pComponent->mapToScene(pComponent->boundingRect().center());
-    mpConnectionLineAnnotation = new LineAnnotation_OMC(pComponent, this);
+    mpConnectionLineAnnotation = new LineAnnotation(pComponent, this);
     setIsCreatingConnection(true);
     // if component is a connector
-    Component_OMC *pRootParentComponent = pComponent->getRootParentComponent();
+    Component *pRootParentComponent = pComponent->getRootParentComponent();
     if (pRootParentComponent)
       pRootParentComponent->addConnectionDetails(mpConnectionLineAnnotation);
@@ -1171,5 +708,5 @@
   {
     mpConnectionLineAnnotation->setEndComponent(pComponent);
-    Component_OMC *pStartComponent = mpConnectionLineAnnotation->getStartComponent();
+    Component *pStartComponent = mpConnectionLineAnnotation->getStartComponent();
     MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
     if (pStartComponent == pComponent)
@@ -1180,108 +717,29 @@
       return;
     }
-    QString startComponentName, endComponentName;
+    bool showConnectionArrayDialog = false;
     if (pStartComponent->getParentComponent())
-      startComponentName = QString(pStartComponent->getParentComponent()->getName()).append(".").append(pStartComponent->getComponentInfo()->getName());
-    else
-      startComponentName = pStartComponent->getName();
+      if ((pStartComponent->getComponentInfo()->getArrayIndex().compare("n") == 0) || (pStartComponent->getComponentInfo()->getArrayIndex().compare(":") == 0))
+        showConnectionArrayDialog = true;
     if (pComponent->getParentComponent())
-      endComponentName = QString(pComponent->getParentComponent()->getName()).append(".").append(pComponent->getComponentInfo()->getName());
-    else
-      endComponentName = pComponent->getName();
-    createConnection(startComponentName, endComponentName);
-  }
-}
-
-//! Begins creation of connector or complete creation of connector depending on the mIsCreatingConnector flag.
-//! @param pComponent is a pointer to the clicked Component, either start or end depending on the mIsCreatingConnector flag.
-void GraphicsView::addConnector(Component *pComponent)
-{
-  //When clicking start port
-  if (!mIsCreatingConnection)
-  {
-    QPointF startPos = pComponent->mapToScene(pComponent->boundingRect().center());
-    mpConnector = new Connector(pComponent, this);
-    scene()->addItem(mpConnector);
-    mIsCreatingConnection = true;
-    //if component is a connector
-    if (pComponent->getParentComponent())
-      pComponent->getParentComponent()->addConnector(mpConnector);
-    else
-      pComponent->addConnector(mpConnector);
-    mpConnector->setStartComponent(pComponent);
-    mpConnector->addPoint(startPos);
-    mpConnector->addPoint(startPos);
-    mpConnector->drawConnector();
-  }
-  // When clicking end port
-  else
-  {
-    Component *pStartComponent = mpConnector->getStartComponent();
-    QString startIconName, startIconCompName, endIconName, endIconCompName;
-    if (pStartComponent->getParentComponent())
+      if ((pComponent->getComponentInfo()->getArrayIndex().compare("n") == 0) || (pComponent->getComponentInfo()->getArrayIndex().compare(":") == 0))
+        showConnectionArrayDialog = true;
+    if (showConnectionArrayDialog)
     {
-      startIconName = QString(pStartComponent->getParentComponent()->getName()).append(".");
-      startIconCompName = pStartComponent->getComponentInfo()->getName();
+      ConnectionArray *pConnectionArray = new ConnectionArray(this, mpConnectionLineAnnotation,
+                                                              getModelWidget()->getModelWidgetContainer()->getMainWindow());
+      pConnectionArray->show();
     }
     else
     {
-      startIconCompName = pStartComponent->getName();
-    }
-    if (pComponent->getParentComponent())
-    {
-      endIconName = QString(pComponent->getParentComponent()->getName()).append(".");
-      endIconCompName = pComponent->getComponentInfo()->getName();
-    }
-    else
-    {
-      endIconCompName = pComponent->getName();
-    }
-
-    MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
-    QList<ComponentInfo*> startcomponents = pStartComponent->getParentComponent()->getChildComponentInfo();
-    if (startcomponents.isEmpty())
-    {
-      startcomponents = pMainWindow->getOMCProxy()->getComponents(pStartComponent->getParentComponent()->getClassName());
-    }
-    //to check whether the component is an array of connectors
-    foreach(ComponentInfo *pComponentInfo , startcomponents)
-    {
-      //to check whether the component is an array of connectors
-      if (pComponentInfo->getName() == startIconCompName)
-      {
-//        if (pComponentInfo->getIndexValue() != -1)
-//        {
-//          mpConnector->setStartConnectorisArray(true);
-//        }
-      }
-    }
-
-    QList<ComponentInfo*> endcomponents = pComponent->getParentComponent()->getChildComponentInfo();
-    if(endcomponents.isEmpty())
-    {
-      endcomponents = pMainWindow->getOMCProxy()->getComponents(pComponent->getParentComponent()->getClassName());
-    }
-    //to check whether the component is an array of connectors
-    foreach(ComponentInfo *pComponentInfo , endcomponents)
-    {
-      if (pComponentInfo->getName() == endIconCompName)
-      {
-//        if (pComponentInfo->getIndexValue() != -1)
-//        {
-//          mpConnector->setEndConnectorisArray(true);
-//        }
-      }
-    }
-    //if atleast one of the port is an array of connectors
-    if (mpConnector->getEndConnectorisArray() || mpConnector->getStartConnectorisArray())
-    {
-      mpConnector->setEndComponent(pComponent);
-      //shows the connector array menu for adding the index for the array
-      mpConnector->mpConnectorArrayMenu->show();
-    }
-    else
-    {
-      createConnection(pStartComponent, QString(startIconName).append(startIconCompName),
-                       pComponent, QString(endIconName).append(endIconCompName));
+      QString startComponentName, endComponentName;
+      if (pStartComponent->getParentComponent())
+        startComponentName = QString(pStartComponent->getParentComponent()->getName()).append(".").append(pStartComponent->getComponentInfo()->getName());
+      else
+        startComponentName = pStartComponent->getName();
+      if (pComponent->getParentComponent())
+        endComponentName = QString(pComponent->getParentComponent()->getName()).append(".").append(pComponent->getComponentInfo()->getName());
+      else
+        endComponentName = pComponent->getName();
+      createConnection(startComponentName, endComponentName);
     }
   }
@@ -1298,5 +756,7 @@
     {
       setIsCreatingConnection(false);
-      Component_OMC *pEndComponent = mpConnectionLineAnnotation->getEndComponent();
+      mpConnectionLineAnnotation->setStartComponentName(startComponentName);
+      mpConnectionLineAnnotation->setEndComponentName(endComponentName);
+      Component *pEndComponent = mpConnectionLineAnnotation->getEndComponent();
       if (pEndComponent->getParentComponent())
         pEndComponent->getParentComponent()->addConnectionDetails(mpConnectionLineAnnotation);
@@ -1320,109 +780,4 @@
 }
 
-void GraphicsView::createConnection(Component *pStartComponent, QString startIconCompName, Component *pComponent, QString endIconCompName)
-{
-  MainWindow *pMainWindow = mpModelWidget->getModelWidgetContainer()->getMainWindow();
-  // If both components are same
-  if (pStartComponent == pComponent)
-  {
-    removeConnector();
-    pMainWindow->getProblemsWidget()->addGUIProblem(new ProblemItem("", false, 0, 0, 0, 0,
-                                                                    GUIMessages::getMessage(GUIMessages::SAME_COMPONENT_CONNECT),
-                                                                    Helper::scriptingKind, Helper::errorLevel, 0,
-                                                                    pMainWindow->getProblemsWidget()->mpProblem));
-  }
-  else
-  {
-    if (pMainWindow->getOMCProxy()->addConnection(startIconCompName, endIconCompName, mpModelWidget->getLibraryTreeNode()->getNameStructure(), ""))
-    {
-      // Check if both components connected are compatible or not.
-      if (pMainWindow->getOMCProxy()->instantiateModelSucceeds(mpModelWidget->getLibraryTreeNode()->getNameStructure()))
-      {
-        mIsCreatingConnection = false;
-        QPointF newPos = pComponent->mapToScene(pComponent->boundingRect().center());
-        mpConnector->updateEndPoint(newPos);
-        if (pComponent->getParentComponent())
-          pComponent->getParentComponent()->addConnector(mpConnector);
-        else
-          pComponent->addConnector(mpConnector);
-        mpConnector->setEndComponent(pComponent);
-        // update the last point to the center of component
-        mpConnector->updateEndPoint(pComponent->boundingRect().center());
-        mpConnector->drawConnector(false);
-        mConnectorsVector.append(mpConnector);
-        // add the connection annotation to OMC
-        mpConnector->updateConnectionAnnotationString();
-        mpModelWidget->getModelicaTextWidget()->getModelicaTextEdit()->setPlainText(pMainWindow->getOMCProxy()->list(mpModelWidget->getLibraryTreeNode()->getNameStructure()));
-      }
-      else
-      {
-        removeConnector();
-        // since this is an on purpose connection delete so dont make model unsaved :)
-        // so to avoid model unsaving we have to blovk signals of Modelica editor
-        mpModelWidget->getModelicaTextWidget()->blockSignals(true);
-        // remove the connection from model
-        pMainWindow->getOMCProxy()->deleteConnection(startIconCompName, endIconCompName, mpModelWidget->getLibraryTreeNode()->getNameStructure());
-        mpModelWidget->getModelicaTextWidget()->blockSignals(false);
-      }
-    }
-  }
-}
-//add connector function in case atleast one port is an array
-//! @param pStartComponent is
-void GraphicsView::addConnectorForArray(Component *pStartComponent,Component *pEndComponent ,int startindex , int endindex)
-{
-  //if user pressed cancel in the array menu, remove the connection
-  if(startindex==-1 && endindex==-1)
-  {
-    removeConnector();
-  }
-
-  else
-  {
-    QString startIndexStr = QString::number(startindex);
-    QString endIndexStr = QString::number(endindex);
-    mpConnector->mpConnectorArrayMenu->setStartConnectorIndex(startIndexStr);
-    mpConnector->mpConnectorArrayMenu->setEndConnectorIndex(endIndexStr);
-    QString startIconName, startIconCompName, endIconName, endIconCompName;
-    // appending the indices if it is an array of connectors;
-    if (pStartComponent->getParentComponent())
-    {
-      startIconName = QString(pStartComponent->getParentComponent()->getName()).append(".");
-      if(!mpConnector->getStartConnectorisArray())
-        startIconCompName = pStartComponent->getComponentInfo()->getName();
-      else
-        startIconCompName = pStartComponent->getComponentInfo()->getName() + "[" + mpConnector->mpConnectorArrayMenu->getStartConnectorIndex() + "]";
-    }
-    else
-    {
-      if(!mpConnector->getStartConnectorisArray())
-        startIconCompName = pStartComponent->getName();
-      else
-        startIconCompName = pStartComponent->getName() + "[" + startIndexStr + "]";
-    }
-
-    if (pEndComponent->getParentComponent())
-    {
-      endIconName = QString(pEndComponent->getParentComponent()->getName()).append(".");
-      if(!mpConnector->getEndConnectorisArray())
-        endIconCompName = pEndComponent->getComponentInfo()->getName();
-      else
-        endIconCompName = pEndComponent->getComponentInfo()->getName() + "[" + mpConnector->mpConnectorArrayMenu->getEndConnectorIndex() + "]";
-    }
-    else
-    {
-
-      if(!mpConnector->getEndConnectorisArray())
-        endIconCompName = pEndComponent->getName();
-      else
-        endIconCompName = pEndComponent->getName() + "[" + endIndexStr + "]";
-    }
-
-    createConnection(pStartComponent, QString(startIconName).append(startIconCompName),
-                     pEndComponent, QString(endIconName).append(endIconCompName));
-
-  }
-}
-
 //! Removes the current connecting connector from the model.
 void GraphicsView::removeConnection()
@@ -1452,34 +807,7 @@
 }
 
-//! Removes the current connecting connector from the model.
-void GraphicsView::removeConnector()
-{
-  if (mIsCreatingConnection)
-  {
-    scene()->removeItem(mpConnector);
-    delete mpConnector;
-    mIsCreatingConnection = false;
-  }
-  else
-  {
-    int i = 0;
-    while(i != mConnectorsVector.size())
-    {
-      if(mConnectorsVector[i]->isActive())
-      {
-        removeConnector(mConnectorsVector[i]);
-        i = 0;   //Restart iteration if map has changed
-      }
-      else
-      {
-        ++i;
-      }
-    }
-  }
-}
-
 //! Removes the connector from the model.
 //! @param pConnector is a pointer to the connector to remove.
-void GraphicsView::removeConnection(LineAnnotation_OMC *pConnection)
+void GraphicsView::removeConnection(LineAnnotation *pConnection)
 {
   bool doDelete = false;
@@ -1496,85 +824,10 @@
   if (doDelete)
   {
-    // If GUI delete is successful then remove the connection from omc as well.
-    QString startComponentName, endComponentName;
-    Component_OMC *pStartComponent, *pEndComponent;
-    pStartComponent = pConnection->getStartComponent();
-    pEndComponent = pConnection->getEndComponent();
-    if (pStartComponent->getParentComponent())
-      startComponentName = QString(pStartComponent->getParentComponent()->getName()).append(".").append(pStartComponent->getComponentInfo()->getName());
-    else
-      startComponentName = pStartComponent->getName();
-    if (pEndComponent->getParentComponent())
-      endComponentName = QString(pEndComponent->getParentComponent()->getName()).append(".").append(pEndComponent->getComponentInfo()->getName());
-    else
-      endComponentName = pEndComponent->getName();
-    // delete Connection
-    deleteConnection(startComponentName, endComponentName);
+    // If GUI delete is successful then delete the connection from omc as well.
+    deleteConnection(pConnection->getStartComponentName(), pConnection->getEndComponentName());
     // delete the connector object
     pConnection->deleteLater();
     // remove connector object from local connector vector
     mConnectionsList.removeAt(i);
-  }
-}
-
-//! Removes the connector from the model.
-//! @param pConnector is a pointer to the connector to remove.
-void GraphicsView::removeConnector(Connector *pConnector, bool update)
-{
-  bool doDelete = false;
-  int i;
-
-  for(i = 0; i != mConnectorsVector.size(); ++i)
-  {
-    if(mConnectorsVector[i] == pConnector)
-    {
-      scene()->removeItem(pConnector);
-      doDelete = true;
-      break;
-    }
-    if(mConnectorsVector.empty())
-      break;
-  }
-  if (doDelete)
-  {
-    // If GUI delete is successful then remove the connection from omc as well.
-    QString startIconName, startIconCompName, endIconName, endIconCompName;
-    if (pConnector->getStartComponent()->getParentComponent())
-    {
-      startIconName = QString(pConnector->getStartComponent()->getParentComponent()->getName()).append(".");
-      if(!pConnector->getStartConnectorisArray())
-        startIconCompName =pConnector->getStartComponent()->getComponentInfo()->getName();
-      else
-        startIconCompName = pConnector->getStartComponent()->getComponentInfo()->getName() + "[" + pConnector->mpConnectorArrayMenu->getStartConnectorIndex() + "]";
-    }
-    else
-    {
-      startIconCompName = pConnector->getStartComponent()->getName();
-      if(!pConnector->getStartConnectorisArray())
-        startIconCompName =pConnector->getStartComponent()->getName();
-      else
-        startIconCompName = pConnector->getStartComponent()->getName() + "[" + pConnector->mpConnectorArrayMenu->getStartConnectorIndex() + "]";
-    }
-    if (pConnector->getEndComponent()->getParentComponent())
-    {
-      endIconName = QString(pConnector->getEndComponent()->getParentComponent()->getName()).append(".");
-      if(!pConnector->getEndConnectorisArray())
-        endIconCompName = pConnector->getEndComponent()->getComponentInfo()->getName();
-      else
-        endIconCompName = pConnector->getEndComponent()->getComponentInfo()->getName() + "[" + pConnector->mpConnectorArrayMenu->getEndConnectorIndex() + "]";
-    }
-    else
-    {
-      if(!pConnector->getEndConnectorisArray())
-        endIconCompName = pConnector->getEndComponent()->getName();
-      else
-        endIconCompName = pConnector->getEndComponent()->getName() + "[" + pConnector->mpConnectorArrayMenu->getEndConnectorIndex() + "]";
-    }
-    // delete Connection
-    //deleteConnection(QString(startIconName).append(startIconCompName), QString(endIconName).append(endIconCompName), update);
-    // delete the connector object
-    delete pConnector;
-    // remove connector object from local connector vector
-    mConnectorsVector.remove(i);
   }
 }
@@ -1629,22 +882,7 @@
 {
   //Select all components
-  foreach (Component_OMC *pComponent, mComponents_OMCList)
+  foreach (Component *pComponent, mComponentsList)
   {
     pComponent->setSelected(true);
-  }
-  // Select all connectors
-  foreach (Connector *connector, mConnectorsVector)
-  {
-    // just make one line of connector selected, it will make the whole connector selected
-    foreach (ConnectorLine *connectorLine, connector->mpLines)
-    {
-      connectorLine->setSelected(true);
-      break;
-    }
-  }
-  // select all shapes like line, rectangle, polygon etc...
-  foreach (ShapeAnnotation *pShape, mShapesList)
-  {
-    pShape->setSelected(true);
   }
 }
@@ -1685,16 +923,16 @@
   annotationString.append(", grid=").append("{").append(QString::number(grid.x())).append(", ").append(QString::number(grid.y())).append("})");
   // add the graphics annotations
-  if (mShapesList.size() > 0)
-  {
-    annotationString.append(", graphics={");
-    foreach (ShapeAnnotation *shape, mShapesList)
-    {
-      annotationString.append(shape->getShapeAnnotation());
-      if (counter < mShapesList.size() - 1)
-        annotationString.append(",");
-      counter++;
-    }
-    annotationString.append("}");
-  }
+//  if (mShapesList.size() > 0)
+//  {
+//    annotationString.append(", graphics={");
+//    foreach (ShapeAnnotation *shape, mShapesList)
+//    {
+//      annotationString.append(shape->getShapeAnnotation());
+//      if (counter < mShapesList.size() - 1)
+//        annotationString.append(",");
+//      counter++;
+//    }
+//    annotationString.append("}");
+//  }
   annotationString.append(")");
 
@@ -1885,4 +1123,5 @@
   mpLatestNewsLabel = new Label(tr("Latest News"));
   mpLatestNewsLabel->setFont(QFont("", Helper::headingFontSize));
+  mpNoLatestNewsLabel = new Label;
   mpLatestNewsListWidget = new QListWidget;
   mpLatestNewsListWidget->setObjectName("LatestNewsList");
@@ -1894,4 +1133,6 @@
   mpLatestNewsListWidget->setIconSize(Helper::iconSize);
   mpLatestNewsListWidget->setCurrentRow(0, QItemSelectionModel::Select);
+  mpReloadLatestNewsButton = new QPushButton(tr("Reload"));
+  connect(mpReloadLatestNewsButton, SIGNAL(clicked()), SLOT(addLatestNewsListItems()));
   mpVisitWebsiteLabel = new Label(tr("For more details visit our website <u><a href=\"www.openmodelica.org\">www.openmodelica.org</a></u>"));
   mpVisitWebsiteLabel->setTextFormat(Qt::RichText);
@@ -1900,9 +1141,13 @@
   connect(mpLatestNewsListWidget, SIGNAL(itemClicked(QListWidgetItem*)), SLOT(openLatestNewsItem(QListWidgetItem*)));
   // Latest News Frame layout
-  QVBoxLayout *latestNewsFrameLayout = new QVBoxLayout;
-  latestNewsFrameLayout->addWidget(mpLatestNewsLabel);
-  latestNewsFrameLayout->addWidget(mpLatestNewsListWidget);
-  latestNewsFrameLayout->addWidget(mpVisitWebsiteLabel, 0 , Qt::AlignRight);
-  mpLatestNewsFrame->setLayout(latestNewsFrameLayout);
+  QVBoxLayout *latestNewsFrameVBLayout = new QVBoxLayout;
+  latestNewsFrameVBLayout->addWidget(mpLatestNewsLabel);
+  latestNewsFrameVBLayout->addWidget(mpNoLatestNewsLabel);
+  latestNewsFrameVBLayout->addWidget(mpLatestNewsListWidget);
+  QHBoxLayout *latestNewsFrameHBLayout = new QHBoxLayout;
+  latestNewsFrameHBLayout->addWidget(mpReloadLatestNewsButton, 0, Qt::AlignLeft);
+  latestNewsFrameHBLayout->addWidget(mpVisitWebsiteLabel, 0, Qt::AlignRight);
+  latestNewsFrameVBLayout->addLayout(latestNewsFrameHBLayout);
+  mpLatestNewsFrame->setLayout(latestNewsFrameVBLayout);
   // create http object for request
   mpLatestNewsNetworkAccessManager = new QNetworkAccessManager;
@@ -1982,5 +1227,10 @@
 void WelcomePageWidget::readLatestNewsXML(QNetworkReply *pNetworkReply)
 {
-  if (pNetworkReply->error() == QNetworkReply::NoError)
+  if (pNetworkReply->error() == QNetworkReply::HostNotFoundError)
+  {
+    mpNoLatestNewsLabel->setVisible(true);
+    mpNoLatestNewsLabel->setText(tr("Sorry, no internet no news items."));
+  }
+  else if (pNetworkReply->error() == QNetworkReply::NoError)
   {
     QByteArray response(pNetworkReply->readAll());
@@ -1990,4 +1240,5 @@
     while (!xml.atEnd())
     {
+      mpNoLatestNewsLabel->setVisible(false);
       xml.readNext();
       if (xml.tokenType() == QXmlStreamReader::StartElement)
@@ -2021,4 +1272,9 @@
         break;
     }
+  }
+  else
+  {
+    mpNoLatestNewsLabel->setVisible(true);
+    mpNoLatestNewsLabel->setText(QString(Helper::error).append(" - ").append(pNetworkReply->errorString()));
   }
 }
@@ -2150,7 +1406,6 @@
   else
   {
-    getModelComponents(getLibraryTreeNode()->getNameStructure());
-    getModelConnections();
-    getModelIconDiagram();
+//    getModelComponents(getLibraryTreeNode()->getNameStructure());
+//    getModelIconDiagram();
   }
   mpIconGraphicsScene->clearSelection();
@@ -2221,437 +1476,4 @@
 {
   return mpCursorPositionLabel;
-}
-
-//! Gets the components of the model and place them in the GraphicsView.
-void ModelWidget::getModelComponents(QString modelName)
-{
-  MainWindow *pMainWindow = mpModelWidgetContainer->getMainWindow();
-  // get the inherited components of the Model
-  int inheritanceCount = pMainWindow->getOMCProxy()->getInheritanceCount(modelName);
-
-  for(int i = 1 ; i <= inheritanceCount ; i++)
-  {
-    QString inheritedClass = pMainWindow->getOMCProxy()->getNthInheritedClass(modelName, i);
-    // If the inherited class is one of the builtin type such as Real we can
-    // stop here, because the class can not contain any components, etc.
-    // Look for cycles as well.
-    if (pMainWindow->getOMCProxy()->isBuiltinType(inheritedClass) || inheritedClass.compare(modelName) == 0)
-    {
-      return;
-    }
-    getModelComponents(inheritedClass);
-  }
-
-  QList<ComponentInfo*> components = pMainWindow->getOMCProxy()->getComponents(modelName);
-  QStringList componentsAnnotationsList = pMainWindow->getOMCProxy()->getComponentAnnotations(modelName);
-
-  int i = 0;
-  foreach (ComponentInfo *pComponentInfo, components)
-  {
-    if (static_cast<QString>(componentsAnnotationsList.at(i)).toLower().contains("error"))
-    {
-      i++;
-      continue;
-    }
-    if (StringHandler::removeFirstLastCurlBrackets(componentsAnnotationsList.at(i)).length() > 0)
-    {
-      if (pMainWindow->getOMCProxy()->isWhat(StringHandler::CONNECTOR, pComponentInfo->getClassName()))
-      {
-        mpDiagramGraphicsView->addComponentoView(pComponentInfo->getName(), pComponentInfo->getClassName(),
-                                                 componentsAnnotationsList.at(i), QPointF(0.0, 0.0), true, false, true);
-        mpIconGraphicsView->addComponentoView(pComponentInfo->getName(), pComponentInfo->getClassName(),
-                                              componentsAnnotationsList.at(i), QPointF(0.0, 0.0), true, false);
-      }
-      else
-      {
-        mpDiagramGraphicsView->addComponentoView(pComponentInfo->getName(), pComponentInfo->getClassName(),
-                                                 componentsAnnotationsList.at(i), QPointF(0.0, 0.0), false, false, false);
-      }
-      i++;
-    }
-  }
-}
-
-//! Gets the connections of the model and place them in the GraphicsView.
-void ModelWidget::getModelConnections()
-{
-  MainWindow *pMainWindow = mpModelWidgetContainer->getMainWindow();
-  int connectionsCount = pMainWindow->getOMCProxy()->getConnectionCount(getLibraryTreeNode()->getNameStructure());
-  int startindex=-1,endindex=-1;
-  for (int i = 1 ; i <= connectionsCount ; i++)
-  {
-    // get the connection from OMC
-    QString connectionString;
-    QStringList connectionList;
-    connectionString = pMainWindow->getOMCProxy()->getNthConnection(getLibraryTreeNode()->getNameStructure(), i);
-    connectionList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(connectionString));
-    // if the connectionString only contains two items then continue the loop,
-    // because connection is not valid then
-    if (connectionList.size() < 3)
-      continue;
-
-    // get start and end components
-    QStringList startComponentList = static_cast<QString>(connectionList.at(0)).split(".");
-    QStringList endComponentList = static_cast<QString>(connectionList.at(1)).split(".");
-
-    Component *pStartComponent = mpDiagramGraphicsView->getComponentObject(startComponentList.at(0));
-    Component *pEndComponent = mpDiagramGraphicsView->getComponentObject(endComponentList.at(0));
-
-    // if Start component and end component not found then continue the loop
-    if (!pStartComponent or !pEndComponent)
-      continue;
-
-    // get start and end ports
-    Component *pStartPort = 0;
-    Component *pEndPort = 0;
-    // if a connector type is connected then we only get one item in startComponentList and endComponentList
-    // check the startcomponentlist
-    if (startComponentList.size() < 2)
-    {
-      pStartPort = pStartComponent;
-    }
-    // look for port from the parent component
-    else
-    {
-      foreach (Component *component, pStartComponent->getComponentsList())
-      {
-        int startbrac = startComponentList.at(1).indexOf("[");
-        if(startbrac == -1)
-        {
-          if (component->getComponentInfo()->getName() == startComponentList.at(1))
-            pStartPort = component;
-        }
-        //if the start port is a connector array
-        else
-        {   bool ok;
-          int endbrac = startComponentList.at(1).indexOf("]");
-          QString arrayPort = startComponentList.at(1).left(startbrac);
-          startindex = startComponentList.at(1).mid(startbrac+1,endbrac-startbrac-1).toInt(&ok,10);
-
-          if (component->getComponentInfo()->getName() == arrayPort)
-            pStartPort = component;
-        }
-      }
-    }
-    // if a connector type is connected then we only get one item in startComponentList and endComponentList
-    // check the startcomponentlist
-    if (endComponentList.size() < 2)
-    {
-      pEndPort = pEndComponent;
-    }
-    // look for port from the parent component
-    else
-    {
-      foreach (Component *component, pEndComponent->getComponentsList())
-      {
-        int startbrac = endComponentList.at(1).indexOf("[");
-        if(startbrac == -1)
-        {
-          if (component->getComponentInfo()->getName() == endComponentList.at(1))
-            pEndPort = component;
-        }
-        //if the end port is a connector array
-        else
-        {   bool ok;
-          int endbrac = endComponentList.at(1).indexOf("]");
-          QString arrayPort = endComponentList.at(1).left(startbrac);
-          endindex = endComponentList.at(1).mid(startbrac+1,endbrac-startbrac-1).toInt(&ok,10);
-          if (component->getComponentInfo()->getName() == arrayPort)
-            pEndPort = component;
-        }
-      }
-    }
-
-    // if Start port and end port not found then continue the loop
-    if (!pStartPort or !pEndPort)
-      continue;
-
-    // get the connector annotations from OMC
-    QString connectionAnnotationString;
-    QStringList connectionAnnotationList, shapesList;
-    connectionAnnotationString = pMainWindow->getOMCProxy()->getNthConnectionAnnotation(getLibraryTreeNode()->getNameStructure(), i);
-    shapesList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(connectionAnnotationString), '(', ')');
-    // Now parse the shapes available in list
-    foreach (QString shape, shapesList)
-    {
-      shape = StringHandler::removeFirstLastCurlBrackets(shape);
-      if (shape.startsWith("Line"))
-      {
-        shape = shape.mid(QString("Line").length());
-        connectionAnnotationString = StringHandler::removeFirstLastBrackets(shape);
-      }
-    }
-    connectionAnnotationList = StringHandler::getStrings(connectionAnnotationString);
-    // if the connectionAnnotationString is empty then continue the loop,
-    // because connection is not valid then
-    if (connectionAnnotationList.size() < 8)
-      continue;
-
-    // create a QVector<QPointF> of annotation string to pass to connector
-    QStringList pointsList;
-    QVector<QPointF> points;
-    pointsList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(connectionAnnotationList.at(3)));
-
-    foreach (QString point, pointsList)
-    {
-      QStringList linePoints = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(point));
-      if (linePoints.size() < 2)
-        continue;
-
-      qreal x = static_cast<QString>(linePoints.at(0)).toFloat();
-      qreal y = static_cast<QString>(linePoints.at(1)).toFloat();
-      QPointF p (x, y);
-      points.append(p);
-    }
-    // create a connector now
-    Connector *pConnector = new Connector(pStartPort, pEndPort, mpDiagramGraphicsView, points);
-    //checking for the created connector to be a connector array
-    if(startindex>=0)
-      pConnector->setStartConnectorisArray(true);
-    if(endindex>=0)
-      pConnector->setEndConnectorisArray(true);
-    //storing array indices for the connector array
-    pConnector->mpConnectorArrayMenu->setStartConnectorIndex(QString::number(startindex));
-    pConnector->mpConnectorArrayMenu->setEndConnectorIndex(QString::number(endindex));
-    mpDiagramGraphicsView->mConnectorsVector.append(pConnector);
-    mpDiagramGraphicsView->scene()->addItem(pConnector);
-  }
-}
-
-//! Gets the shapes contained in the annotation string.
-void ModelWidget::getModelShapes(QString className, int viewType)
-{
-  MainWindow *pMainWindow = mpModelWidgetContainer->getMainWindow();
-  // get the inherited components of the Model
-  int inheritanceCount = pMainWindow->getOMCProxy()->getInheritanceCount(className);
-  for(int i = 1 ; i <= inheritanceCount ; i++)
-  {
-    QString inheritedClass = pMainWindow->getOMCProxy()->getNthInheritedClass(className, i);
-    // If the inherited class is one of the builtin type such as Real we can
-    // stop here, because the class can not contain any components, etc.
-    // Look for cycles as well.
-    if (pMainWindow->getOMCProxy()->isBuiltinType(inheritedClass) || inheritedClass.compare(className) == 0)
-    {
-      return;
-    }
-    getModelShapes(inheritedClass, viewType);
-  }
-  // get the annotation
-  QString annotationString;
-  if (viewType == StringHandler::ICON)
-    annotationString = pMainWindow->getOMCProxy()->getIconAnnotation(className);
-  else if (viewType == StringHandler::DIAGRAM)
-    annotationString = pMainWindow->getOMCProxy()->getDiagramAnnotation(className);
-  // parse annotation string
-  annotationString = StringHandler::removeFirstLastCurlBrackets(annotationString);
-  if (annotationString.isEmpty())
-  {
-    return;
-  }
-  QStringList list = StringHandler::getStrings(annotationString);
-  if (list.size() < 8)
-    return;
-  // read the extent points
-  qreal left = list.at(0).toFloat();
-  qreal bottom = list.at(1).toFloat();
-  qreal right = list.at(2).toFloat();
-  qreal top = list.at(3).toFloat();
-  QList<QPointF> extent;
-  extent << QPointF(left, bottom) << QPointF(right, top);
-  // read the preserveAspectRatio
-  bool preserveAspectRatio = list.at(4).contains("true");
-  // read the initialScale
-  qreal initialScale = list.at(5).toFloat();
-  // read the grid
-  qreal horizontal = list.at(6).toFloat();
-  qreal vertical = list.at(7).toFloat();
-  QPointF grid(horizontal, vertical);
-  // set the coOrdinate system for the layer
-  if (viewType == StringHandler::ICON)
-  {
-    mpIconGraphicsView->getCoOrdinateSystem()->setExtent(extent);
-    mpIconGraphicsView->getCoOrdinateSystem()->setPreserveAspectRatio(preserveAspectRatio);
-    mpIconGraphicsView->getCoOrdinateSystem()->setInitialScale(initialScale);
-    mpIconGraphicsView->getCoOrdinateSystem()->setGrid(grid);
-    // update the graphics view scene rect
-    mpIconGraphicsView->setSceneRect(left, bottom, fabs(left - right), fabs(bottom - top));
-    mpIconGraphicsView->updateGeometry();
-  }
-  else
-  {
-    mpDiagramGraphicsView->getCoOrdinateSystem()->setExtent(extent);
-    mpDiagramGraphicsView->getCoOrdinateSystem()->setPreserveAspectRatio(preserveAspectRatio);
-    mpDiagramGraphicsView->getCoOrdinateSystem()->setInitialScale(initialScale);
-    mpDiagramGraphicsView->getCoOrdinateSystem()->setGrid(grid);
-    // update the graphics view scene rect
-    mpDiagramGraphicsView->setSceneRect(left, bottom, fabs(left - right), fabs(bottom - top));
-    mpDiagramGraphicsView->updateGeometry();
-  }
-  if (list.size() < 9)
-    return;
-  // read the shapes
-  QStringList shapesList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(8)), '(', ')');
-  // Now parse the shapes available in list
-  foreach (QString shape, shapesList)
-  {
-    shape = StringHandler::removeFirstLastCurlBrackets(shape);
-    if (shape.startsWith("Line"))
-    {
-      shape = shape.mid(QString("Line").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      LineAnnotation *lineAnnotation;
-      // add the shapeannotation item to shapes list
-      if (viewType == StringHandler::ICON)
-      {
-        lineAnnotation = new LineAnnotation(shape, mpIconGraphicsView);
-        lineAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpIconGraphicsView->addShapeObject(lineAnnotation);
-        mpIconGraphicsView->scene()->addItem(lineAnnotation);
-      }
-      else if (viewType == StringHandler::DIAGRAM)
-      {
-        lineAnnotation = new LineAnnotation(shape, mpDiagramGraphicsView);
-        lineAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpDiagramGraphicsView->addShapeObject(lineAnnotation);
-        mpDiagramGraphicsView->scene()->addItem(lineAnnotation);
-      }
-      /*
-        before drawing the rectangle corner items add one point to line since drawrectanglecorneritems
-        deletes the one point. Why? because we end the line shape with double click which adds an extra
-        point to it. so we need to delete that point.
-      */
-      lineAnnotation->addPoint(QPoint(0, 0));
-      lineAnnotation->drawRectangleCornerItems();
-      lineAnnotation->setSelectionBoxPassive();
-    }
-    if (shape.startsWith("Polygon"))
-    {
-      shape = shape.mid(QString("Polygon").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      PolygonAnnotation *polygonAnnotation;
-      // add the shapeannotation item to shapes list
-      if (viewType == StringHandler::ICON)
-      {
-        polygonAnnotation = new PolygonAnnotation(shape, mpIconGraphicsView);
-        polygonAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpIconGraphicsView->addShapeObject(polygonAnnotation);
-        mpIconGraphicsView->scene()->addItem(polygonAnnotation);
-      }
-      else if (viewType == StringHandler::DIAGRAM)
-      {
-        polygonAnnotation = new PolygonAnnotation(shape, mpDiagramGraphicsView);
-        polygonAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpDiagramGraphicsView->addShapeObject(polygonAnnotation);
-        mpDiagramGraphicsView->scene()->addItem(polygonAnnotation);
-      }
-      /*
-        before drawing the rectangle corner items add one point to polygon since drawrectanglecorneritems
-        deletes the one point. Why? because we end the polygon shape with double click which adds an extra
-        point to it. so we need to delete that point.
-      */
-      polygonAnnotation->addPoint(QPoint(0, 0));
-      polygonAnnotation->drawRectangleCornerItems();
-      polygonAnnotation->setSelectionBoxPassive();
-    }
-    if (shape.startsWith("Rectangle"))
-    {
-      shape = shape.mid(QString("Rectangle").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      RectangleAnnotation *rectangleAnnotation;
-      // add the shapeannotation item to shapes list
-      if (viewType == StringHandler::ICON)
-      {
-        rectangleAnnotation = new RectangleAnnotation(shape, mpIconGraphicsView);
-        rectangleAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpIconGraphicsView->addShapeObject(rectangleAnnotation);
-        mpIconGraphicsView->scene()->addItem(rectangleAnnotation);
-      }
-      else if (viewType == StringHandler::DIAGRAM)
-      {
-        rectangleAnnotation = new RectangleAnnotation(shape, mpDiagramGraphicsView);
-        rectangleAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpDiagramGraphicsView->addShapeObject(rectangleAnnotation);
-        mpDiagramGraphicsView->scene()->addItem(rectangleAnnotation);
-      }
-      rectangleAnnotation->drawRectangleCornerItems();
-      rectangleAnnotation->setSelectionBoxPassive();
-    }
-    if (shape.startsWith("Ellipse"))
-    {
-      shape = shape.mid(QString("Ellipse").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      EllipseAnnotation *ellipseAnnotation;
-      // add the shapeannotation item to shapes list
-      if (viewType == StringHandler::ICON)
-      {
-        ellipseAnnotation = new EllipseAnnotation(shape, mpIconGraphicsView);
-        ellipseAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpIconGraphicsView->addShapeObject(ellipseAnnotation);
-        mpIconGraphicsView->scene()->addItem(ellipseAnnotation);
-      }
-      else if (viewType == StringHandler::DIAGRAM)
-      {
-        ellipseAnnotation = new EllipseAnnotation(shape, mpDiagramGraphicsView);
-        ellipseAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpDiagramGraphicsView->addShapeObject(ellipseAnnotation);
-        mpDiagramGraphicsView->scene()->addItem(ellipseAnnotation);
-      }
-      ellipseAnnotation->drawRectangleCornerItems();
-      ellipseAnnotation->setSelectionBoxPassive();
-    }
-    if (shape.startsWith("Text"))
-    {
-      shape = shape.mid(QString("Text").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      TextAnnotation *textAnnotation;
-      // add the shapeannotation item to shapes list
-      if (viewType == StringHandler::ICON)
-      {
-        textAnnotation = new TextAnnotation(shape, mpIconGraphicsView);
-        textAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpIconGraphicsView->addShapeObject(textAnnotation);
-        mpIconGraphicsView->scene()->addItem(textAnnotation);
-      }
-      else if (viewType == StringHandler::DIAGRAM)
-      {
-        textAnnotation = new TextAnnotation(shape, mpDiagramGraphicsView);
-        textAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpDiagramGraphicsView->addShapeObject(textAnnotation);
-        mpDiagramGraphicsView->scene()->addItem(textAnnotation);
-      }
-      textAnnotation->drawRectangleCornerItems();
-      textAnnotation->setSelectionBoxPassive();
-    }
-    if (shape.startsWith("Bitmap"))
-    {
-      shape = shape.mid(QString("Bitmap").length());
-      shape = StringHandler::removeFirstLastBrackets(shape);
-      BitmapAnnotation *bitmapAnnotation;
-      // add the shapeannotation item to shapes list
-      if (viewType == StringHandler::ICON)
-      {
-        bitmapAnnotation = new BitmapAnnotation(shape, mpIconGraphicsView);
-        bitmapAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpIconGraphicsView->addShapeObject(bitmapAnnotation);
-        mpIconGraphicsView->scene()->addItem(bitmapAnnotation);
-      }
-      else if (viewType == StringHandler::DIAGRAM)
-      {
-        bitmapAnnotation = new BitmapAnnotation(shape, mpDiagramGraphicsView);
-        bitmapAnnotation->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-        mpDiagramGraphicsView->addShapeObject(bitmapAnnotation);
-        mpDiagramGraphicsView->scene()->addItem(bitmapAnnotation);
-      }
-      bitmapAnnotation->drawRectangleCornerItems();
-      bitmapAnnotation->setSelectionBoxPassive();
-    }
-  }
-}
-
-//! Gets the Icon and Diagram Annotation of the model and place them in the GraphicsView (Icon View).
-void ModelWidget::getModelIconDiagram()
-{
-  getModelShapes(getLibraryTreeNode()->getNameStructure(), StringHandler::ICON);
-  getModelShapes(getLibraryTreeNode()->getNameStructure(), StringHandler::DIAGRAM);
 }
 
Index: /branches/OMEdit/OMEditGUI/ModelWidgetContainer.h
===================================================================
--- /branches/OMEdit/OMEditGUI/ModelWidgetContainer.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/ModelWidgetContainer.h	(revision 13537)
@@ -45,5 +45,4 @@
 
 #include "Component.h"
-#include "ConnectorWidget.h"
 #include "StringHandler.h"
 #include "ModelicaTextWidget.h"
@@ -52,15 +51,5 @@
 
 class ModelWidget;
-class Component;
-class Connector;
-class LineAnnotation_OMC;
 class LineAnnotation;
-class PolygonAnnotation;
-class RectangleAnnotation;
-class EllipseAnnotation;
-class TextAnnotation;
-class TextWidget;
-class BitmapAnnotation;
-class BitmapWidget;
 class ResizerItem;
 
@@ -101,12 +90,8 @@
   CoOrdinateSystem *mpCoOrdinateSystem;
   bool mIsCreatingConnection;
-  LineAnnotation_OMC *mpConnectionLineAnnotation;
-  QList<Component_OMC*> mComponents_OMCList;
-  QList<LineAnnotation_OMC*> mConnectionsList;
+  LineAnnotation *mpConnectionLineAnnotation;
+  QList<Component*> mComponentsList;
+  QList<LineAnnotation*> mConnectionsList;
   bool mIsMovingComponents;
-
-
-
-  Connector *mpConnector;
   QAction *mpPropertiesAction;
   QAction *mpDeleteAction;
@@ -114,11 +99,4 @@
   QAction *mpRotateAntiClockwiseAction;
   void createActions();
-  void createMenus();
-  void createLineShape(QPointF point);
-  void createPolygonShape(QPointF point);
-  void createRectangleShape(QPointF point);
-  void createEllipseShape(QPointF point);
-  void createTextShape(QPointF point);
-  void createBitmapShape(QPointF point);
 public:
   GraphicsView(StringHandler::ViewType viewType, ModelWidget *parent);
@@ -133,45 +111,13 @@
   void addComponentToView(QString name, QString className, QString transformationString, QPointF point, StringHandler::ModelicaClasses type,
                           bool addObject = true);
-  void addComponentObject(Component_OMC *pComponent);
-  Component_OMC* getComponent_OMCObject(QString componentName);
-
-
-  void addComponentoView(QString name, QString className, QString transformationString, QPointF point, bool isConnector = false,
-                         bool addObject = true, bool diagram = false);
-  void addComponentObject(Component *icon);
-  void deleteComponent_OMCObject(Component_OMC *pComponent);
-  void deleteComponentObject(Component *component, bool update = true);
-  void deleteAllComponentObjects();
+  void addComponentObject(Component *pComponent);
   Component* getComponentObject(QString componentName);
+  void deleteComponentObject(Component *pComponent);
   QString getUniqueComponentName(QString componentName, int number = 1);
   bool checkComponentName(QString componentName);
-  void addShapeObject(ShapeAnnotation *shape);
-  void deleteShapeObject(ShapeAnnotation *shape);
-  void deleteAllShapesObject();
-  void removeAllConnectors();
   void createConnection(QString startComponentName, QString endComponentName);
-  void createConnection(Component *pStartComponent, QString startIconCompName, Component *pComponent, QString endIconCompName);
   void deleteConnection(QString startComponentName, QString endComponentName);
-  void addConnectorForArray(Component *pStartComponent,Component *pEndComponent ,int startindex, int endindex);
-
-  QList<Component*> mComponentsList;
-  QList<ShapeAnnotation*> mShapesList;
-  LineAnnotation *mpLineShape;
-  PolygonAnnotation *mpPolygonShape;
-  RectangleAnnotation *mpRectangleShape;
-  EllipseAnnotation *mpEllipseShape;
-  TextAnnotation *mpTextShape;
-  TextWidget *mpTextWidget;
-  BitmapAnnotation *mpBitmapShape;
-  BitmapWidget *mpBitmapWidget;
-
-  bool mIsCreatingLine;
-  bool mIsCreatingPolygon;
-  bool mIsCreatingRectangle;
-  bool mIsCreatingEllipse;
-  bool mIsCreatingText;
-  bool mIsCreatingBitmap;
+
   bool mCustomScale;
-  QVector<Connector*> mConnectorsVector;
   QAction *mpCancelConnectionAction;
   QAction *mpRotateIconAction;
@@ -192,10 +138,7 @@
   void keyPressRight();
 public slots:
-  void addConnection(Component_OMC *pComponent);
-  void addConnector(Component *pComponent);
+  void addConnection(Component *pComponent);
   void removeConnection();
-  void removeConnector();
-  void removeConnection(LineAnnotation_OMC *pConnection);
-  void removeConnector(Connector* pConnector, bool update = true);
+  void removeConnection(LineAnnotation *pConnection);
   void resetZoom();
   void zoomIn();
@@ -203,5 +146,4 @@
   void selectAll();
   void addClassAnnotation(bool updateModelicaText = true);
-  void pasteComponent();
   void showGraphicsViewProperties();
 protected:
@@ -225,5 +167,4 @@
   WelcomePageWidget(MainWindow *parent = 0);
   void addRecentFilesListItems();
-  void addLatestNewsListItems();
 private:
   MainWindow *mpMainWindow;
@@ -238,6 +179,8 @@
   QFrame *mpLatestNewsFrame;
   Label *mpLatestNewsLabel;
+  Label *mpNoLatestNewsLabel;
   QListWidget *mpLatestNewsListWidget;
-  QLabel *mpVisitWebsiteLabel;
+  QPushButton *mpReloadLatestNewsButton;
+  Label *mpVisitWebsiteLabel;
   QNetworkAccessManager *mpLatestNewsNetworkAccessManager;
   QSplitter *mpSplitter;
@@ -246,7 +189,8 @@
   QPushButton *mpOpenModelButton;
 private slots:
+  void addLatestNewsListItems();
+  void readLatestNewsXML(QNetworkReply *pNetworkReply);
   void openRecentFileItem(QListWidgetItem *pItem);
   void openLatestNewsItem(QListWidgetItem *pItem);
-  void readLatestNewsXML(QNetworkReply *pNetworkReply);
 };
 
@@ -273,8 +217,4 @@
   void setModelFilePathLabel(QString path);
   Label* getCursorPositionLabel();
-  void getModelComponents(QString modelName);
-  void getModelConnections();
-  void getModelShapes(QString className, int viewType);
-  void getModelIconDiagram();
 private:
   LibraryTreeNode *mpLibraryTreeNode;
Index: /branches/OMEdit/OMEditGUI/OMEditGUI.pro
===================================================================
--- /branches/OMEdit/OMEditGUI/OMEditGUI.pro	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/OMEditGUI.pro	(revision 13537)
@@ -77,5 +77,4 @@
     ShapeAnnotation.cpp \
     CornerItem.cpp \
-    ConnectorWidget.cpp \
     LineAnnotation.cpp \
     PolygonAnnotation.cpp \
@@ -84,5 +83,4 @@
     TextAnnotation.cpp \
     BitmapAnnotation.cpp \
-    IconProperties.cpp \
     IconParameters.cpp \
     Transformation.cpp \
@@ -105,5 +103,4 @@
     ShapeAnnotation.h \
     CornerItem.h \
-    ConnectorWidget.h \
     LineAnnotation.h \
     PolygonAnnotation.h \
@@ -112,5 +109,4 @@
     TextAnnotation.h \
     BitmapAnnotation.h \
-    IconProperties.h \
     IconParameters.h \
     Transformation.h \
Index: /branches/OMEdit/OMEditGUI/PolygonAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/PolygonAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/PolygonAnnotation.cpp	(revision 13537)
@@ -36,11 +36,11 @@
 #include "PolygonAnnotation.h"
 
-PolygonAnnotation_OMC::PolygonAnnotation_OMC(QString annotation, Component_OMC *pParent)
-  : ShapeAnnotation_OMC(pParent)
+PolygonAnnotation::PolygonAnnotation(QString annotation, Component *pParent)
+  : ShapeAnnotation(pParent)
 {
   parseShapeAnnotation(annotation);
 }
 
-void PolygonAnnotation_OMC::parseShapeAnnotation(QString annotation)
+void PolygonAnnotation::parseShapeAnnotation(QString annotation)
 {
   GraphicItem::parseShapeAnnotation(annotation);
@@ -62,10 +62,10 @@
 }
 
-QRectF PolygonAnnotation_OMC::boundingRect() const
+QRectF PolygonAnnotation::boundingRect() const
 {
   return shape().boundingRect();
 }
 
-QPainterPath PolygonAnnotation_OMC::shape() const
+QPainterPath PolygonAnnotation::shape() const
 {
   QPainterPath path;
@@ -74,5 +74,5 @@
 }
 
-void PolygonAnnotation_OMC::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void PolygonAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
   Q_UNUSED(option);
@@ -81,5 +81,5 @@
 }
 
-void PolygonAnnotation_OMC::drawPolygonAnnotaion(QPainter *painter)
+void PolygonAnnotation::drawPolygonAnnotaion(QPainter *painter)
 {
   applyLinePattern(painter);
@@ -90,280 +90,2 @@
   painter->drawPath(path);
 }
-
-
-
-
-PolygonAnnotation::PolygonAnnotation(QString shape, Component *pParent)
-  : ShapeAnnotation(pParent), mpComponent(pParent)
-{
-  initializeFields();
-  parseShapeAnnotation(shape, mpComponent->getOMCProxy());
-}
-
-PolygonAnnotation::PolygonAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-PolygonAnnotation::PolygonAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  parseShapeAnnotation(shape, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy());
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-QRectF PolygonAnnotation::boundingRect() const
-{
-  return shape().boundingRect();
-}
-
-QPainterPath PolygonAnnotation::shape() const
-{
-  QPainterPath path;
-  path.addPolygon(QPolygonF(mPoints));
-  return addPathStroker(path);
-}
-
-void PolygonAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-
-  drawPolygonAnnotaion(painter);
-}
-
-void PolygonAnnotation::drawPolygonAnnotaion(QPainter *painter)
-{
-  QPainterPath path;
-
-  switch (this->mFillPattern)
-  {
-    case Qt::LinearGradientPattern:
-    case Qt::Dense1Pattern:
-    case Qt::RadialGradientPattern:
-      painter->setBrush(QBrush(this->mFillColor, Qt::SolidPattern));
-      break;
-    default:
-      painter->setBrush(QBrush(this->mFillColor, this->mFillPattern));
-      break;
-  }
-
-  qreal thickness;
-  // if (mCornerRadius > 0) // this is commented intentionally so that we dont need path stroker. Also helps in svg rendering
-  thickness = ceil(mThickness);
-
-  QPen pen(this->mLineColor, thickness, this->mLinePattern);
-  pen.setCosmetic(true);
-  painter->setPen(pen);
-
-  path.addPolygon(QPolygonF(mPoints));
-  painter->drawPath(path);
-}
-
-void PolygonAnnotation::addPoint(QPointF point)
-{
-  mPoints.append(point);
-  mPoints.back() = mPoints.first();
-}
-
-void PolygonAnnotation::updateEndPoint(QPointF point)
-{
-  // we update the second last point for polygon since the last point is connected to first one
-  mPoints.replace(mPoints.size() - 2, point);
-}
-
-void PolygonAnnotation::drawRectangleCornerItems()
-{
-  mIsFinishedCreatingShape = true;
-  // remove the last point since mouse double click event has added an extra point to it.....
-  mPoints.remove(mPoints.size() - 1);
-  // the loop should run -1 size so that we dont have two corner item for starting and ending points
-  for (int i = 0 ; i < this->mPoints.size() - 1 ; i++)
-  {
-    QPointF point = this->mPoints.at(i);
-    RectangleCornerItem *rectangleCornerItem = new RectangleCornerItem(point.x(), point.y(), i, this);
-    mRectangleCornerItemsList.append(rectangleCornerItem);
-  }
-  emit updateShapeAnnotation();
-}
-
-QString PolygonAnnotation::getShapeAnnotation()
-{
-  QString annotationString;
-  annotationString.append("Polygon(");
-
-  if (!mVisible)
-  {
-    annotationString.append("visible=false,");
-  }
-
-  annotationString.append("points={");
-  for (int i = 0 ; i < mPoints.size() ; i++)
-  {
-    annotationString.append("{").append(QString::number(mapToScene(mPoints[i]).x())).append(",");
-    annotationString.append(QString::number(mapToScene(mPoints[i]).y())).append("}");
-    if (i < mPoints.size() - 1)
-      annotationString.append(",");
-  }
-  annotationString.append("},");
-
-  annotationString.append("rotation=").append(QString::number(this->rotation())).append(",");
-
-  annotationString.append("lineColor={");
-  annotationString.append(QString::number(mLineColor.red())).append(",");
-  annotationString.append(QString::number(mLineColor.green())).append(",");
-  annotationString.append(QString::number(mLineColor.blue()));
-  annotationString.append("},");
-
-  annotationString.append("fillColor={");
-  annotationString.append(QString::number(mFillColor.red())).append(",");
-  annotationString.append(QString::number(mFillColor.green())).append(",");
-  annotationString.append(QString::number(mFillColor.blue()));
-  annotationString.append("},");
-
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.value() == mLinePattern)
-    {
-      annotationString.append("pattern=LinePattern.").append(it.key()).append(",");
-      break;
-    }
-  }
-
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = this->mFillPatternsMap.begin(); fill_it != this->mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.value() == mFillPattern)
-    {
-      annotationString.append("fillPattern=FillPattern.").append(fill_it.key()).append(",");
-      break;
-    }
-  }
-
-  annotationString.append("lineThickness=").append(QString::number(mThickness));
-  if (mSmooth)
-  {
-    annotationString.append(",smooth=Smooth.Bezier");
-  }
-
-  annotationString.append(")");
-  return annotationString;
-}
-
-void PolygonAnnotation::updatePoint(int index, QPointF point)
-{
-  // if updating the starting point then update the end point with it as well
-  if (index == 0)
-  {
-    mPoints.replace(index, point);
-    mPoints.back() = mPoints.first();
-  }
-  else
-  {
-    mPoints.replace(index, point);
-  }
-}
-
-void PolygonAnnotation::parseShapeAnnotation(QString shape, OMCProxy *omc)
-{
-  // parse the shape to get the list of attributes of Polygon.
-  QStringList list = StringHandler::getStrings(shape);
-  if (list.size() < 8)
-  {
-    return;
-  }
-
-  // if first item of list is true then the Polygon should be visible.
-  this->mVisible = static_cast<QString>(list.at(0)).contains("true");
-
-  int index = 0;
-  QStringList originList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(1)));
-  mOrigin.setX(static_cast<QString>(originList.at(0)).toFloat());
-  mOrigin.setY(static_cast<QString>(originList.at(1)).toFloat());
-  mRotation = static_cast<QString>(list.at(2)).toFloat();
-  index = 2;
-  // second item of list contains the color.
-  index = index + 1;
-  QStringList colorList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(index)));
-  if (colorList.size() < 3)
-  {
-    return;
-  }
-
-  int red = static_cast<QString>(colorList.at(0)).toInt();
-  int green = static_cast<QString>(colorList.at(1)).toInt();
-  int blue = static_cast<QString>(colorList.at(2)).toInt();
-  this->mLineColor = QColor (red, green, blue);
-
-  // third item of list contains the color.
-  index = index + 1;
-  QStringList fillColorList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(index)));
-  if (fillColorList.size() < 3)
-  {
-    return;
-  }
-
-  red = static_cast<QString>(fillColorList.at(0)).toInt();
-  green = static_cast<QString>(fillColorList.at(1)).toInt();
-  blue = static_cast<QString>(fillColorList.at(2)).toInt();
-  this->mFillColor = QColor (red, green, blue);
-
-  // fourth item of list contains the Line Pattern.
-  index = index + 1;
-  QString linePattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.key().compare(linePattern) == 0)
-    {
-      this->mLinePattern = it.value();
-      break;
-    }
-  }
-
-  // fifth item of list contains the Line Pattern.
-  index = index + 1;
-  QString fillPattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = this->mFillPatternsMap.begin(); fill_it != this->mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.key().compare(fillPattern) == 0)
-    {
-      this->mFillPattern = fill_it.value();
-      break;
-    }
-  }
-
-  // sixth item of list contains the thickness.
-  index = index + 1;
-  this->mThickness = static_cast<QString>(list.at(index)).toFloat();
-
-  // seventh item of list contains the points.
-  index = index + 1;
-  QStringList pointsList = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(list.at(index)));
-  foreach (QString point, pointsList)
-  {
-    QStringList polygonPoints = StringHandler::getStrings(StringHandler::removeFirstLastCurlBrackets(point));
-    if (polygonPoints.size() < 2)
-      return;
-
-    qreal x = static_cast<QString>(polygonPoints.at(0)).toFloat();
-    qreal y = static_cast<QString>(polygonPoints.at(1)).toFloat();
-    QPointF p (x, y);
-    this->mPoints.append(p);
-  }
-
-  // eighth item of the list contains the corner radius.
-  index = index + 1;
-  this->mSmooth = static_cast<QString>(list.at(index)).toLower().contains("smooth.bezier");
-}
Index: /branches/OMEdit/OMEditGUI/PolygonAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/PolygonAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/PolygonAnnotation.h	(revision 13537)
@@ -41,11 +41,11 @@
 
 class OMCProxy;
-class Component_OMC;
+class Component;
 
-class PolygonAnnotation_OMC : public ShapeAnnotation_OMC
+class PolygonAnnotation : public ShapeAnnotation
 {
   Q_OBJECT
 public:
-  PolygonAnnotation_OMC(QString annotation, Component_OMC *pParent);
+  PolygonAnnotation(QString annotation, Component *pParent);
   void parseShapeAnnotation(QString annotation);
   QRectF boundingRect() const;
@@ -55,26 +55,3 @@
 };
 
-
-class PolygonAnnotation : public ShapeAnnotation
-{
-  Q_OBJECT
-public:
-  PolygonAnnotation(QString shape, Component *pParent);
-  PolygonAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  PolygonAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  QRectF boundingRect() const;
-  QPainterPath shape() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  void drawPolygonAnnotaion(QPainter *painter);
-  void addPoint(QPointF point);
-  void updateEndPoint(QPointF point);
-  void drawRectangleCornerItems();
-  QString getShapeAnnotation();
-  void parseShapeAnnotation(QString shape, OMCProxy *omc);
-
-  Component *mpComponent;
-public slots:
-  void updatePoint(int index, QPointF point);
-};
-
 #endif // POLYGONANNOTATION_H
Index: /branches/OMEdit/OMEditGUI/RectangleAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/RectangleAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/RectangleAnnotation.cpp	(revision 13537)
@@ -36,11 +36,11 @@
 #include "RectangleAnnotation.h"
 
-RectangleAnnotation_OMC::RectangleAnnotation_OMC(QString annotation, Component_OMC *pParent)
-  : ShapeAnnotation_OMC(pParent)
+RectangleAnnotation::RectangleAnnotation(QString annotation, Component *pParent)
+  : ShapeAnnotation(pParent)
 {
   parseShapeAnnotation(annotation);
 }
 
-void RectangleAnnotation_OMC::parseShapeAnnotation(QString annotation)
+void RectangleAnnotation::parseShapeAnnotation(QString annotation)
 {
   GraphicItem::parseShapeAnnotation(annotation);
@@ -64,10 +64,10 @@
 }
 
-QRectF RectangleAnnotation_OMC::boundingRect() const
+QRectF RectangleAnnotation::boundingRect() const
 {
   return shape().boundingRect();
 }
 
-QPainterPath RectangleAnnotation_OMC::shape() const
+QPainterPath RectangleAnnotation::shape() const
 {
   QPainterPath path;
@@ -76,5 +76,5 @@
 }
 
-void RectangleAnnotation_OMC::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void RectangleAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
   Q_UNUSED(option);
@@ -87,5 +87,5 @@
 }
 
-void RectangleAnnotation_OMC::drawRectangleAnnotaion(QPainter *painter)
+void RectangleAnnotation::drawRectangleAnnotaion(QPainter *painter)
 {
   applyLinePattern(painter);
@@ -115,303 +115,2 @@
   painter->drawRoundedRect(getBoundingRect(), mRadius, mRadius);
 }
-
-
-
-
-
-RectangleAnnotation::RectangleAnnotation(QString shape, Component *pParent)
-  : ShapeAnnotation(pParent), mpCompnent(pParent)
-{
-  initializeFields();
-  parseShapeAnnotation(shape, mpCompnent->getOMCProxy());
-}
-
-RectangleAnnotation::RectangleAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-RectangleAnnotation::RectangleAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  parseShapeAnnotation(shape, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy());
-  mIsCustomShape = true;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-QRectF RectangleAnnotation::boundingRect() const
-{
-  return shape().boundingRect();
-}
-
-QPainterPath RectangleAnnotation::shape() const
-{
-  QPainterPath path;
-  path.addRoundedRect(getBoundingRect(), mCornerRadius, mCornerRadius);
-  return addPathStroker(path);
-}
-
-void RectangleAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-
-  if (transformOriginPoint() != boundingRect().center())
-  {
-    setTransformOriginPoint(boundingRect().center());
-  }
-
-  drawRectangleAnnotaion(painter);
-}
-
-void RectangleAnnotation::drawRectangleAnnotaion(QPainter *painter)
-{
-  QPainterPath path;
-
-  switch (this->mFillPattern)
-  {
-    case Qt::LinearGradientPattern:
-    {
-      QLinearGradient gradient(getBoundingRect().center().x(), getBoundingRect().center().y(),
-                               getBoundingRect().center().x(), getBoundingRect().y());
-      gradient.setColorAt(0.0, this->mFillColor);
-      gradient.setColorAt(1.0, this->mLineColor);
-      gradient.setSpread(QGradient::ReflectSpread);
-      painter->setBrush(gradient);
-      break;
-    }
-    case Qt::Dense1Pattern:
-    {
-      QLinearGradient gradient(getBoundingRect().center().x(), getBoundingRect().center().y(),
-                               getBoundingRect().x(), getBoundingRect().center().y());
-      gradient.setColorAt(0.0, this->mFillColor);
-      gradient.setColorAt(1.0, this->mLineColor);
-      gradient.setSpread(QGradient::ReflectSpread);
-      painter->setBrush(gradient);
-      break;
-    }
-    case Qt::RadialGradientPattern:
-    {
-      QRadialGradient gradient(getBoundingRect().center().x(), getBoundingRect().center().y(),
-                               getBoundingRect().width());
-      gradient.setColorAt(0.0, this->mFillColor);
-      gradient.setColorAt(1.0, this->mLineColor);
-      gradient.setSpread(QGradient::ReflectSpread);
-      painter->setBrush(gradient);
-      break;
-    }
-    default:
-      painter->setBrush(QBrush(this->mFillColor, mFillPattern));
-      break;
-  }
-
-  // make the pen width upper rounded if rectangle is rounded
-  qreal thickness;
-  // if (mCornerRadius > 0) // this is commented intentionally so that we dont need path stroker. Also helps in svg rendering
-  thickness = ceil(mThickness);
-
-  QPen pen(mLineColor, thickness, mLinePattern);
-  pen.setCosmetic(true);
-  painter->setPen(pen);
-
-  path.addRoundedRect(getBoundingRect(), mCornerRadius, mCornerRadius);
-  painter->drawPath(path);
-}
-
-void RectangleAnnotation::addPoint(QPointF point)
-{
-  mExtent.append(point);
-}
-
-void RectangleAnnotation::updateEndPoint(QPointF point)
-{
-  mExtent.back() = point;
-}
-
-void RectangleAnnotation::drawRectangleCornerItems()
-{
-  mIsFinishedCreatingShape = true;
-  for (int i = 0 ; i < this->mExtent.size() ; i++)
-  {
-    QPointF point = this->mExtent.at(i);
-    RectangleCornerItem *rectangleCornerItem = new RectangleCornerItem(point.x(), point.y(), i, this);
-    mRectangleCornerItemsList.append(rectangleCornerItem);
-  }
-  emit updateShapeAnnotation();
-}
-
-QString RectangleAnnotation::getShapeAnnotation()
-{
-  QString annotationString;
-  annotationString.append("Rectangle(");
-
-  if (!mVisible)
-  {
-    annotationString.append("visible=false,");
-  }
-
-  annotationString.append("rotation=").append(QString::number(this->rotation())).append(",");
-
-  annotationString.append("lineColor={");
-  annotationString.append(QString::number(mLineColor.red())).append(",");
-  annotationString.append(QString::number(mLineColor.green())).append(",");
-  annotationString.append(QString::number(mLineColor.blue()));
-  annotationString.append("},");
-
-  annotationString.append("fillColor={");
-  annotationString.append(QString::number(mFillColor.red())).append(",");
-  annotationString.append(QString::number(mFillColor.green())).append(",");
-  annotationString.append(QString::number(mFillColor.blue()));
-  annotationString.append("},");
-
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.value() == mLinePattern)
-    {
-      annotationString.append("pattern=LinePattern.").append(it.key()).append(",");
-      break;
-    }
-  }
-
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = this->mFillPatternsMap.begin(); fill_it != this->mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.value() == mFillPattern)
-    {
-      annotationString.append("fillPattern=FillPattern.").append(fill_it.key()).append(",");
-      break;
-    }
-  }
-
-  annotationString.append("lineThickness=").append(QString::number(mThickness)).append(",");
-  annotationString.append("extent={{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).y())).append("},{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).y()));
-
-  annotationString.append("}}");
-
-  annotationString.append(")");
-  return annotationString;
-}
-
-void RectangleAnnotation::updatePoint(int index, QPointF point)
-{
-
-  mExtent.replace(index, point);
-}
-
-void RectangleAnnotation::parseShapeAnnotation(QString shape, OMCProxy *omc)
-{
-  // Remove { } from shape
-
-  shape = shape.replace("{", "");
-  shape = shape.replace("}", "");
-
-  // parse the shape to get the list of attributes of Rectangle.
-  QStringList list = StringHandler::getStrings(shape);
-  if (list.size() < 16)
-  {
-    return;
-  }
-
-  // if first item of list is true then the Rectangle should be visible.
-  this->mVisible = static_cast<QString>(list.at(0)).contains("true");
-
-  int index = 0;
-  mOrigin.setX(static_cast<QString>(list.at(1)).toFloat());
-  mOrigin.setY(static_cast<QString>(list.at(2)).toFloat());
-  mRotation = static_cast<QString>(list.at(3)).toFloat();
-  index = 3;
-  // 2,3,4 items of list contains the line color.
-  index = index + 1;
-  int red, green, blue;
-
-  red = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  green = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  blue = static_cast<QString>(list.at(index)).toInt();
-  this->mLineColor = QColor (red, green, blue);
-
-  // 5,6,7 items of list contains the fill color.
-  index = index + 1;
-  red = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  green = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  blue = static_cast<QString>(list.at(index)).toInt();
-  this->mFillColor = QColor (red, green, blue);
-
-  // 8 item of the list contains the line pattern.
-  index = index + 1;
-  QString linePattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = this->mLinePatternsMap.begin(); it != this->mLinePatternsMap.end(); ++it)
-  {
-    if (it.key().compare(linePattern) == 0)
-    {
-      this->mLinePattern = it.value();
-      break;
-    }
-  }
-
-  // 9 item of the list contains the fill pattern.
-  index = index + 1;
-  QString fillPattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = this->mFillPatternsMap.begin(); fill_it != this->mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.key().compare(fillPattern) == 0)
-    {
-      this->mFillPattern = fill_it.value();
-      break;
-    }
-  }
-
-  // 10 item of the list contains the thickness.
-  index = index + 1;
-  this->mThickness = static_cast<QString>(list.at(index)).toFloat();
-
-  // 11 item of the list contains the border pattern.
-  index = index + 1;
-  QString borderPattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::BrushStyle>::iterator border_it;
-  for (border_it = this->mBorderPatternsMap.begin(); border_it != this->mBorderPatternsMap.end(); ++border_it)
-  {
-    if (border_it.key() == borderPattern)
-    {
-      this->mBorderPattern = border_it.value();
-      break;
-    }
-  }
-
-  // 12, 13, 14, 15 items of the list contains the extent points of rectangle.
-  index = index + 1;
-  qreal x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  qreal y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p1 (x, y);
-  index = index + 1;
-  x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p2 (x, y);
-
-  this->mExtent.append(p1);
-  this->mExtent.append(p2);
-
-  // 16 item of the list contains the corner radius.
-  index = index + 1;
-  this->mCornerRadius = static_cast<QString>(list.at(index)).toFloat();
-}
Index: /branches/OMEdit/OMEditGUI/RectangleAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/RectangleAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/RectangleAnnotation.h	(revision 13537)
@@ -41,11 +41,11 @@
 
 class OMCProxy;
-class Component_OMC;
+class Component;
 
-class RectangleAnnotation_OMC : public ShapeAnnotation_OMC
+class RectangleAnnotation : public ShapeAnnotation
 {
   Q_OBJECT
 public:
-  RectangleAnnotation_OMC(QString annotation, Component_OMC *pParent);
+  RectangleAnnotation(QString annotation, Component *pParent);
   void parseShapeAnnotation(QString annotation);
   QRectF boundingRect() const;
@@ -58,26 +58,3 @@
 };
 
-
-class RectangleAnnotation : public ShapeAnnotation
-{
-  Q_OBJECT
-public:
-  RectangleAnnotation(QString shape, Component *pParent);
-  RectangleAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  RectangleAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  QRectF boundingRect() const;
-  QPainterPath shape() const;
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  void drawRectangleAnnotaion(QPainter *painter);
-  void addPoint(QPointF point);
-  void updateEndPoint(QPointF point);
-  void drawRectangleCornerItems();
-  QString getShapeAnnotation();
-  void parseShapeAnnotation(QString shape, OMCProxy *omc);
-
-  Component *mpCompnent;
-public slots:
-  void updatePoint(int index, QPointF point);
-};
-
 #endif // RECTANGLEANNOTATION_H
Index: /branches/OMEdit/OMEditGUI/SearchClassDialog.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/SearchClassDialog.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/SearchClassDialog.cpp	(revision 13537)
@@ -114,4 +114,8 @@
 }
 
+void SearchClassSuggestion::setClassesList(QStringList classes)
+{
+  mClassesList = classes;
+}
 
 bool SearchClassSuggestion::eventFilter(QObject *pObject, QEvent *event)
@@ -206,8 +210,5 @@
     return;
   }
-  MainWindow* pMainWindow = mpSearchClassBox->getSearchClassDialog()->getMainWindow();
   QStringList foundedItemsList;
-  mClassesList.clear();
-  mClassesList = pMainWindow->getOMCProxy()->getClassNames("", "true");
   foreach (QString item, mClassesList)
   {
@@ -336,2 +337,17 @@
   mpMainWindow->openLibraryTreeNode(pItem, mpDontOpenClassCheckBox->isChecked());
 }
+
+//! Checks the activation of the dialog.
+//! Only fetch the classes from OMC once when the dialog becomes active.
+//! @param QEvent
+void SearchClassDialog::changeEvent(QEvent *event)
+{
+  if (event->type() == QEvent::ActivationChange)
+  {
+    if (isActiveWindow())
+    {
+      mpSearchClassTextBox->getSearchClassSuggestion()->getClassesList().clear();
+      mpSearchClassTextBox->getSearchClassSuggestion()->setClassesList(getMainWindow()->getOMCProxy()->getClassNames("", "true"));
+    }
+  }
+}
Index: /branches/OMEdit/OMEditGUI/SearchClassDialog.h
===================================================================
--- /branches/OMEdit/OMEditGUI/SearchClassDialog.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/SearchClassDialog.h	(revision 13537)
@@ -64,4 +64,5 @@
   SearchClassBox* getSearchClassBox();
   QStringList getClassesList();
+  void setClassesList(QStringList classes);
   bool eventFilter(QObject *pObject, QEvent *event);
   void showCompletion(const QStringList &choices);
@@ -96,4 +97,6 @@
   void searchClasses();
   void openLibraryTreeNode(QTreeWidgetItem *pItem, int column);
+protected:
+  virtual void changeEvent(QEvent *event);
 };
 
Index: /branches/OMEdit/OMEditGUI/ShapeAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/ShapeAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/ShapeAnnotation.cpp	(revision 13537)
@@ -104,5 +104,5 @@
 }
 
-ShapeAnnotation_OMC::ShapeAnnotation_OMC(QGraphicsItem *parent)
+ShapeAnnotation::ShapeAnnotation(QGraphicsItem *parent)
   : QGraphicsItem(parent)
 {
@@ -110,5 +110,5 @@
 }
 
-QPainterPath ShapeAnnotation_OMC::addPathStroker(QPainterPath &path) const
+QPainterPath ShapeAnnotation::addPathStroker(QPainterPath &path) const
 {
   QPainterPathStroker stroker;
@@ -117,5 +117,5 @@
 }
 
-QRectF ShapeAnnotation_OMC::getBoundingRect() const
+QRectF ShapeAnnotation::getBoundingRect() const
 {
   QPointF p1 = mExtent.size() > 0 ? mExtent.at(0) : QPointF(-100.0, -100.0);
@@ -128,5 +128,5 @@
 }
 
-void ShapeAnnotation_OMC::applyLinePattern(QPainter *painter)
+void ShapeAnnotation::applyLinePattern(QPainter *painter)
 {
   qreal thickness;
@@ -137,5 +137,5 @@
 }
 
-void ShapeAnnotation_OMC::applyFillPattern(QPainter *painter)
+void ShapeAnnotation::applyFillPattern(QPainter *painter)
 {
   switch (mFillPattern)
@@ -182,1408 +182,6 @@
 }
 
-QString ShapeAnnotation_OMC::getShapeAnnotation()
-{
-  return QString();
-}
-
-
-
-
-ShapeAnnotation::ShapeAnnotation(QGraphicsItem *parent)
-  : QGraphicsItem(parent), mSettings(QSettings::IniFormat, QSettings::UserScope, "openmodelica", "omedit")
-{
-  mpGraphicsView = 0;
-  mpTransformation = new Transformation;
-}
-
-ShapeAnnotation::ShapeAnnotation(GraphicsView *pGraphicsView, QGraphicsItem *parent)
-  : QGraphicsItem(parent), mSettings(QSettings::IniFormat, QSettings::UserScope, "openmodelica", "omedit")
-{
-  mpGraphicsView = pGraphicsView;
-  mpTransformation = new Transformation;
-  //Construct the temporary polygon that is shown when scaling or rotating
-  mpResizerRectangle = new QGraphicsRectItem;
-  mpResizerRectangle->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
-  mpResizerRectangle->setVisible(false);
-  mpResizerRectangle->setZValue(1001);      // set to a very high value
-  QPen pen;
-  pen.setStyle(Qt::DotLine);
-  pen.setColor(Qt::red);
-  mpResizerRectangle->setPen(pen);
-  createActions();
-}
-
-ShapeAnnotation::~ShapeAnnotation()
-{
-  // delete all the corner items associated with item
-  foreach (RectangleCornerItem *rectangleCornerItem, mRectangleCornerItemsList)
-  {
-    delete rectangleCornerItem;
-  }
-}
-
-void ShapeAnnotation::initializeFields()
-{
-  // initialize the Line Patterns map.
-  this->mLinePatternsMap.insert("None", Qt::NoPen);
-  this->mLinePatternsMap.insert("Solid", Qt::SolidLine);
-  this->mLinePatternsMap.insert("Dash", Qt::DashLine);
-  this->mLinePatternsMap.insert("Dot", Qt::DotLine);
-  this->mLinePatternsMap.insert("DashDot", Qt::DashDotLine);
-  this->mLinePatternsMap.insert("DashDotDot", Qt::DashDotDotLine);
-  // initialize the Fill Patterns map.
-  this->mFillPatternsMap.insert("None", Qt::NoBrush);
-  this->mFillPatternsMap.insert("Solid", Qt::SolidPattern);
-  this->mFillPatternsMap.insert("Horizontal", Qt::HorPattern);
-  this->mFillPatternsMap.insert("Vertical", Qt::VerPattern);
-  this->mFillPatternsMap.insert("Cross", Qt::CrossPattern);
-  // since we flipped the co-ordinates of view so to get patterns right switch between forward and backward.
-  this->mFillPatternsMap.insert("Forward", Qt::BDiagPattern);
-  this->mFillPatternsMap.insert("Backward", Qt::FDiagPattern);
-  this->mFillPatternsMap.insert("CrossDiag", Qt::DiagCrossPattern);
-  this->mFillPatternsMap.insert("HorizontalCylinder", Qt::LinearGradientPattern);
-  this->mFillPatternsMap.insert("VerticalCylinder", Qt::Dense1Pattern);
-  this->mFillPatternsMap.insert("Sphere", Qt::RadialGradientPattern);
-
-  // initialize the Arrows map.
-  this->mArrowsMap.insert("None", ShapeAnnotation::None);
-  this->mArrowsMap.insert("Open", ShapeAnnotation::Open);
-  this->mArrowsMap.insert("Filled", ShapeAnnotation::Filled);
-  this->mArrowsMap.insert("Half", ShapeAnnotation::Half);
-
-  this->mVisible = true;
-  mOrigin.setX(0);
-  mOrigin.setY(0);
-  mRotation = 0;
-  //loads the initial saved settings for the shape
-  mLineColor=QColor(0,0,255);
-  this->mFillColor = QColor (0, 0, 255);
-  mLinePattern = Qt::SolidLine;
-  this->mFillPattern = Qt::NoBrush;
-  mThickness = 0.25;
-  this->mBorderPattern = Qt::NoBrush;
-  this->mCornerRadius = 0;
-  mSmooth = false;
-  mStartArrow = ShapeAnnotation::None;
-  mEndArrow = ShapeAnnotation::None;
-  mArrowSize = 3;
-
-  mIsCustomShape = false;
-  mIsFinishedCreatingShape = false;
-  mIsRectangleCorneItemClicked = false;
-  readSettings();
-}
-
-
-void ShapeAnnotation::readSettings()
-{
-  mSettings.sync();
-  readPenStyleSettings();
-  readBrushStyleSettings();
-}
-
-
-
-void ShapeAnnotation::readPenStyleSettings()
-{
-  if (mSettings.contains("penstyle/color"))
-  {
-    if (mSettings.value("penstyle/color").toString().isEmpty())
-      mLineColor=Qt::transparent;
-    else
-      mLineColor= QColor(mSettings.value("penstyle/color").toUInt());
-  }
-  if (mSettings.contains("penstyle/pattern"))
-    mLinePattern = mLinePatternsMap.value(mSettings.value("penstyle/pattern").toString());
-  //  mLinePattern=Qt::PenStyle(mSettings.value("penstyle/pattern"));
-  if (mSettings.contains("penstyle/thickness"))
-    mThickness=mSettings.value("penstyle/thickness").toDouble();
-  if (mSettings.contains("penstyle/smooth"))
-    mSmooth= mSettings.value("penstyle/smooth").toBool();
-}
-
-void ShapeAnnotation::readBrushStyleSettings()
-{
-  if (mSettings.contains("brushstyle/color"))
-  {
-    if (mSettings.value("brushstyle/color").toString().isEmpty())
-      mFillColor= Qt::transparent;
-    else
-      mFillColor= QColor(mSettings.value("brushstyle/color").toUInt());
-  }
-  if (mSettings.contains("brushstyle/pattern"))
-    mFillPattern = mFillPatternsMap.value(mSettings.value("brushstyle/pattern").toString());
-  if(mFillColor==Qt::transparent)
-    mFillPattern= Qt::NoBrush;
-}
-
-void ShapeAnnotation::createActions()
-{
-  mpShapePropertiesAction = new QAction(QIcon(":/Resources/icons/tool.png"), tr("Properties"), mpGraphicsView);
-  mpShapePropertiesAction->setStatusTip(tr("Shows the shape properties"));
-  connect(mpShapePropertiesAction, SIGNAL(triggered()), SLOT(openShapeProperties()));
-  //for editing properties of text
-  mpTextPropertiesAction = new QAction(QIcon(":/Resources/icons/tool.png"), tr("Text Properties"), mpGraphicsView);
-  mpTextPropertiesAction->setStatusTip(tr("Shows the shape text properties"));
-  connect(mpTextPropertiesAction, SIGNAL(triggered()), SLOT(openTextProperties()));
-  //for arrow of line
-  mpNoArrowAction = new QAction(tr("NoArrow(Start)"), mpGraphicsView);
-  mpNoArrowAction->setStatusTip(tr("No Arrow on the line"));
-  connect(mpNoArrowAction, SIGNAL(triggered()), SLOT(noArrowLine()));
-  mpHalfArrowAction = new QAction(tr("HalfArrow(Start)"), mpGraphicsView);
-  mpHalfArrowAction->setStatusTip(tr("Half Arrow for the line"));
-  connect(mpHalfArrowAction, SIGNAL(triggered()), SLOT(halfArrowLine()));
-  mpOpenArrowAction = new QAction(tr("OpenArrow(Start)"), mpGraphicsView);
-  mpOpenArrowAction->setStatusTip(tr("Open Arrow on the line"));
-  connect(mpOpenArrowAction, SIGNAL(triggered()), SLOT(openArrowLine()));
-  mpFilledArrowAction = new QAction(tr("FilledArrow(Start)"), mpGraphicsView);
-  mpFilledArrowAction->setStatusTip(tr("Filled Arrow for the line"));
-  connect(mpFilledArrowAction, SIGNAL(triggered()), SLOT(filledArrowLine()));
-  mpNoEndArrowAction = new QAction(tr("NoArrow(End)"), mpGraphicsView);
-  mpNoEndArrowAction->setStatusTip(tr("No Arrow on the line"));
-  connect(mpNoEndArrowAction, SIGNAL(triggered()), SLOT(noEndArrowLine()));
-  mpHalfEndArrowAction = new QAction(tr("HalfArrow(End)"), mpGraphicsView);
-  mpHalfEndArrowAction->setStatusTip(tr("Half Arrow for the line"));
-  connect(mpHalfEndArrowAction, SIGNAL(triggered()), SLOT(halfEndArrowLine()));
-  mpOpenEndArrowAction = new QAction(tr("OpenArrow(End)"), mpGraphicsView);
-  mpOpenEndArrowAction->setStatusTip(tr("Open Arrow on the line"));
-  connect(mpOpenEndArrowAction, SIGNAL(triggered()), SLOT(openEndArrowLine()));
-  mpFilledEndArrowAction = new QAction(tr("FilledArrow(End"), mpGraphicsView);
-  mpFilledEndArrowAction->setStatusTip(tr("Filled Arrow for the line"));
-  connect(mpFilledEndArrowAction, SIGNAL(triggered()), SLOT(filledEndArrowLine()));
-
-}
-
-void ShapeAnnotation::setSelectionBoxActive()
-{
-  foreach (RectangleCornerItem *rectangleCornerItem, mRectangleCornerItemsList)
-  {
-    rectangleCornerItem->setActive();
-  }
-}
-
-void ShapeAnnotation::setSelectionBoxPassive()
-{
-  foreach (RectangleCornerItem *rectangleCornerItem, mRectangleCornerItemsList)
-  {
-    rectangleCornerItem->setPassive();
-  }
-}
-
-void ShapeAnnotation::setSelectionBoxHover()
-{
-  foreach (RectangleCornerItem *rectangleCornerItem, mRectangleCornerItemsList)
-  {
-    rectangleCornerItem->setHovered();
-  }
-}
-
 QString ShapeAnnotation::getShapeAnnotation()
 {
   return QString();
 }
-
-QRectF ShapeAnnotation::getBoundingRect() const
-{
-  QPointF p1 = mExtent.size() > 0 ? mExtent.at(0) : QPointF(-100.0, -100.0);
-  QPointF p2 = mExtent.size() > 1 ? mExtent.at(1) : QPointF(100.0, 100.0);
-
-  qreal left = qMin(p1.x(), p2.x());
-  qreal top = qMin(p1.y(), p2.y());
-  qreal width = fabs(p1.x() - p2.x());
-  qreal height = fabs(p1.y() - p2.y());
-
-  return QRectF (left, top, width, height);
-}
-
-QPainterPath ShapeAnnotation::addPathStroker(QPainterPath &path) const
-{
-  QPainterPathStroker stroker;
-  stroker.setWidth(Helper::shapesStrokeWidth);
-  return stroker.createStroke(path);
-}
-
-//! Tells the component to ask its parent to delete it.
-void ShapeAnnotation::deleteMe()
-{
-  // make sure you disconnect all signals before deleting the object
-  disconnect(mpGraphicsView->mpHorizontalFlipAction, SIGNAL(triggered()), this, SLOT(flipHorizontal()));
-  disconnect(mpGraphicsView->mpVerticalFlipAction, SIGNAL(triggered()), this, SLOT(flipVertical()));
-  disconnect(mpGraphicsView->mpRotateIconAction, SIGNAL(triggered()), this, SLOT(rotateClockwise()));
-  disconnect(mpGraphicsView->mpRotateAntiIconAction, SIGNAL(triggered()), this, SLOT(rotateAntiClockwise()));
-  disconnect(mpGraphicsView->mpResetRotation, SIGNAL(triggered()), this, SLOT(resetRotation()));
-  disconnect(mpGraphicsView->mpDeleteIconAction, SIGNAL(triggered()), this, SLOT(deleteMe()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressDelete()), this, SLOT(deleteMe()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressUp()), this, SLOT(moveUp()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressDown()), this, SLOT(moveDown()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressLeft()), this, SLOT(moveLeft()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressRight()), this, SLOT(moveRight()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressRotateClockwise()), this, SLOT(rotateClockwise()));
-  disconnect(mpGraphicsView, SIGNAL(keyPressRotateAntiClockwise()), this, SLOT(rotateAntiClockwise()));
-  // delete the object
-  GraphicsView *pGraphicsView = qobject_cast<GraphicsView*>(const_cast<QObject*>(sender()));
-  mpGraphicsView->deleteShapeObject(this);
-  mpGraphicsView->scene()->removeItem(this);
-  // if the signal is not send by graphicsview then emit updateshapeannotation
-  if (!pGraphicsView)
-  {
-    emit updateShapeAnnotation();
-  }
-  deleteLater();
-}
-
-void ShapeAnnotation::doSelect()
-{
-  mIsRectangleCorneItemClicked = true;
-  if (!this->isSelected())
-    setSelectionBoxActive();
-}
-
-void ShapeAnnotation::doUnSelect()
-{
-  mIsRectangleCorneItemClicked = false;
-  if (!this->isSelected())
-    setSelectionBoxPassive();
-}
-
-//! Slot that moves component one pixel upwards
-//! @see moveDown()
-//! @see moveLeft()
-//! @see moveRight()
-void ShapeAnnotation::moveUp()
-{
-  //qDebug() << "in update R22:: " <<mExtent<<mapFromScene(mapToScene(this->pos()));
-  // QPointF point = mExtent.at(0);
-  // point.ry()++;
-  // mExtent.replace(0, point);
-  // point = mExtent.at(1);
-  // point.ry()++;
-  // mExtent.replace(1, point);
-  //qDebug() << "in update R33:: " <<mExtent<<mapFromScene(mapToScene(this->pos()));
-  this->setPos(this->pos().x(), this->mapFromScene(this->mapToScene(this->pos())).y()+1);
-  mpGraphicsView->scene()->update();
-
-  //qDebug() << "in update R11:: " <<mExtent.at(0);
-  emit updateShapeAnnotation();
-  //qDebug() << "in update R22:: " <<mExtent.at(0);
-  //mExtent.replace(0,mapToScene(mExtent.at(0)));
-  //mExtent.replace(1,mapToScene(mExtent.at(1)));
-  //qDebug() << "in update R33:: " <<mExtent.at(0);
-}
-
-//! Slot that moves component one pixel downwards
-//! @see moveUp()
-//! @see moveLeft()
-//! @see moveRight()
-void ShapeAnnotation::moveDown()
-{
-  this->setPos(this->pos().x(), this->mapFromScene(this->mapToScene(this->pos())).y()-1);
-  mpGraphicsView->scene()->update();
-  emit updateShapeAnnotation();
-
-  //mExtent.replace(0,mapToScene(mExtent.at(0)));
-  //mExtent.replace(1,mapToScene(mExtent.at(1)));
-}
-
-//! Slot that moves component one pixel leftwards
-//! @see moveUp()
-//! @see moveDown()
-//! @see moveRight()
-void ShapeAnnotation::moveLeft()
-{
-  this->setPos(this->mapFromScene(this->mapToScene(this->pos())).x()-1, this->pos().y());
-  mpGraphicsView->scene()->update();
-  emit updateShapeAnnotation();
-  //mExtent.replace(0,mapToScene(mExtent.at(0)));
-  //mExtent.replace(1,mapToScene(mExtent.at(1)));
-}
-
-//! Slot that moves component one pixel rightwards
-//! @see moveUp()
-//! @see moveDown()
-//! @see moveLeft()
-void ShapeAnnotation::moveRight()
-{
-  this->setPos(this->mapFromScene(this->mapToScene(this->pos())).x()+1, this->pos().y());
-  mpGraphicsView->scene()->update();
-  emit updateShapeAnnotation();
-  // mExtent.replace(0,mapToScene(mExtent.at(0)));
-  // mExtent.replace(1,mapToScene(mExtent.at(1)));
-}
-
-void ShapeAnnotation::rotateClockwise()
-{
-  qreal oldRotation = mpTransformation->getRotateAngle();
-  qreal rotateIncrement = -90;
-  qreal angle = 0;
-  if (oldRotation == -270)
-    angle = 0;
-  else
-    angle = oldRotation + rotateIncrement;
-  applyRotation(angle);
-}
-
-void ShapeAnnotation::rotateAntiClockwise()
-{
-  qreal oldRotation = mpTransformation->getRotateAngle();
-  qreal rotateIncrement = 90;
-  qreal angle = 0;
-  if (oldRotation == 270)
-    angle = 0;
-  else
-    angle = oldRotation + rotateIncrement;
-  applyRotation(angle);
-}
-
-void ShapeAnnotation::resetRotation()
-{
-  applyRotation(0);
-}
-
-//currently not working correctly
-void ShapeAnnotation::flipHorizontal()
-{
-  QRectF rectan = this->boundingRect();
-  qreal lft =rectan.left();
-  qreal rght = rectan.right();
-  qreal trans =0- lft-rght;
-  this->scale(-1,1);
-  this->translate(trans,0);
-  emit updateShapeAnnotation();
-}
-//currently not working correctly
-void ShapeAnnotation::flipVertical()
-{
-  QRectF rectan = this->boundingRect();
-  qreal tp =rectan.top();
-  qreal btm = rectan.bottom();
-  qreal trans =0- tp-btm;
-  this->scale(1,-1);
-  this->translate(0,trans);
-
-  emit updateShapeAnnotation();
-}
-
-//pen stlye changed for the selected shape shape
-void ShapeAnnotation::changePenProperty()
-{
-  this->mLineColor = mpShapeProperties->getPenColor().rgba();
-  this->mLinePattern = mpShapeProperties->getPenPattern();
-  this->mThickness = mpShapeProperties->getPenThickness();
-  this->mCornerRadius = mpShapeProperties->getCornerRadius();
-  this->mSmooth = mpShapeProperties->getPenSmooth();
-}
-
-//brush style changed for the selected shape
-void ShapeAnnotation::changeBrushProperty()
-{
-  this->mFillColor=mpShapeProperties->getBrushColor();
-  this->mFillPattern=mpShapeProperties->getBrushPattern();
-}
-
-Transformation* ShapeAnnotation::getTransformation()
-{
-  return mpTransformation;
-}
-
-void ShapeAnnotation::createResizerItems()
-{
-  qreal x1, y1, x2, y2;
-  getResizerItemsPositions(&x1, &y1, &x2, &y2);
-  //Bottom left resizer
-  mpBottomLeftResizerItem = new ResizerItem(1, this);
-  mpBottomLeftResizerItem->setPos(mapFromScene(x1, y1));
-  mpBottomLeftResizerItem->setResizePosition(ResizerItem::BottomLeft);
-  connect(mpBottomLeftResizerItem, SIGNAL(resizerItemPressed(ResizerItem*)), SLOT(prepareResizeShape(ResizerItem*)));
-  connect(mpBottomLeftResizerItem, SIGNAL(resizerItemMoved(int,QPointF)), SLOT(resizeShape(int,QPointF)));
-  connect(mpBottomLeftResizerItem, SIGNAL(resizerItemReleased()), SLOT(finishResizeShape()));
-  connect(mpBottomLeftResizerItem, SIGNAL(resizerItemPositionChanged()), SLOT(updateShapePosition()));
-  //Top left resizer
-  mpTopLeftResizerItem = new ResizerItem(2, this);
-  mpTopLeftResizerItem->setPos(mapFromScene(x1, y2));
-  mpTopLeftResizerItem->setResizePosition(ResizerItem::TopLeft);
-  connect(mpTopLeftResizerItem, SIGNAL(resizerItemPressed(ResizerItem*)), SLOT(prepareResizeShape(ResizerItem*)));
-  connect(mpTopLeftResizerItem, SIGNAL(resizerItemMoved(int,QPointF)), SLOT(resizeShape(int,QPointF)));
-  connect(mpTopLeftResizerItem, SIGNAL(resizerItemReleased()), SLOT(finishResizeShape()));
-  connect(mpTopLeftResizerItem, SIGNAL(resizerItemPositionChanged()), SLOT(updateShapePosition()));
-  //Top Right resizer
-  mpTopRightResizerItem = new ResizerItem(3, this);
-  mpTopRightResizerItem->setPos(mapFromScene(x2, y2));
-  mpTopRightResizerItem->setResizePosition(ResizerItem::TopRight);
-  connect(mpTopRightResizerItem, SIGNAL(resizerItemPressed(ResizerItem*)), SLOT(prepareResizeShape(ResizerItem*)));
-  connect(mpTopRightResizerItem, SIGNAL(resizerItemMoved(int,QPointF)), SLOT(resizeShape(int,QPointF)));
-  connect(mpTopRightResizerItem, SIGNAL(resizerItemReleased()), SLOT(finishResizeShape()));
-  connect(mpTopRightResizerItem, SIGNAL(resizerItemPositionChanged()), SLOT(updateShapePosition()));
-  //Bottom Right resizer
-  mpBottomRightResizerItem = new ResizerItem(4, this);
-  mpBottomRightResizerItem->setPos(mapFromScene(x2, y1));
-  mpBottomRightResizerItem->setResizePosition(ResizerItem::BottomRight);
-  connect(mpBottomRightResizerItem, SIGNAL(resizerItemPressed(ResizerItem*)), SLOT(prepareResizeShape(ResizerItem*)));
-  connect(mpBottomRightResizerItem, SIGNAL(resizerItemMoved(int,QPointF)), SLOT(resizeShape(int,QPointF)));
-  connect(mpBottomRightResizerItem, SIGNAL(resizerItemReleased()), SLOT(finishResizeShape()));
-  connect(mpBottomRightResizerItem, SIGNAL(resizerItemPositionChanged()), SLOT(updateShapePosition()));
-}
-
-void ShapeAnnotation::showResizerItems()
-{
-  qreal x1, y1, x2, y2;
-  getResizerItemsPositions(&x1, &y1, &x2, &y2);
-  //Bottom left resizer
-  mpBottomLeftResizerItem->setPos(mapFromScene(x1, y1));
-  mpBottomLeftResizerItem->setActive();
-  //Top left resizer
-  mpTopLeftResizerItem->setPos(mapFromScene(x1, y2));
-  mpTopLeftResizerItem->setActive();
-  //Top Right resizer
-  mpTopRightResizerItem->setPos(mapFromScene(x2, y2));
-  mpTopRightResizerItem->setActive();
-  //Bottom Right resizer
-  mpBottomRightResizerItem->setPos(mapFromScene(x2, y1));
-  mpBottomRightResizerItem->setActive();
-}
-
-void ShapeAnnotation::hideResizerItems()
-{
-  mpBottomLeftResizerItem->setPassive();
-  mpTopLeftResizerItem->setPassive();
-  mpTopRightResizerItem->setPassive();
-  mpBottomRightResizerItem->setPassive();
-}
-
-void ShapeAnnotation::setResizerItemsHover()
-{
-//  mpBottomLeftResizerItem->setHover();
-//  mpTopLeftResizerItem->setHover();
-//  mpTopRightResizerItem->setHover();
-//  mpBottomRightResizerItem->setHover();
-}
-
-void ShapeAnnotation::getResizerItemsPositions(qreal *x1, qreal *y1, qreal *x2, qreal *y2)
-{
-  qreal x11, y11, x22, y22;
-  sceneBoundingRect().getCoords(&x11, &y11, &x22, &y22);
-  if (x11 < x22)
-  {
-    *x1 = x11;
-    *x2 = x22;
-  }
-  else
-  {
-    *x1 = x22;
-    *x2 = x11;
-  }
-  if (y11 < y22)
-  {
-    *y1 = y11;
-    *y2 = y22;
-  }
-  else
-  {
-    *y1 = y22;
-    *y2 = y11;
-  }
-}
-
-void ShapeAnnotation::applyRotation(qreal angle)
-{
-  qreal x1, y1, x2, y2;
-  boundingRect().getCoords(&x1, &y1, &x2, &y2);
-  QPointF extent1, extent2;
-  extent1.setX(mapToScene(x1, y1).x() - scenePos().x());
-  extent1.setY(mapToScene(x1, y1).y() - scenePos().y());
-  extent2.setX(mapToScene(x2, y2).x() - scenePos().x());
-  extent2.setY(mapToScene(x2, y2).y() - scenePos().y());
-  if (mpTransformation->getFlipHorizontal())
-  {
-    extent1.setX(fabs(extent1.x()));
-    extent2.setX(-(fabs(extent2.x())));
-  }
-  else
-  {
-    extent1.setX(-(fabs(extent1.x())));
-    extent2.setX(fabs(extent2.x()));
-  }
-  if (mpTransformation->getFlipVertical())
-  {
-    extent1.setY(fabs(extent1.y()));
-    extent2.setY(-(fabs(extent2.y())));
-  }
-  else
-  {
-    extent1.setY(-(fabs(extent1.y())));
-    extent2.setY(fabs(extent2.y()));
-  }
-  mpTransformation->setOrigin(mpTransformation->getOrigin());
-  mpTransformation->setExtent1(extent1);
-  mpTransformation->setExtent2(extent2);
-  mpTransformation->setRotateAngle(angle);
-  setTransform(mpTransformation->getTransformationMatrix());
-  // if not component instance then updateshapeannotation, component handles this in his own class
-  if (dynamic_cast<Component*>(this))
-  {
-    dynamic_cast<Component*>(this)->updateAnnotationString();
-    showResizerItems();
-  }
-  if (!dynamic_cast<Component*>(this))
-    emit updateShapeAnnotation();
-}
-
-void ShapeAnnotation::openShapeProperties()
-{
-  mpShapeProperties = new ShapeProperties(this, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-  mpShapeProperties->show();
-}
-
-void ShapeAnnotation::openTextProperties()
-{
-  mpGraphicsView->mpTextWidget = new TextWidget(mpGraphicsView->mpTextShape, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-  mpGraphicsView->mpTextWidget->show();
-}
-
-void ShapeAnnotation::prepareResizeShape(ResizerItem *pResizerItem)
-{
-  hideResizerItems();
-  mpSelectedResizerItem = pResizerItem;
-  mTransformationStartPosition = scenePos();
-  mPivotPoint = sceneBoundingRect().center();
-  if (mpSelectedResizerItem->getResizePosition() == ResizerItem::BottomLeft)
-  {
-    mTransformationStartPosition = sceneBoundingRect().topLeft();
-    mPivotPoint = sceneBoundingRect().bottomRight();
-  }
-  else if (mpSelectedResizerItem->getResizePosition() == ResizerItem::TopLeft)
-  {
-    mTransformationStartPosition = sceneBoundingRect().bottomLeft();
-    mPivotPoint = sceneBoundingRect().topRight();
-  }
-  else if (mpSelectedResizerItem->getResizePosition() == ResizerItem::TopRight)
-  {
-    mTransformationStartPosition = sceneBoundingRect().bottomRight();
-    mPivotPoint = sceneBoundingRect().topLeft();
-  }
-  else if (mpSelectedResizerItem->getResizePosition() == ResizerItem::BottomRight)
-  {
-    mTransformationStartPosition = sceneBoundingRect().topRight();
-    mPivotPoint = sceneBoundingRect().bottomLeft();
-  }
-  mpGraphicsView->scene()->addItem(mpResizerRectangle);
-  mpResizerRectangle->setRect(boundingRect()); //Sets the current item to the temporary rect
-  mpResizerRectangle->setVisible(true); //Set the temporary rect visible
-  mpResizerRectangle->setTransform(transform()); //Set the same matrix of this item to the temporary item
-  mpResizerRectangle->setPos(pos());
-}
-
-void ShapeAnnotation::resizeShape(int index, QPointF newPosition)
-{
-  Q_UNUSED(index);
-  float xDistance; //X distance between the current position of the mouse and the starting position mouse
-  float yDistance; //Y distance between the current position of the mouse and the starting position mouse
-  //Calculates the X distance
-  xDistance = newPosition.x() - mTransformationStartPosition.x();
-  if (mTransformationStartPosition.x() < mPivotPoint.x()) //If the starting point is on the negative side of the X plane we do an inverse of the value
-  {
-    xDistance = xDistance * -1;
-  }
-  //Calculates the Y distance
-  yDistance = newPosition.y() - mTransformationStartPosition.y();
-  if (mTransformationStartPosition.y() < mPivotPoint.y()) //If the starting point is on the negative side of the Y plane we do an inverse of the value
-  {
-    yDistance = yDistance * -1;
-  }
-  //Calculate the factors by dividing the distances againts the original size of this container
-  mXFactor = 0;
-  mYFactor = 0;
-  mXFactor = xDistance / sceneBoundingRect().width();
-  mYFactor = yDistance / sceneBoundingRect().height();
-  mXFactor = 1 + mXFactor;
-  mYFactor = 1 + mYFactor;
-  // Applied the transformation to the temporary polygon using the new
-  // scaling factors
-  QPointF pivot = mPivotPoint - pos();
-  //Creates a temporaty transformation
-  QTransform tmpTransform = QTransform().translate(pivot.x(), pivot.y()).rotate(0)
-      .scale(mXFactor, mYFactor)
-      .translate(-pivot.x(), -pivot.y());
-  mpResizerRectangle->setTransform(transform() * tmpTransform); //Multiplies the previous matrix * the temporary
-}
-
-void ShapeAnnotation::finishResizeShape()
-{
-  setTransform(mpResizerRectangle->transform()); //Applies the transformation of the temporary polygon to this item
-  qreal x1, y1, x2, y2;
-  boundingRect().getCoords(&x1, &y1, &x2, &y2);
-  QPointF extent1, extent2;
-  extent1.setX(mapToScene(x1, y1).x() - scenePos().x());
-  extent1.setY(mapToScene(x1, y1).y() - scenePos().y());
-  extent2.setX(mapToScene(x2, y2).x() - scenePos().x());
-  extent2.setY(mapToScene(x2, y2).y() - scenePos().y());
-  if (mXFactor < 0)
-  {
-    if (!mpTransformation->getFlipHorizontal())
-    {
-      extent1.setX(fabs(extent1.x()));
-      extent2.setX(-(fabs(extent2.x())));
-    }
-    else
-    {
-      extent1.setX(-(fabs(extent1.x())));
-      extent2.setX(fabs(extent2.x()));
-    }
-  }
-  else
-  {
-    if (!mpTransformation->getFlipHorizontal())
-    {
-      extent1.setX(-(fabs(extent1.x())));
-      extent2.setX(fabs(extent2.x()));
-    }
-    else
-    {
-      extent1.setX(fabs(extent1.x()));
-      extent2.setX(-(fabs(extent2.x())));
-    }
-  }
-  if (mYFactor < 0)
-  {
-    if (!mpTransformation->getFlipVertical())
-    {
-      extent1.setY(fabs(extent1.y()));
-      extent2.setY(-(fabs(extent2.y())));
-    }
-    else
-    {
-      extent1.setY(-(fabs(extent1.y())));
-      extent2.setY(fabs(extent2.y()));
-    }
-  }
-  else
-  {
-    if (!mpTransformation->getFlipVertical())
-    {
-      extent1.setY(-(fabs(extent1.y())));
-      extent2.setY(fabs(extent2.y()));
-    }
-    else
-    {
-      extent1.setY(fabs(extent1.y()));
-      extent2.setY(-(fabs(extent2.y())));
-    }
-  }
-  mpTransformation->setOrigin(QPointF(transform().m31(), transform().m32())); //Sets this item position as the temporary polygon
-  mpTransformation->setExtent1(extent1);
-  mpTransformation->setExtent2(extent2);
-  setTransform(mpTransformation->getTransformationMatrix());
-  mpGraphicsView->scene()->removeItem(mpResizerRectangle); //Removes the temporary polgyon from the scene.
-  if (isSelected())
-    showResizerItems();
-  else
-    setSelected(true);
-}
-
-void ShapeAnnotation::updateShapePosition()
-{
-  if (dynamic_cast<Component*>(this))
-  {
-    dynamic_cast<Component*>(this)->updateAnnotationString();
-  }
-}
-
-QColor ShapeAnnotation::getLineColor()
-{
-  return mLineColor;
-}
-
-Qt::PenStyle ShapeAnnotation::getLinePattern()
-{
-  return mLinePattern;
-}
-
-double ShapeAnnotation::getLineThickness()
-{
-  return mThickness;
-}
-
-double ShapeAnnotation::getRectCornerRadius()
-{
-  return mCornerRadius;
-}
-
-bool ShapeAnnotation::getLineSmooth()
-{
-  return mSmooth;
-}
-
-QColor ShapeAnnotation::getFillColor()
-{
-  return mFillColor;
-}
-
-Qt::BrushStyle ShapeAnnotation::getFillPattern()
-{
-  return mFillPattern;
-}
-
-void ShapeAnnotation::noArrowLine()
-{
-  this->mStartArrow = ShapeAnnotation::None;
-}
-
-void ShapeAnnotation::halfArrowLine()
-{
-  this->mStartArrow = ShapeAnnotation::Half;
-}
-
-void ShapeAnnotation::openArrowLine()
-{
-  this->mStartArrow = ShapeAnnotation::Open;
-}
-
-void ShapeAnnotation::filledArrowLine()
-{
-  this->mStartArrow = ShapeAnnotation::Filled;
-}
-
-void ShapeAnnotation::noEndArrowLine()
-{
-  this->mEndArrow = ShapeAnnotation::None;
-}
-
-void ShapeAnnotation::halfEndArrowLine()
-{
-  this->mEndArrow = ShapeAnnotation::Half;
-}
-
-void ShapeAnnotation::openEndArrowLine()
-{
-  this->mEndArrow = ShapeAnnotation::Open;
-}
-
-void ShapeAnnotation::filledEndArrowLine()
-{
-  this->mEndArrow = ShapeAnnotation::Filled;
-}
-
-
-//! Event when mouse cursor enters component icon.
-void ShapeAnnotation::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
-{
-  Q_UNUSED(event);
-
-  // only use hover events for user defined lines
-  if (!mIsCustomShape)
-    return;
-
-  if(!this->isSelected())
-    setSelectionBoxHover();
-}
-
-//! Event when mouse cursor leaves component icon.
-void ShapeAnnotation::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
-{
-  Q_UNUSED(event);
-
-  // only use hover events for user defined lines
-  if (!mIsCustomShape)
-    return;
-
-  if(!this->isSelected())
-    setSelectionBoxPassive();
-}
-
-void ShapeAnnotation::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
-  if (event->button() != Qt::LeftButton)
-    return;
-  // only use mouse events for user defined lines
-  if (!mIsCustomShape or !mIsFinishedCreatingShape)
-  {
-    QGraphicsItem::mousePressEvent(event);
-    return;
-  }
-
-  mClickPos = mapToScene(event->pos());
-  mIsItemClicked = true;
-  setCursor(Qt::SizeAllCursor);
-  QGraphicsItem::mousePressEvent(event);
-}
-
-void ShapeAnnotation::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
-  // only use mouse events for user defined lines
-  if (!mIsCustomShape or !mIsFinishedCreatingShape)
-  {
-    QGraphicsItem::mouseReleaseEvent(event);
-    return;
-  }
-
-  if (mClickPos != mapToScene(event->pos()))
-  {
-    mIsItemClicked = false;
-    emit updateShapeAnnotation();
-  }
-  unsetCursor();
-  QGraphicsItem::mouseReleaseEvent(event);
-}
-
-QVariant ShapeAnnotation::itemChange(GraphicsItemChange change, const QVariant &value)
-{
-  QGraphicsItem::itemChange(change, value);
-  if (change == QGraphicsItem::ItemSelectedHasChanged)
-  {
-    if (this->isSelected())
-    {
-      setSelectionBoxActive();
-      // make the connections now
-      connect(mpGraphicsView->mpHorizontalFlipAction, SIGNAL(triggered()), SLOT(flipHorizontal()), Qt::UniqueConnection);
-      connect(mpGraphicsView->mpVerticalFlipAction, SIGNAL(triggered()), SLOT(flipVertical()), Qt::UniqueConnection);
-      connect(mpGraphicsView->mpRotateIconAction, SIGNAL(triggered()), SLOT(rotateClockwise()), Qt::UniqueConnection);
-      connect(mpGraphicsView->mpRotateAntiIconAction, SIGNAL(triggered()), SLOT(rotateAntiClockwise()), Qt::UniqueConnection);
-      connect(mpGraphicsView->mpResetRotation, SIGNAL(triggered()), SLOT(resetRotation()), Qt::UniqueConnection);
-      connect(mpGraphicsView->mpDeleteIconAction, SIGNAL(triggered()), SLOT(deleteMe()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressDelete()), SLOT(deleteMe()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressUp()), SLOT(moveUp()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressDown()), SLOT(moveDown()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressLeft()), SLOT(moveLeft()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressRight()), SLOT(moveRight()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressRotateClockwise()), SLOT(rotateClockwise()), Qt::UniqueConnection);
-      connect(mpGraphicsView, SIGNAL(keyPressRotateAntiClockwise()), SLOT(rotateAntiClockwise()), Qt::UniqueConnection);
-    }
-    // if use has clicked on corner item then dont make it passive
-    else if (!mIsRectangleCorneItemClicked)
-    {
-      setSelectionBoxPassive();
-      disconnect(mpGraphicsView->mpHorizontalFlipAction, SIGNAL(triggered()), this, SLOT(flipHorizontal()));
-      disconnect(mpGraphicsView->mpVerticalFlipAction, SIGNAL(triggered()), this, SLOT(flipVertical()));
-      disconnect(mpGraphicsView->mpRotateIconAction, SIGNAL(triggered()), this, SLOT(rotateClockwise()));
-      disconnect(mpGraphicsView->mpRotateAntiIconAction, SIGNAL(triggered()), this, SLOT(rotateAntiClockwise()));
-      disconnect(mpGraphicsView->mpResetRotation, SIGNAL(triggered()), this, SLOT(resetRotation()));
-      disconnect(mpGraphicsView->mpDeleteIconAction, SIGNAL(triggered()), this, SLOT(deleteMe()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressDelete()), this, SLOT(deleteMe()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressUp()), this, SLOT(moveUp()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressDown()), this, SLOT(moveDown()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressLeft()), this, SLOT(moveLeft()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressRight()), this, SLOT(moveRight()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressRotateClockwise()), this, SLOT(rotateClockwise()));
-      disconnect(mpGraphicsView, SIGNAL(keyPressRotateAntiClockwise()), this, SLOT(rotateAntiClockwise()));
-    }
-  }
-  return value;
-}
-
-void ShapeAnnotation::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
-{
-  if (!mIsCustomShape)
-  {
-    QGraphicsItem::contextMenuEvent(event);
-    return;
-  }
-  //    if (!mpGraphicsView)
-  //    {
-  //        QGraphicsItem::contextMenuEvent(event);
-  //        return;
-  //    }
-
-  setSelected(true);
-  QMenu menu(mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-  QMenu menuArrow(mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow());
-
-  menu.addAction(mpGraphicsView->mpRotateIconAction);
-  menu.addAction(mpGraphicsView->mpRotateAntiIconAction);
-  menu.addAction(mpGraphicsView->mpResetRotation);
-  //menu.addAction(mpGraphicsView->mpHorizontalFlipAction);
-  // menu.addAction(mpGraphicsView->mpVerticalFlipAction);
-  menu.addSeparator();
-  menu.addAction(mpGraphicsView->mpDeleteIconAction);
-  menu.addAction(mpShapePropertiesAction);
-  if (qobject_cast<TextAnnotation*>(this))
-  {
-    menu.addAction(mpTextPropertiesAction);
-
-  }
-
-  if (qobject_cast<LineAnnotation*>(this))
-  {
-    menuArrow.setTitle("LineArrows");
-    menuArrow.addAction(mpNoArrowAction);
-    menuArrow.addAction(mpHalfArrowAction);
-    menuArrow.addAction(mpOpenArrowAction);
-    menuArrow.addAction(mpFilledArrowAction);
-    menuArrow.addSeparator();
-    menuArrow.addAction(mpNoEndArrowAction);
-    menuArrow.addAction(mpHalfEndArrowAction);
-    menuArrow.addAction(mpOpenEndArrowAction);
-    menuArrow.addAction(mpFilledEndArrowAction);
-    menu.addAction(menuArrow.menuAction());
-
-
-  }
-
-  //menu.addAction(mpShapePenStyleAction);
-  //menu.addAction(mpShapeBrushStyleAction);
-  menu.addSeparator();
-  menu.exec(event->screenPos());
-}
-
-ShapeProperties::ShapeProperties(ShapeAnnotation *pShape, MainWindow *pParent)
-  : QDialog(pParent, Qt::WindowTitleHint)
-{
-  setAttribute(Qt::WA_DeleteOnClose);
-  setMinimumSize(400, 300);
-  setModal(true);
-
-  mpMainWindow = pParent;
-  mpShape = pShape;
-  // set the shape type, whether it is Line, Rectangle, Ellipse etc...
-  setShapeType();
-  // set up the dialog based on shape type.
-  setUpDialog();
-}
-
-void ShapeProperties::setShapeType()
-{
-  //if the selected shape is a line
-  if (qobject_cast<LineAnnotation*>(mpShape))
-  {
-    mShapeType = ShapeProperties::Line;
-  }
-  //if the selected shape is a text
-  else if (qobject_cast<TextAnnotation*>(mpShape))
-  {
-    mShapeType = ShapeProperties::Text;
-  }
-  else
-  {
-    mShapeType= ShapeProperties::Rectangle;
-  }
-}
-
-void ShapeProperties::setUpDialog()
-{
-  switch (mShapeType)
-  {
-    //only open pen properties if its a line
-    case ShapeProperties::Line:
-      setUpLineDialog();
-
-      break;
-
-    default:
-      setUpLineDialog();
-
-      break;
-  }
-}
-
-void ShapeProperties::setUpLineDialog()
-{
-  setWindowTitle(QString(Helper::applicationName).append(" - Shape Properties"));
-
-  mpHeadingLabel = new Label(tr("Properties"));
-  mpHeadingLabel->setFont(QFont("", Helper::headingFontSize));
-  mpHeadingLabel->setAlignment(Qt::AlignTop);
-
-  QVBoxLayout *layout = new QVBoxLayout;
-  layout->addWidget(mpHeadingLabel);
-  layout->addLayout(createHorizontalLine());
-  layout->addLayout(createPenControls());
-  if(mShapeType!=ShapeProperties::Line)
-  {
-    layout->addLayout(createBrushControls());
-  }
-  mpOkButton = new QPushButton(tr("OK"));
-  mpOkButton->setAutoDefault(true);
-  connect(mpOkButton, SIGNAL(clicked()), SLOT(applyChanges()));
-  mpCancelButton = new QPushButton(tr("Cancel"));
-  mpCancelButton->setAutoDefault(false);
-  connect(mpCancelButton, SIGNAL(clicked()), SLOT(reject()));
-
-  mpButtonBox = new QDialogButtonBox(Qt::Horizontal);
-  mpButtonBox->addButton(mpOkButton, QDialogButtonBox::ActionRole);
-  mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);
-
-  QGridLayout *mainLayout = new QGridLayout;
-  mainLayout->addLayout(layout, 0, 0);
-  mainLayout->addWidget(mpButtonBox, 4, 0);
-
-  setLayout(mainLayout);
-}
-
-QVBoxLayout* ShapeProperties::createHorizontalLine()
-{
-  mpHorizontalLine = new QFrame();
-  mpHorizontalLine->setFrameShape(QFrame::HLine);
-  mpHorizontalLine->setFrameShadow(QFrame::Sunken);
-
-  QVBoxLayout *layout = new QVBoxLayout;
-  layout->setContentsMargins(0, 0, 0, 0);
-  layout->addWidget(mpHorizontalLine);
-  return layout;
-}
-
-QVBoxLayout* ShapeProperties::createPenControls()
-{
-  mpPenStyleGroup = new QGroupBox(tr("Pen Style"));
-
-  mpPenColorLabel = new Label(tr("Color:"));
-  mpPenColorViewerLabel = new Label(tr(""));
-  mpPenColorPickButton = new QPushButton(tr("Pick Color"));
-  connect(mpPenColorPickButton, SIGNAL(clicked()), SLOT(pickPenColor()));
-  mpPenNoColorCheckBox = new QCheckBox(tr("No Color"));
-  connect(mpPenNoColorCheckBox, SIGNAL(stateChanged(int)), SLOT(penNoColorChecked(int)));
-
-  mpPenPatternLabel = new Label(tr("Pattern:"));
-  mpPenPatternsComboBox = new QComboBox;
-  mpPenPatternsComboBox->setIconSize(Helper::iconSize);
-  mpPenPatternsComboBox->addItem(QIcon(":/Resources/icons/solidline.png"), tr("Solid"), Qt::SolidLine);
-  mpPenPatternsComboBox->addItem(QIcon(":/Resources/icons/dashline.png"), tr("Dash"), Qt::DashLine);
-  mpPenPatternsComboBox->addItem(QIcon(":/Resources/icons/dotline.png"), tr("Dot"), Qt::DotLine);
-  mpPenPatternsComboBox->addItem(QIcon(":/Resources/icons/dashdotline.png"), tr("Dash Dot"), Qt::DashDotLine);
-  mpPenPatternsComboBox->addItem(QIcon(":/Resources/icons/dashdotdotline.png"), tr("Dash Dot Dot"), Qt::DashDotDotLine);
-
-  mpPenThicknessLabel = new Label(tr("Thickness:"));
-  mpPenThicknessSpinBox = new QDoubleSpinBox;
-  // change the locale to C so that decimal char is changed from ',' to '.'
-  mpPenThicknessSpinBox->setLocale(QLocale("C"));
-  mpPenThicknessSpinBox->setRange(0.25, 100.0);
-  mpPenThicknessSpinBox->setSingleStep(0.5);
-  mpCornerRadiusLabel = new Label(tr("CornerRadius:"));
-  mpCornerRadiusSpinBox = new QDoubleSpinBox;
-  // change the locale to C so that decimal char is changed from ',' to '.'
-  mpCornerRadiusSpinBox->setLocale(QLocale("C"));
-  mpCornerRadiusSpinBox->setRange(0.0, 100.0);
-  mpCornerRadiusSpinBox->setSingleStep(0.25);
-  mpSmoothLabel = new Label(tr("Smooth:"));
-  mpSmoothCheckBox = new QCheckBox(tr("Bezier Curve"));
-
-
-  setInitPenColor(mpShape->getLineColor());
-  QPixmap pixmap(Helper::iconSize);
-  pixmap.fill(mPenColor);
-  mpPenColorViewerLabel->setPixmap(pixmap);
-  setInitPenPattern(mpShape->getLinePattern());
-  setInitPenThickness(mpShape->getLineThickness());
-  setInitCornerRadius(mpShape->getRectCornerRadius());
-  setInitPenSmooth(mpShape->getLineSmooth());
-
-  QGridLayout *mainLayout = new QGridLayout;
-  mainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
-  mainLayout->addWidget(mpPenColorLabel, 0, 0);
-  mainLayout->addWidget(mpPenColorViewerLabel, 0, 1);
-  mainLayout->addWidget(mpPenColorPickButton, 1, 0);
-  mainLayout->addWidget(mpPenNoColorCheckBox, 1, 1);
-  if (mShapeType != Text)
-  {
-    mainLayout->addWidget(mpPenPatternLabel, 2, 0, 1, 2);
-    mainLayout->addWidget(mpPenPatternsComboBox, 3, 0);
-    mainLayout->addWidget(mpPenThicknessLabel, 4, 0, 1, 2);
-    mainLayout->addWidget(mpPenThicknessSpinBox, 5, 0);
-  }
-  if (qobject_cast<RectangleAnnotation*>(mpShape))
-  {
-    mainLayout->addWidget(mpCornerRadiusLabel, 6, 0, 1, 2);
-    mainLayout->addWidget(mpCornerRadiusSpinBox, 7, 0);
-  }
-  if (mShapeType == Line)
-  {
-    mainLayout->addWidget(mpSmoothLabel, 6, 0, 1, 2);
-    mainLayout->addWidget(mpSmoothCheckBox, 7, 0);
-  }
-  mpPenStyleGroup->setLayout(mainLayout);
-
-  QVBoxLayout *layout = new QVBoxLayout;
-  layout->setContentsMargins(0, 0, 0, 0);
-  layout->addWidget(mpPenStyleGroup);
-  return layout;
-}
-
-QVBoxLayout* ShapeProperties::createBrushControls()
-{
-  mpBrushStyleGroup = new QGroupBox(tr("Brush Style"));
-
-  mpBrushColorLabel = new Label(tr("Color:"));
-  mpBrushColorViewerLabel = new Label(tr(""));
-  mpBrushColorPickButton = new QPushButton(tr("Pick Color"));
-  connect(mpBrushColorPickButton, SIGNAL(clicked()), SLOT(pickBrushColor()));
-  mpBrushNoColorCheckBox = new QCheckBox(tr("No Color"));
-  connect(mpBrushNoColorCheckBox, SIGNAL(stateChanged(int)), SLOT(brushNoColorChecked(int)));
-
-  mpBrushPatternLabel = new Label(tr("Pattern:"));
-  mpBrushPatternsComboBox = new QComboBox;
-  mpBrushPatternsComboBox->setIconSize(Helper::iconSize);
-  mpBrushPatternsComboBox->addItem(tr("NoBrush"), Qt::NoBrush);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/solid.png"), tr("Solid"), Qt::SolidPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/horizontal.png"), tr("Horizontal"), Qt::HorPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/vertical.png"), tr("Vertical"), Qt::VerPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/cross.png"), tr("Cross"), Qt::CrossPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/forward.png"), tr("Forward"), Qt::BDiagPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/backward.png"), tr("Backward"), Qt::FDiagPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/crossdiag.png"), tr("CrossDiag"), Qt::DiagCrossPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/horizontalcylinder.png"), tr("HorizontalCylinder"), Qt::LinearGradientPattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/verticalcylinder.png"), tr("VertitalCylinder"), Qt::Dense1Pattern);
-  mpBrushPatternsComboBox->addItem(QIcon(":/Resources/icons/sphere.png"), tr("Sphere"), Qt::RadialGradientPattern);
-
-  setInitBrushColor(mpShape->getFillColor());
-  QPixmap pixmap(Helper::iconSize);
-  pixmap.fill(mBrushColor);
-  mpBrushColorViewerLabel->setPixmap(pixmap);
-  setInitBrushPattern(mpShape->getFillPattern());
-
-  QGridLayout *mainLayout = new QGridLayout;
-  mainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
-  mainLayout->addWidget(mpBrushColorLabel, 0, 0);
-  mainLayout->addWidget(mpBrushColorViewerLabel, 0, 1);
-  mainLayout->addWidget(mpBrushColorPickButton, 1, 0);
-  mainLayout->addWidget(mpBrushNoColorCheckBox, 1, 1);
-  if (mShapeType != Text)
-  {
-    mainLayout->addWidget(mpBrushPatternLabel, 2, 0, 1, 2);
-    mainLayout->addWidget(mpBrushPatternsComboBox, 3, 0);
-  }
-  mpBrushStyleGroup->setLayout(mainLayout);
-
-  QVBoxLayout *layout = new QVBoxLayout;
-  layout->setContentsMargins(0, 0, 0, 0);
-  layout->addWidget(mpBrushStyleGroup);
-  return layout;
-}
-
-//functions to set initial settings in the properties widget
-void ShapeProperties::setInitPenPattern(Qt::PenStyle pattern)
-{
-  int index = mpPenPatternsComboBox->findData(pattern);
-  if (index != -1)
-    mpPenPatternsComboBox->setCurrentIndex(index);
-}
-
-void ShapeProperties::setInitCornerRadius(double radius)
-{
-  mpCornerRadiusSpinBox->setValue(radius);
-}
-
-void ShapeProperties::setInitPenThickness(double thickness)
-{
-  mpPenThicknessSpinBox->setValue(thickness);
-}
-
-void ShapeProperties::setInitPenSmooth(bool smooth)
-{
-  mpSmoothCheckBox->setChecked(smooth);
-}
-
-void ShapeProperties::pickPenColor()
-{
-  QColor color = QColorDialog::getColor();
-
-  if (color.spec() == QColor::Invalid)
-    return;
-
-  mPenColor = color;
-  if (mpPenNoColorCheckBox->checkState() == Qt::Unchecked)
-  {
-    QPixmap pixmap(Helper::iconSize);
-    pixmap.fill(mPenColor);
-    mpPenColorViewerLabel->setPixmap(pixmap);
-  }
-}
-
-void ShapeProperties::setInitPenColor(QColor color)
-{
-  mPenColor = color;
-}
-
-QColor ShapeProperties::getPenColor()
-{
-  // if user selects no pen color and selects a brush color then return pen color as transparent
-  if ((mpPenNoColorCheckBox->checkState() == Qt::Checked) and
-      (mBrushColor.spec() != QColor::Invalid))
-    return Qt::transparent;
-  // if user selects no pen color and selects no brush color then return pen color as black(default)
-  else if ((mpPenNoColorCheckBox->checkState() == Qt::Checked) and
-           (mBrushColor.spec() == QColor::Invalid))
-    return Qt::black;
-  else
-    return mPenColor;
-}
-
-void ShapeProperties::setPenPattern()
-{
-  //int index = mpPenPatternsComboBox->findText(pattern, Qt::MatchExactly);
-  //if (index != -1)
-  //mpPenPatternsComboBox->setCurrentIndex(index);
-  if(mpPenPatternsComboBox->currentIndex()== -1)
-  {
-    mPenPattern= Qt::SolidLine;
-  }
-  else
-  {
-    mPenPattern = Qt::PenStyle(mpPenPatternsComboBox->itemData(mpPenPatternsComboBox->currentIndex()).toInt());
-  }
-}
-
-QString ShapeProperties::getPenPatternString()
-{
-  return mpPenPatternsComboBox->currentText();
-}
-
-Qt::PenStyle ShapeProperties::getPenPattern()
-{
-  //return Qt::PenStyle(mpPenPatternsComboBox->itemData(mpPenPatternsComboBox->currentIndex()).toInt());
-  return mPenPattern;
-}
-
-
-void ShapeProperties::penNoColorChecked(int state)
-{
-  if (state == Qt::Checked)
-  {
-    if (mBrushColor.spec() == QColor::Invalid)
-    {
-      QPixmap pixmap(Helper::iconSize);
-      pixmap.fill(Qt::black);
-      mpPenColorViewerLabel->setPixmap(pixmap);
-    }
-    else
-    {
-      QPixmap pixmap(Helper::iconSize);
-      pixmap.fill(Qt::transparent);
-      mpPenColorViewerLabel->setPixmap(pixmap);
-    }
-  }
-  else if (state == Qt::Unchecked)
-  {
-    if (mPenColor.spec() != QColor::Invalid)
-    {
-      QPixmap pixmap(Helper::iconSize);
-      pixmap.fill(mPenColor);
-      mpPenColorViewerLabel->setPixmap(pixmap);
-    }
-  }
-}
-
-void ShapeProperties::setCornerRadius()
-{
-  mRectCornerRadius = mpCornerRadiusSpinBox->value();
-}
-
-double ShapeProperties::getCornerRadius()
-{
-  return mRectCornerRadius;
-}
-
-void ShapeProperties::setPenThickness()
-{
-  mPenThickness = mpPenThicknessSpinBox->value();
-}
-
-double ShapeProperties::getPenThickness()
-{
-  return mPenThickness;
-}
-
-
-void ShapeProperties::setPenSmooth()
-{
-  mPenSmooth= mpSmoothCheckBox->isChecked();
-}
-
-bool ShapeProperties::getPenSmooth()
-{
-  return mPenSmooth;
-}
-
-void ShapeProperties::setInitBrushColor(QColor color)
-{
-  mBrushColor = color;
-}
-
-void ShapeProperties::setInitBrushPattern(Qt::BrushStyle pattern)
-{
-  int index = mpBrushPatternsComboBox->findData(pattern);
-  if (index != -1)
-    mpBrushPatternsComboBox->setCurrentIndex(index);
-}
-
-void ShapeProperties::pickBrushColor()
-{
-  QColor color = QColorDialog::getColor();
-
-  if (color.spec() == QColor::Invalid)
-    return;
-
-  mBrushColor = color;
-
-
-
-  if (mpBrushNoColorCheckBox->checkState() == Qt::Unchecked)
-  {
-    QPixmap pixmap(Helper::iconSize);
-    pixmap.fill(mBrushColor);
-    mpBrushColorViewerLabel->setPixmap(pixmap);
-  }
-}
-
-
-QColor ShapeProperties::getBrushColor()
-{
-  if (mpBrushNoColorCheckBox->checkState() == Qt::Checked)
-    return Qt::transparent;
-  else
-    return mBrushColor;
-}
-
-void ShapeProperties::setBrushPattern()
-{
-  //int index = mpPenPatternsComboBox->findText(pattern, Qt::MatchExactly);
-  //if (index != -1)
-  //mpPenPatternsComboBox->setCurrentIndex(index);
-  if(mpBrushPatternsComboBox->currentIndex()== -1)
-  {
-    mBrushPattern= Qt::NoBrush;
-  }
-  else
-  {
-    mBrushPattern = Qt::BrushStyle(mpBrushPatternsComboBox->itemData(mpBrushPatternsComboBox->currentIndex()).toInt());
-  }
-}
-
-QString ShapeProperties::getBrushPatternString()
-{
-  return mpBrushPatternsComboBox->currentText();
-}
-
-Qt::BrushStyle ShapeProperties::getBrushPattern()
-{
-  //return Qt::PenStyle(mpPenPatternsComboBox->itemData(mpPenPatternsComboBox->currentIndex()).toInt());
-  return mBrushPattern;
-}
-
-void ShapeProperties::brushNoColorChecked(int state)
-{
-  if (state == Qt::Checked)
-  {
-    QPixmap pixmap(Helper::iconSize);
-    pixmap.fill(Qt::transparent);
-    mpBrushColorViewerLabel->setPixmap(pixmap);
-  }
-  else if (state == Qt::Unchecked)
-  {
-    QPixmap pixmap(Helper::iconSize);
-    pixmap.fill(mBrushColor);
-    mpBrushColorViewerLabel->setPixmap(pixmap);
-  }
-}
-
-void ShapeProperties::applyChanges()
-{
-  setPenPattern();
-  setPenThickness();
-  setCornerRadius();
-  setPenSmooth();
-  mpShape->changePenProperty();
-  if(mShapeType!=ShapeProperties::Line)
-  {
-    setBrushPattern();
-    mpShape->changeBrushProperty();
-  }
-  accept();
-}
Index: /branches/OMEdit/OMEditGUI/ShapeAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/ShapeAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/ShapeAnnotation.h	(revision 13537)
@@ -83,10 +83,10 @@
 };
 
-class ShapeAnnotation_OMC : public QObject, public QGraphicsItem, public GraphicItem, public FilledShape
+class ShapeAnnotation : public QObject, public QGraphicsItem, public GraphicItem, public FilledShape
 {
   Q_OBJECT
   Q_INTERFACES(QGraphicsItem)
 public:
-  ShapeAnnotation_OMC(QGraphicsItem *pParent);
+  ShapeAnnotation(QGraphicsItem *pParent);
   QPainterPath addPathStroker(QPainterPath &path) const;
   QRectF getBoundingRect() const;
@@ -100,226 +100,3 @@
 };
 
-// Base class for all shapes annotations
-class ShapeAnnotation : public QObject, public QGraphicsItem
-{
-  Q_OBJECT
-  Q_INTERFACES(QGraphicsItem)
-private:
-  QAction *mpShapePropertiesAction;
-  QAction *mpTextPropertiesAction;
-  QAction *mpShapePenStyleAction;
-  QAction *mpShapeBrushStyleAction;
-
-  QAction *mpNoArrowAction;
-  QAction *mpHalfArrowAction;
-  QAction *mpOpenArrowAction;
-  QAction *mpFilledArrowAction;
-  QAction *mpNoEndArrowAction;
-  QAction *mpHalfEndArrowAction;
-  QAction *mpOpenEndArrowAction;
-  QAction *mpFilledEndArrowAction;
-
-  QSettings mSettings;
-public:
-  ShapeAnnotation(QGraphicsItem *parent = 0);
-  ShapeAnnotation(GraphicsView *pGraphicsView, QGraphicsItem *parent = 0);
-  ~ShapeAnnotation();
-  void initializeFields();
-  void readSettings();
-  void readPenStyleSettings();
-  void readBrushStyleSettings();
-  void createActions();
-  void setSelectionBoxActive();
-  void setSelectionBoxPassive();
-  void setSelectionBoxHover();
-  void changePenProperty();
-  void changeBrushProperty();
-  Transformation* getTransformation();
-  void createResizerItems();
-  void showResizerItems();
-  void hideResizerItems();
-  void setResizerItemsHover();
-  void getResizerItemsPositions(qreal *x1, qreal *y1, qreal *x2, qreal *y2);
-  void applyRotation(qreal angle);
-  //void changeColour();
-  virtual QString getShapeAnnotation();
-  QRectF getBoundingRect() const;
-  QPainterPath addPathStroker(QPainterPath &path) const;
-  ShapeProperties *mpShapeProperties;
-  GraphicsView *mpGraphicsView;
-signals:
-  void updateShapeAnnotation();
-public slots:
-  void deleteMe();
-  void doSelect();
-  void doUnSelect();
-  void moveUp();
-  void moveDown();
-  void moveLeft();
-  void moveRight();
-  void rotateClockwise();
-  void rotateAntiClockwise();
-  void resetRotation();
-  void flipHorizontal();
-  void flipVertical();
-  //void copyComponent();
-  //void pasteComponent();
-  QColor getLineColor();
-  Qt::PenStyle getLinePattern();
-  double getLineThickness();
-  double getRectCornerRadius();
-  bool getLineSmooth();
-  QColor getFillColor();
-  Qt::BrushStyle getFillPattern();
-  void noArrowLine();
-  void halfArrowLine();
-  void openArrowLine();
-  void filledArrowLine();
-  void noEndArrowLine();
-  void halfEndArrowLine();
-  void openEndArrowLine();
-  void filledEndArrowLine();
-
-  void openShapeProperties();
-  void openTextProperties();
-  //void openPenStyleProperties();
-  //void openBrushStyleProperties();
-  void prepareResizeShape(ResizerItem *pResizerItem);
-  void resizeShape(int index, QPointF newPosition);
-  void finishResizeShape();
-  void updateShapePosition();
-protected:
-  bool mVisible;
-  QPointF mOrigin;
-  qreal mRotation;
-  QColor mLineColor;
-  QColor mFillColor;
-  QMap<QString, Qt::PenStyle> mLinePatternsMap;
-  Qt::PenStyle mLinePattern;
-  QMap<QString, Qt::BrushStyle> mFillPatternsMap;
-  Qt::BrushStyle mFillPattern;
-  qreal mThickness;
-  QMap<QString, Qt::BrushStyle> mBorderPatternsMap;
-  Qt::BrushStyle mBorderPattern;
-  QVector<QPointF> mPoints;
-  QList<QPointF> mExtent;
-  qreal mCornerRadius;
-  bool mSmooth;
-  enum ArrowType {None, Open, Filled, Half};
-  QMap<QString, ArrowType> mArrowsMap;
-  int mStartArrow;
-  int mEndArrow;
-  qreal mArrowSize;
-  Transformation *mpTransformation;
-  QGraphicsRectItem *mpResizerRectangle;
-  ResizerItem *mpBottomLeftResizerItem;
-  ResizerItem *mpTopLeftResizerItem;
-  ResizerItem *mpTopRightResizerItem;
-  ResizerItem *mpBottomRightResizerItem;
-  ResizerItem *mpSelectedResizerItem;
-  QPointF mTransformationStartPosition;
-  QPointF mPivotPoint;
-  qreal mXFactor;
-  qreal mYFactor;
-
-  QList<RectangleCornerItem*> mRectangleCornerItemsList;
-  bool mIsCustomShape;
-  bool mIsFinishedCreatingShape;
-  bool mIsRectangleCorneItemClicked;
-  bool mIsItemClicked;
-  QPointF mClickPos;
-
-  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
-  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
-  virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
-  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-  virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
-  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
-};
-
-class ShapeProperties : public QDialog
-{
-  Q_OBJECT
-private:
-  // Heading controls
-  Label *mpHeadingLabel;
-  QFrame *mpHorizontalLine;
-  // Pen style controls
-  QGroupBox *mpPenStyleGroup;
-  Label *mpPenColorLabel;
-  Label *mpPenColorViewerLabel;
-  QPushButton *mpPenColorPickButton;
-  QColor mPenColor;
-  Qt::PenStyle mPenPattern;
-  double mPenThickness;
-  double mRectCornerRadius;
-  bool mPenSmooth;
-  Label *mpSmoothLabel;
-  QCheckBox *mpPenNoColorCheckBox;
-  Label *mpPenPatternLabel;
-  QComboBox *mpPenPatternsComboBox;
-  Label *mpPenThicknessLabel;
-  QDoubleSpinBox *mpPenThicknessSpinBox;
-  Label *mpCornerRadiusLabel;
-  QDoubleSpinBox *mpCornerRadiusSpinBox;
-  QCheckBox *mpSmoothCheckBox;
-  // Brush style controls
-  QGroupBox *mpBrushStyleGroup;
-  Label *mpBrushColorLabel;
-  Label *mpBrushColorViewerLabel;
-  QPushButton *mpBrushColorPickButton;
-  QColor mBrushColor;
-  Qt::BrushStyle mBrushPattern;
-  QCheckBox *mpBrushNoColorCheckBox;
-  Label *mpBrushPatternLabel;
-  QComboBox *mpBrushPatternsComboBox;
-  QPushButton *mpCancelButton;
-  QPushButton *mpOkButton;
-  QDialogButtonBox *mpButtonBox;
-signals:
-  void colourChanged();
-public:
-  ShapeProperties(ShapeAnnotation *pShape, MainWindow *pParent);
-  void setShapeType();
-  void setUpDialog();
-  void setUpLineDialog();
-  void setInitPenColor(QColor color);
-  void setInitPenPattern(Qt::PenStyle pattern);
-  void setInitPenThickness(double thickness);
-  void setInitCornerRadius(double radius);
-  void setInitPenSmooth(bool smooth);
-  QColor getPenColor();
-  void setPenPattern();
-  QString getPenPatternString();
-  Qt::PenStyle getPenPattern();
-  void setPenThickness();
-  double getPenThickness();
-  void setCornerRadius();
-  double getCornerRadius();
-  void setPenSmooth();
-  bool getPenSmooth();
-  void setInitBrushColor(QColor color);
-  void setInitBrushPattern(Qt::BrushStyle pattern);
-  QColor getBrushColor();
-  void setBrushPattern();
-  QString getBrushPatternString();
-  Qt::BrushStyle getBrushPattern();
-  QVBoxLayout* createHorizontalLine();
-  QVBoxLayout* createPenControls();
-  QVBoxLayout* createBrushControls();
-
-  MainWindow *mpMainWindow;
-  ShapeAnnotation *mpShape;
-  enum ShapeType {Line, Polygon, Rectangle, Ellipse, Text, Bitmap};
-  int mShapeType;
-public slots:
-  void pickPenColor();
-  void penNoColorChecked(int state);
-  void pickBrushColor();
-
-  void brushNoColorChecked(int state);
-  void applyChanges();
-
-};
-
 #endif // SHAPEANNOTATION_H
Index: /branches/OMEdit/OMEditGUI/TextAnnotation.cpp
===================================================================
--- /branches/OMEdit/OMEditGUI/TextAnnotation.cpp	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/TextAnnotation.cpp	(revision 13537)
@@ -36,11 +36,11 @@
 #include "TextAnnotation.h"
 
-TextAnnotation_OMC::TextAnnotation_OMC(QString annotation, Component_OMC *pParent)
-  : ShapeAnnotation_OMC(pParent), mpComponent(pParent)
+TextAnnotation::TextAnnotation(QString annotation, Component *pParent)
+  : ShapeAnnotation(pParent), mpComponent(pParent)
 {
   parseShapeAnnotation(annotation);
 }
 
-void TextAnnotation_OMC::parseShapeAnnotation(QString annotation)
+void TextAnnotation::parseShapeAnnotation(QString annotation)
 {
   GraphicItem::parseShapeAnnotation(annotation);
@@ -112,10 +112,10 @@
 }
 
-QRectF TextAnnotation_OMC::boundingRect() const
+QRectF TextAnnotation::boundingRect() const
 {
   return shape().boundingRect();
 }
 
-QPainterPath TextAnnotation_OMC::shape() const
+QPainterPath TextAnnotation::shape() const
 {
   QPainterPath path;
@@ -124,5 +124,5 @@
 }
 
-void TextAnnotation_OMC::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void TextAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 {
   Q_UNUSED(option);
@@ -234,214 +234,4 @@
 }
 
-void TextAnnotation_OMC::checkNameString()
-{
-  /* the name of the component can be present in any inherited class . So we start with the main class and then
-       move up the hierarchy looking for the name.
-    */
-  if (mTextString.contains("%name"))
-  {
-    if (!mpComponent->getName().isEmpty())
-      mTextString = mpComponent->getName();
-    else
-    {
-      Component_OMC *pComponent = mpComponent;
-      while (pComponent->getParentComponent())
-      {
-        pComponent = pComponent->getParentComponent();
-        if (!pComponent->getName().isEmpty())
-        {
-          mTextString = pComponent->getName();
-          break;
-        }
-      }
-    }
-  }
-}
-
-
-
-
-TextAnnotation::TextAnnotation(QString shape, Component *pParent)
-  : ShapeAnnotation(pParent), mpComponent(pParent)
-{
-  initializeFields();
-  mFontWeight = QFont::Normal;
-  mFontItalic = false;
-  mFontName = StringHandler::getDefaultSystemFont().family();
-  mHorizontalAlignment = Qt::AlignCenter;
-  mFontUnderLine = false;
-  mFontSize = 0;
-  mCalculatedFontSize = 1;
-  setLetterSpacing(0);
-  parseShapeAnnotation(shape, mpComponent->getOMCProxy());
-}
-
-TextAnnotation::TextAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mFontWeight = QFont::Normal;
-  mFontItalic = false;
-  mFontName = StringHandler::getDefaultSystemFont().family();
-  mHorizontalAlignment = Qt::AlignCenter;
-  mFontUnderLine = false;
-  mFontSize = 0;
-  mCalculatedFontSize = 1;
-  setLetterSpacing(0);
-  mTextString = QString("Text Here");
-  mIsCustomShape = true;
-  mpComponent = 0;
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-  connect(this, SIGNAL(extentChanged()), SLOT(calculateFontSize()));
-}
-
-TextAnnotation::TextAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
-  : ShapeAnnotation(graphicsView, pParent)
-{
-  // initialize all fields with default values
-  initializeFields();
-  mFontWeight = QFont::Normal;
-  mFontItalic = false;
-  mFontName = StringHandler::getDefaultSystemFont().family();
-  mHorizontalAlignment = Qt::AlignCenter;
-  mFontUnderLine = false;
-  mIsCustomShape = true;
-  mFontSize = 0;
-  mCalculatedFontSize = 1;
-  setLetterSpacing(0);
-  mpComponent = 0;
-  connect(this, SIGNAL(extentChanged()), SLOT(calculateFontSize()));
-  parseShapeAnnotation(shape, mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow()->getOMCProxy());
-  emit extentChanged();
-  setAcceptHoverEvents(true);
-  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
-}
-
-QRectF TextAnnotation::boundingRect() const
-{
-  return shape().boundingRect();
-}
-
-QPainterPath TextAnnotation::shape() const
-{
-  QPainterPath path;
-  path.addRoundedRect(getBoundingRect(), mCornerRadius, mCornerRadius);
-  return path;
-}
-
-void TextAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-  Q_UNUSED(option);
-  Q_UNUSED(widget);
-  if (transformOriginPoint() != boundingRect().center())
-  {
-    setTransformOriginPoint(boundingRect().center());
-  }
-  QPen pen(mLineColor, mThickness, mLinePattern);
-  pen.setCosmetic(true);
-  painter->setPen(pen);
-  //painter->setBrush(QBrush(mFillColor, Qt::SolidPattern));
-  // create the font object
-  QFont font;
-  qreal calculatedFontSize;
-  if (mFontSize == 0)
-  {
-    float factor = sceneBoundingRect().height() / painter->fontMetrics().boundingRect(mTextString).height();
-    calculatedFontSize = painter->font().pointSizeF() * factor;
-    if (calculatedFontSize < 18.0)
-      calculatedFontSize = 18.0;
-    font = QFont(mFontName, calculatedFontSize, mFontWeight, mFontItalic);
-  }
-  else
-    font = QFont(mFontName, mFontSize, mFontWeight, mFontItalic);
-  // set font underline
-  if(mFontUnderLine)
-    font.setUnderline(true);
-  // set letter spacing for the font
-  setLetterSpacingOnFont(&font, getLetterSpacing());
-  painter->setFont(font);
-  // draw the font
-  // first we invert the painter since we have our coordinate system inverted.
-  painter->scale(1.0, -1.0);
-  painter->translate(0, ((-boundingRect().top()) - boundingRect().bottom()));
-
-  if (sceneTransform().m11() < 0)
-  {
-    painter->scale(-1.0, 1.0);
-    painter->translate(((-boundingRect().left()) - boundingRect().right()), 0);
-  }
-  if (sceneTransform().m22() < 0)
-  {
-    painter->scale(1.0, -1.0);
-    painter->translate(0, ((-boundingRect().top()) - boundingRect().bottom()));
-  }
-  qreal radian = atan2(sceneTransform().m12(), sceneTransform().m11());
-  qreal angle = (180 * radian) / M_PI;
-  if (angle == 180 && angle == -180)
-  {
-    painter->scale(-1.0, -1.0);
-    painter->translate(((-boundingRect().left()) - boundingRect().right()), ((-boundingRect().top()) - boundingRect().bottom()));
-  }
-  if (angle == 90 && angle == -90)
-  {
-    painter->scale(1.0, -1.0);
-    painter->translate(0, ((-boundingRect().top()) - boundingRect().bottom()));
-  }
-  //  if (mpComponent)
-  //  {
-  //    // get the root component to check the rotation and transformations.
-  //    Component *pComponent = mpComponent->getRootParentComponent();
-  //    pComponent = mpComponent->getRootParentComponent(true);
-  //    if (pComponent->rotation() == -180 || pComponent->rotation() == 180)
-  //    {
-  //      painter->scale(-1.0, -1.0);
-  //      painter->translate(((-boundingRect().left()) - boundingRect().right()), ((-boundingRect().top()) - boundingRect().bottom()));
-  //    }
-  //    // check transformations.
-  //    if (pComponent->getTransformation())
-  //    {
-  //      // the item could be flipped horizontally
-  //      if (pComponent->getTransformation()->getFlipHorizontalIcon())
-  //      {
-  //        painter->scale(-1.0, 1.0);
-  //        painter->translate(((-boundingRect().left()) - boundingRect().right()), 0);
-  //      }
-  //      // the item could be flipped vertically
-  //      if (pComponent->getTransformation()->getFlipVerticalIcon())
-  //      {
-  //        painter->scale(1.0, -1.0);
-  //        painter->translate(0, ((-boundingRect().top()) - boundingRect().bottom()));
-  //      }
-  //      // the item could be rotated
-  //      if (pComponent->getTransformation()->getRotateAngleIcon() == -180 || pComponent->getTransformation()->getRotateAngleIcon() == 180)
-  //      {
-  //        painter->scale(-1.0, -1.0);
-  //        painter->translate(((-boundingRect().left()) - boundingRect().right()), ((-boundingRect().top()) - boundingRect().bottom()));
-  //      }
-  //    }
-  //  }
-  //  else if (mIsCustomShape)
-  //  {
-  //    if (rotation() == -180 || rotation() == 180)
-  //    {
-  //      painter->scale(-1.0, -1.0);
-  //      painter->translate(((-boundingRect().left()) - boundingRect().right()), ((-boundingRect().top()) - boundingRect().bottom()));
-  //    }
-  //  }
-  //  qDebug() << "topleft :: " << sceneBoundingRect().topLeft();
-  //  qDebug() << "topright :: " << sceneBoundingRect().topRight();
-  //  qDebug() << "bottomleft :: " << sceneBoundingRect().bottomLeft();
-  //  qDebug() << "bottomright :: " << sceneBoundingRect().bottomRight();
-
-  //  painter->drawRect(boundingRect());
-  painter->drawText(boundingRect(), mHorizontalAlignment | Qt::AlignJustify | Qt::TextDontClip, mTextString);
-  //  if (boundingRect().width() > 0)
-  //  {
-  //    painter->drawText(boundingRect(), mHorizontalAlignment | Qt::AlignJustify | Qt::TextDontClip, mTextString);
-  //  }
-}
-
 void TextAnnotation::checkNameString()
 {
@@ -468,610 +258,2 @@
   }
 }
-
-void TextAnnotation::checkParameterString()
-{
-  // look for the string in parameters list
-  //    foreach (IconParameters *parameter, mpComponent->mIconParametersList)
-  //    {
-  //        if (updateParameterString(parameter))
-  //            break;
-  //    }
-}
-
-bool TextAnnotation::updateParameterString(IconParameters *pParamter)
-{
-  QString parameterString;
-  // paramter can be in form R=%R
-  parameterString = QString(pParamter->getName()).append("=%").append(pParamter->getName());
-  if (parameterString == mTextString)
-  {
-    mTextString = QString(pParamter->getName()).append("=").append(pParamter->getDefaultValue());
-    return true;
-  }
-  // paramter can be in form %R
-  parameterString = QString("%").append(pParamter->getName());
-  if (parameterString == mTextString)
-  {
-    mTextString = QString(pParamter->getDefaultValue());
-    return true;
-  }
-  return false;
-}
-
-QString TextAnnotation::getTextString()
-{
-  return mTextString.trimmed();
-}
-
-void TextAnnotation::setTextString(QString text)
-{
-  mTextString = text;
-  update(boundingRect());
-}
-
-void TextAnnotation::setFontName(QString fontName)
-{
-  mFontName = fontName;
-}
-
-QString TextAnnotation::getFontName()
-{
-  return mFontName;
-}
-
-void TextAnnotation::setFontSize(double fontSize)
-{
-  mFontSize = fontSize;
-}
-
-double TextAnnotation::getFontSize()
-{
-  return mFontSize;
-}
-
-void TextAnnotation::setItalic(bool italic)
-{
-  mFontItalic = italic;
-}
-
-bool TextAnnotation::getItalic()
-{
-  return mFontItalic;
-}
-
-void TextAnnotation::setWeight(int bold)
-{
-  mFontWeight = bold;
-}
-
-bool TextAnnotation::getWeight()
-{
-  if (mFontWeight == QFont::Bold)
-    return true;
-  else
-    return false;
-}
-
-void TextAnnotation::setUnderLine(bool underLine)
-{
-  mFontUnderLine = underLine;
-}
-
-bool TextAnnotation::getUnderLine()
-{
-  return mFontUnderLine;
-}
-
-void TextAnnotation::setAlignment(Qt::Alignment alignment)
-{
-  mHorizontalAlignment = alignment;
-}
-
-QString TextAnnotation::getAlignment()
-{
-  switch (mHorizontalAlignment)
-  {
-    case Qt::AlignLeft:
-      return Helper::left;
-    case Qt::AlignCenter:
-      return Helper::center;
-    case Qt::AlignRight:
-      return Helper::right;
-    default:
-      return Helper::left;
-  }
-}
-
-void TextAnnotation::drawRectangleCornerItems()
-{
-  mIsFinishedCreatingShape = true;
-  for (int i = 0 ; i < mExtent.size() ; i++)
-  {
-    QPointF point = mExtent.at(i);
-    RectangleCornerItem *rectangleCornerItem = new RectangleCornerItem(point.x(), point.y(), i, this);
-    mRectangleCornerItemsList.append(rectangleCornerItem);
-  }
-  emit updateShapeAnnotation();
-}
-
-void TextAnnotation::addPoint(QPointF point)
-{
-  mExtent.append(point);
-  if (mExtent.size() < 2)
-    return;
-  emit extentChanged();
-}
-
-void TextAnnotation::updatePoint(int index, QPointF point)
-{
-  mExtent.replace(index, point);
-  emit extentChanged();
-}
-
-void TextAnnotation::updateEndPoint(QPointF point)
-{
-  mExtent.back() = point;
-  emit extentChanged();
-}
-
-void TextAnnotation::updateAnnotation()
-{
-  emit updateShapeAnnotation();
-}
-
-QString TextAnnotation::getShapeAnnotation()
-{
-  QString annotationString;
-  annotationString.append("Text(");
-
-  if (!mVisible)
-  {
-    annotationString.append("visible=false,");
-  }
-
-  annotationString.append("rotation=").append(QString::number(rotation())).append(",");
-
-  annotationString.append("lineColor={");
-  annotationString.append(QString::number(mLineColor.red())).append(",");
-  annotationString.append(QString::number(mLineColor.green())).append(",");
-  annotationString.append(QString::number(mLineColor.blue()));
-  annotationString.append("},");
-
-  annotationString.append("fillColor={");
-  annotationString.append(QString::number(mFillColor.red())).append(",");
-  annotationString.append(QString::number(mFillColor.green())).append(",");
-  annotationString.append(QString::number(mFillColor.blue()));
-  annotationString.append("},");
-
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = mLinePatternsMap.begin(); it != mLinePatternsMap.end(); ++it)
-  {
-    if (it.value() == mLinePattern)
-    {
-      annotationString.append("pattern=LinePattern.").append(it.key()).append(",");
-      break;
-    }
-  }
-
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = mFillPatternsMap.begin(); fill_it != mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.value() == mFillPattern)
-    {
-      annotationString.append("fillPattern=FillPattern.").append(fill_it.key()).append(",");
-      break;
-    }
-  }
-
-  annotationString.append("lineThickness=").append(QString::number(mThickness)).append(",");
-  annotationString.append("extent={{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(0)).y())).append("},{");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).x())).append(",");
-  annotationString.append(QString::number(mapToScene(mExtent.at(1)).y()));
-  annotationString.append("}}");
-
-  annotationString.append(",textString=");
-  annotationString.append('"');
-  annotationString.append(getTextString());
-  annotationString.append('"');
-
-  if(mFontSize != 0)
-  {
-    annotationString.append(",fontSize=");
-    annotationString.append(QString::number(mFontSize));
-
-  }
-
-  if(!(mFontName == StringHandler::getDefaultSystemFont().family()))
-  {
-    annotationString.append(",fontName=");
-    annotationString.append('"');
-    annotationString.append(mFontName);
-    annotationString.append('"');
-  }
-
-  //Annotation for text style bold italic underline
-  if(mFontItalic || (mFontWeight == QFont::Bold) || mFontUnderLine)
-  {
-    annotationString.append(",textStyle={");
-    {
-      if(mFontItalic)
-        annotationString.append("TextStyle.Italic");
-
-      if(mFontWeight == QFont::Bold)
-      {
-        if(mFontItalic)
-          annotationString.append(",TextStyle.Bold");
-        else
-          annotationString.append("TextStyle.Bold");
-      }
-      if(mFontUnderLine)
-      {
-        if(mFontItalic || mFontWeight == QFont::Bold)
-          annotationString.append(",TextStyle.UnderLine");
-        else
-          annotationString.append("TextStyle.UnderLine");
-      }
-    }
-    annotationString.append("}");
-  }
-
-  annotationString.append(")");
-  return annotationString;
-}
-
-QRectF TextAnnotation::getDrawingRect()
-{
-  mDrawingRect = QRect (boundingRect().left(), -(boundingRect().top()), boundingRect().width(),
-                        -(boundingRect().height()));
-  return mDrawingRect;
-}
-
-//! Sets the letter spacing for the Text Annotations.
-//! @param letterSpacing is the new letter spacing.
-//! @see setLetterSpacingOnFont(QFont *font, qreal letterSpacing)
-//! @see getLetterSpacing()
-void TextAnnotation::setLetterSpacing(qreal letterSpacing)
-{
-  mLetterSpacing = letterSpacing;
-}
-
-//! Sets the letter spacing of the Text Annotations for the given Font.
-//! @param font
-//! @param letterSpacing is the new letter spacing.
-//! @see setLetterSpacing(qreal letterSpacing)
-//! @see getLetterSpacing()
-void TextAnnotation::setLetterSpacingOnFont(QFont *font, qreal letterSpacing)
-{
-  //    if (font->letterSpacing() < letterSpacing)
-  //        font->setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
-}
-
-//! Returns the letter spacing used by the Text Annotations.
-//! @param font
-//! @param letterSpacing is the new letter spacing.
-//! @see setLetterSpacing(qreal letterSpacing)
-//! @see setLetterSpacingOnFont(QFont *font, qreal letterSpacing)
-qreal TextAnnotation::getLetterSpacing()
-{
-  return mLetterSpacing;
-}
-
-void TextAnnotation::parseShapeAnnotation(QString shape, OMCProxy *omc)
-{
-  shape = shape.replace("{", "");
-  shape = shape.replace("}", "");
-  // parse the shape to get the list of attributes of Text Annotation.
-  QStringList list = StringHandler::getStrings(shape);
-  if (list.size() < 17)
-  {
-    return;
-  }
-  // if first item of list is true then the Text Annotation should be visible.
-  mVisible = static_cast<QString>(list.at(0)).contains("true");
-  int index = 0;
-  mOrigin.setX(static_cast<QString>(list.at(1)).toFloat());
-  mOrigin.setY(static_cast<QString>(list.at(2)).toFloat());
-  mRotation = static_cast<QString>(list.at(3)).toFloat();
-  index = 3;
-  // 2,3,4 items of list contains the line color.
-  index = index + 1;
-  int red, green, blue;
-  red = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  green = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  blue = static_cast<QString>(list.at(index)).toInt();
-  mLineColor = QColor (red, green, blue);
-  // 5,6,7 items of list contains the fill color.
-  index = index + 1;
-  red = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  green = static_cast<QString>(list.at(index)).toInt();
-  index = index + 1;
-  blue = static_cast<QString>(list.at(index)).toInt();
-  mFillColor = QColor (red, green, blue);
-  // 8 item of the list contains the line pattern.
-  index = index + 1;
-  QString linePattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::PenStyle>::iterator it;
-  for (it = mLinePatternsMap.begin(); it != mLinePatternsMap.end(); ++it)
-  {
-    if (it.key().compare(linePattern) == 0)
-    {
-      mLinePattern = it.value();
-      break;
-    }
-  }
-
-  // 9 item of the list contains the fill pattern.
-  index = index + 1;
-  QString fillPattern = StringHandler::getLastWordAfterDot(list.at(index));
-  QMap<QString, Qt::BrushStyle>::iterator fill_it;
-  for (fill_it = mFillPatternsMap.begin(); fill_it != mFillPatternsMap.end(); ++fill_it)
-  {
-    if (fill_it.key().compare(fillPattern) == 0)
-    {
-      mFillPattern = fill_it.value();
-      break;
-    }
-  }
-
-  // 10 item of the list contains the thickness.
-  index = index + 1;
-  mThickness = static_cast<QString>(list.at(index)).toFloat();
-
-  // 11, 12, 13, 14 items of the list contains the extent points of Text.
-  index = index + 1;
-  qreal x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  qreal y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p1 (x, y);
-  index = index + 1;
-  x = static_cast<QString>(list.at(index)).toFloat();
-  index = index + 1;
-  y = static_cast<QString>(list.at(index)).toFloat();
-  QPointF p2 (x, y);
-  mExtent.append(p1);
-  mExtent.append(p2);
-  // 15 item of the list contains the text string.
-  index = index + 1;
-  if(mIsCustomShape)
-    mTextString = StringHandler::removeFirstLastQuotes(list.at(index));
-  else
-  {
-    mTextString = StringHandler::removeFirstLastQuotes(list.at(index));
-    checkNameString();
-    checkParameterString();
-  }
-  index++;
-  //Now comes the optional parameters.
-  while(index < list.size())
-  {
-    QString line = StringHandler::removeFirstLastQuotes(list.at(index));
-    if(line == "TextStyle.Italic")
-    {
-      mFontItalic = true;
-      index++;
-    }
-    else if(line == "TextStyle.Bold")
-    {
-      mFontWeight = QFont::Bold;
-      index++;
-    }
-    else if(line == "TextStyle.UnderLine")
-    {
-      mFontUnderLine = true;
-      index++;
-    }
-    else if(line.length() < 3)
-    {
-      mFontSize = line.toInt();
-      index++;
-    }
-    else if(line == "TextAlignment.Center" )
-    {
-      mHorizontalAlignment = Qt::AlignCenter;
-      index++;
-    }
-    else if(line == "TextAlignment.Left" )
-    {
-      mHorizontalAlignment = Qt::AlignLeft;
-      index++;
-    }
-    else if(line == "TextAlignment.Right" )
-    {
-      mHorizontalAlignment = Qt::AlignRight;
-      index++;
-    }
-    else if(line.length() > 3)
-    {
-      mFontName = line;
-      index++;
-    }
-    else
-    {
-      index++;
-    }
-  }
-}
-
-void TextAnnotation::calculateFontSize()
-{
-  QFont font(mFontName, mCalculatedFontSize, mFontWeight, mFontItalic);
-  if(mFontUnderLine)
-    font.setUnderline(true);
-  // set letter spacing for the font
-  setLetterSpacingOnFont(&font, getLetterSpacing());
-  QFontMetricsF fontMetric (font);
-  QRectF fontBoundingRect (boundingRect().left(), boundingRect().top(), fontMetric.boundingRect(mTextString).width(),
-                           fontMetric.boundingRect(mTextString).height());
-  // if font boundingrect is within original boundingrect
-  if (boundingRect().contains(fontBoundingRect))
-  {
-    while (boundingRect().contains(fontBoundingRect))
-    {
-      mCalculatedFontSize += 1;
-      font = QFont(mFontName, mCalculatedFontSize, mFontWeight, mFontItalic);
-      if (mFontUnderLine)
-        font.setUnderline(true);
-      // set letter spacing for the font
-      setLetterSpacingOnFont(&font, getLetterSpacing());
-      fontMetric = QFontMetricsF(font);
-      fontBoundingRect = QRectF(boundingRect().left(), boundingRect().top(), fontMetric.boundingRect(mTextString).width(),
-                                fontMetric.boundingRect(mTextString).height());
-    }
-    mCalculatedFontSize -= 1;
-  }
-  // if font boundingrect is not within original boundingrect
-  else
-  {
-    while (!boundingRect().contains(fontBoundingRect))
-    {
-      mCalculatedFontSize -= 1;
-      // make sure calculated font doesn't go in negative.
-      // if calculated font size becomes zero then we have problems because Qt automatically assigns font size if your given font size is 0.
-      if (mCalculatedFontSize <= 0)
-        break;
-      font = QFont(mFontName, mCalculatedFontSize, mFontWeight, mFontItalic);
-      if(mFontUnderLine)
-        font.setUnderline(true);
-      // set letter spacing for the font
-      setLetterSpacingOnFont(&font, getLetterSpacing());
-      fontMetric = QFontMetricsF(font);
-      fontBoundingRect = QRectF(boundingRect().left(), boundingRect().top(), fontMetric.boundingRect(mTextString).width(),
-                                fontMetric.boundingRect(mTextString).height());
-    }
-    mCalculatedFontSize += 1;
-  }
-}
-
-//TextWidget declarations
-
-TextWidget::TextWidget(TextAnnotation *pTextShape, MainWindow *parent)
-  : QDialog(parent, Qt::WindowTitleHint)
-{
-  setWindowTitle(QString(Helper::applicationName).append(" - Text Properties"));
-  setAttribute(Qt::WA_DeleteOnClose);
-  setModal(true);
-  setMinimumSize(300, 300);
-  mpMainWindow = parent;
-  mpTextAnnotation = pTextShape;
-  setUpForm();
-}
-
-void TextWidget::setUpForm()
-{
-  // heading
-  mpHeading = new Label(tr("Text Properties"));
-  mpHeading->setFont(QFont("", Helper::headingFontSize));
-  mpHeading->setAlignment(Qt::AlignTop);
-
-  QHBoxLayout *horizontalLayout = new QHBoxLayout;
-  horizontalLayout->addWidget(mpHeading);
-
-  mHorizontalLine = new QFrame();
-  mHorizontalLine->setFrameShape(QFrame::HLine);
-  mHorizontalLine->setFrameShadow(QFrame::Sunken);
-
-  //Text Label
-  mpTextLabel = new Label(tr("Text of Label:"));
-  mpTextBox = new QLineEdit(mpTextAnnotation->getTextString());
-
-  //Font Name
-  mpFontLabel = new Label(tr("Font Name:"));
-  mpFontFamilyComboBox = new QFontComboBox;
-  int currentIndex;
-  currentIndex = mpFontFamilyComboBox->findText(mpTextAnnotation->getFontName(), Qt::MatchExactly);
-  mpFontFamilyComboBox->setCurrentIndex(currentIndex);
-  //Font Size
-  mpFontSizeLabel = new Label(tr("Font Size:"));
-  mpFontSizeComboBox = new QComboBox;
-  QStringList sizesList;
-  sizesList << "0" << "2" << "4";
-  mpFontSizeComboBox->addItems(sizesList);
-  mpFontSizeComboBox->addItems(Helper::fontSizes.split(","));
-  currentIndex = mpFontSizeComboBox->findText(QString::number(mpTextAnnotation->getFontSize()), Qt::MatchExactly);
-  mpFontSizeComboBox->setCurrentIndex(currentIndex);
-  //Cursive Bold Underline Checkboxes
-  mpCursive = new QCheckBox("Italic", this);
-  mpCursive->setChecked(mpTextAnnotation->getItalic());
-  mpBold = new QCheckBox("Bold", this);
-  mpBold->setChecked(mpTextAnnotation->getWeight());
-  mpUnderline = new QCheckBox("Underline", this);
-  mpUnderline->setChecked(mpTextAnnotation->getUnderLine());
-  mpStylesGroup = new QGroupBox(tr("Styles"));
-  QVBoxLayout *verticalPropertiesLayout = new QVBoxLayout;
-  verticalPropertiesLayout->addWidget(mpCursive);
-  verticalPropertiesLayout->addWidget(mpBold);
-  verticalPropertiesLayout->addWidget(mpUnderline);
-  mpStylesGroup->setLayout(verticalPropertiesLayout);
-  //Alignment
-  mpAlignmentLabel = new Label(tr("Alignment:"));
-  mpAlignmentComboBox = new QComboBox;
-  QStringList alignmentList;
-  alignmentList << Helper::left << Helper::center << Helper::right;
-  mpAlignmentComboBox->addItems(alignmentList);
-  currentIndex = mpAlignmentComboBox->findText(mpTextAnnotation->getAlignment(), Qt::MatchExactly);
-  mpAlignmentComboBox->setCurrentIndex(currentIndex);
-
-  //Buttons
-  mpEditButton = new QPushButton(tr("Ok"));
-  mpEditButton->setAutoDefault(true);
-  connect(mpEditButton, SIGNAL(clicked()), this, SLOT(edit()));
-  mpCancelButton = new QPushButton(tr("Cancel"));
-  mpCancelButton->setAutoDefault(false);
-  connect(mpCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
-  mpButtonBox = new QDialogButtonBox(Qt::Horizontal);
-  mpButtonBox->addButton(mpEditButton, QDialogButtonBox::ActionRole);
-  mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);
-
-  // Create a layout
-  QGridLayout *mainLayout = new QGridLayout;
-  mainLayout->addLayout(horizontalLayout, 0, 0, 1, 2);
-  mainLayout->addWidget(mHorizontalLine, 1, 0, 1, 2);
-  mainLayout->addWidget(mpTextLabel, 2, 0);
-  mainLayout->addWidget(mpTextBox, 2, 1);
-  mainLayout->addWidget(mpFontLabel, 3, 0);
-  mainLayout->addWidget(mpFontFamilyComboBox, 3, 1);
-  mainLayout->addWidget(mpFontSizeLabel, 4, 0);
-  mainLayout->addWidget(mpFontSizeComboBox, 4, 1);
-  mainLayout->addWidget(mpStylesGroup, 5, 0, 1, 2);
-  mainLayout->addWidget(mpAlignmentLabel, 6, 0);
-  mainLayout->addWidget(mpAlignmentComboBox, 6, 1);
-  mainLayout->addWidget(mpButtonBox, 7, 0, 1, 2);
-
-  setLayout(mainLayout);
-}
-
-void TextWidget::edit()
-{
-  if(mpTextBox->text().isEmpty())
-    return;
-
-  mpTextAnnotation->setTextString(mpTextBox->text());
-  mpTextAnnotation->setFontName(mpFontFamilyComboBox->currentText());
-  mpTextAnnotation->setFontSize(mpFontSizeComboBox->currentText().toDouble());
-  mpTextAnnotation->setItalic(mpCursive->isChecked());
-  if (mpBold->isChecked())
-    mpTextAnnotation->setWeight(QFont::Bold);
-  else
-    mpTextAnnotation->setWeight(QFont::Normal);
-  mpTextAnnotation->setUnderLine(mpUnderline->isChecked());
-
-  if (mpAlignmentComboBox->currentText() == "Left")
-    mpTextAnnotation->setAlignment(Qt::AlignLeft);
-  else if (mpAlignmentComboBox->currentText() == "Center")
-    mpTextAnnotation->setAlignment(Qt::AlignCenter);
-  else if (mpAlignmentComboBox->currentText() == "Right")
-    mpTextAnnotation->setAlignment(Qt::AlignRight);
-
-  mpTextAnnotation->updateAnnotation();
-  accept();
-}
-
-void TextWidget::show()
-{
-  setVisible(true);
-}
Index: /branches/OMEdit/OMEditGUI/TextAnnotation.h
===================================================================
--- /branches/OMEdit/OMEditGUI/TextAnnotation.h	(revision 13536)
+++ /branches/OMEdit/OMEditGUI/TextAnnotation.h	(revision 13537)
@@ -45,11 +45,11 @@
 class OMCProxy;
 class IconParameters;
-class Component_OMC;
+class Component;
 
-class TextAnnotation_OMC : public ShapeAnnotation_OMC
+class TextAnnotation : public ShapeAnnotation
 {
   Q_OBJECT
 public:
-  TextAnnotation_OMC(QString annotation, Component_OMC *pParent);
+  TextAnnotation(QString annotation, Component *pParent);
   void parseShapeAnnotation(QString annotation);
   QRectF boundingRect() const;
@@ -58,5 +58,5 @@
   void checkNameString();
 private:
-  Component_OMC *mpComponent;
+  Component *mpComponent;
   QString mTextString;
   qreal mFontSize;
@@ -66,96 +66,3 @@
 };
 
-
-class TextAnnotation : public ShapeAnnotation
-{
-  Q_OBJECT
-private:
-  QString mTextString;
-  qreal mFontSize;
-  qreal mCalculatedFontSize;
-  QString mFontName;
-  int mFontWeight;
-  bool mFontItalic;
-  bool mFontUnderLine;
-  //double mDefaultFontSize;
-  Qt::Alignment mHorizontalAlignment;
-  QRectF mDrawingRect;
-  qreal mLetterSpacing;
-public:
-  TextAnnotation(QString shape, Component *pParent);
-  TextAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-  TextAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
-
-  QRectF boundingRect() const;
-  QString getTextString();
-  QPainterPath shape() const;
-  QString getShapeAnnotation();
-  QRectF getDrawingRect();
-  void setLetterSpacing(qreal letterSpacing);
-  void setLetterSpacingOnFont(QFont *font, qreal letterSpacing);
-  qreal getLetterSpacing();
-
-  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  void checkNameString();
-  void checkParameterString();
-  bool updateParameterString(IconParameters *pParamter);
-  void setTextString(QString text);
-  void setFontName(QString fontName);
-  QString getFontName();
-  void setFontSize(double fontSize);
-  double getFontSize();
-  void setItalic(bool italic);
-  bool getItalic();
-  void setWeight(int bold);
-  bool getWeight();
-  void setUnderLine(bool underLine);
-  bool getUnderLine();
-  void setAlignment(Qt::Alignment alignment);
-  QString getAlignment();
-  void drawRectangleCornerItems();
-  void updateEndPoint(QPointF point);
-  void addPoint(QPointF point);
-  void updateAnnotation();
-  void parseShapeAnnotation(QString shape, OMCProxy *omc);
-
-  Component *mpComponent;
-signals:
-  void extentChanged();
-public slots:
-  void updatePoint(int index, QPointF point);
-  void calculateFontSize();
-};
-
-class TextWidget : public QDialog
-{
-  Q_OBJECT
-public:
-  TextWidget(TextAnnotation *pTextShape, MainWindow *parent);
-  MainWindow *mpMainWindow;
-  void setUpForm();
-  void show();
-private:
-  Label *mpHeading;
-  QFrame *mHorizontalLine;
-  Label *mpTextLabel;
-  QLineEdit *mpTextBox;
-  Label *mpFontLabel;
-  QFontComboBox *mpFontFamilyComboBox;
-  Label *mpFontSizeLabel;
-  QComboBox *mpFontSizeComboBox;
-  Label *mpAlignmentLabel;
-  QComboBox *mpAlignmentComboBox;
-  QGroupBox *mpStylesGroup;
-  QCheckBox *mpCursive;
-  QCheckBox *mpBold;
-  QCheckBox *mpUnderline;
-  QPushButton *mpEditButton;
-  QPushButton *mpCancelButton;
-  QDialogButtonBox *mpButtonBox;
-
-  TextAnnotation *mpTextAnnotation;
-public slots:
-  void edit();
-};
-
 #endif // TEXTANNOTATION_H
