diff --git a/OMEdit/OMEditLIB/Annotations/TextAnnotation.cpp b/OMEdit/OMEditLIB/Annotations/TextAnnotation.cpp index 6e1316771e4..5c9ec7e750a 100644 --- a/OMEdit/OMEditLIB/Annotations/TextAnnotation.cpp +++ b/OMEdit/OMEditLIB/Annotations/TextAnnotation.cpp @@ -547,11 +547,11 @@ void TextAnnotation::updateTextStringHelper(QRegExp regExp) if (!textValue.isEmpty()) { QString unit = ""; QString displaytUnit = ""; - Element *pComponent = mpComponent->getRootParentComponent()->getComponentByName(variable); - if (pComponent) { - displaytUnit = pComponent->getDerivedClassModifierValue("displaytUnit"); + Element *pElement = mpComponent->getRootParentComponent()->getElementByName(variable); + if (pElement) { + displaytUnit = pElement->getDerivedClassModifierValue("displaytUnit"); if (displaytUnit.isEmpty()) { - unit = pComponent->getDerivedClassModifierValue("unit"); + unit = pElement->getDerivedClassModifierValue("unit"); displaytUnit = unit; } } diff --git a/OMEdit/OMEditLIB/Element/Element.cpp b/OMEdit/OMEditLIB/Element/Element.cpp index a3fbaa29b2e..672db767d3f 100644 --- a/OMEdit/OMEditLIB/Element/Element.cpp +++ b/OMEdit/OMEditLIB/Element/Element.cpp @@ -1315,7 +1315,7 @@ void Element::applyRotation(qreal angle) angle = 0; } mTransformation.setRotateAngle(angle); - updateComponentTransformations(oldTransformation, false); + updateElementTransformations(oldTransformation, false); } void Element::addConnectionDetails(LineAnnotation *pConnectorLineAnnotation) @@ -1745,7 +1745,7 @@ void Element::updateElementTransformations(const Transformation &oldTransformati /*! * \brief Element::handleOMSElementDoubleClick - * Handles the mouse double click for OMS component. + * Handles the mouse double click for OMS element. */ void Element::handleOMSElementDoubleClick() { @@ -1772,23 +1772,23 @@ void Element::setBusComponent(Element *pBusElement) } /*! - * \brief Element::getComponentByName - * Finds the component by name. - * \param componentName + * \brief Element::getElementByName + * Finds the element by name. + * \param elementName * \return */ -Element *Element::getComponentByName(const QString &componentName) +Element *Element::getElementByName(const QString &elementName) { Element *pElementFound = 0; foreach (Element *pElement, getElementsList()) { - if (pElement->getElementInfo() && pElement->getName().compare(componentName) == 0) { + if (pElement->getElementInfo() && pElement->getName().compare(elementName) == 0) { pElementFound = pElement; return pElementFound; } } /* if is not found in components list then look into the inherited components list. */ foreach (Element *pInheritedElement, getInheritedElementsList()) { - pElementFound = pInheritedElement->getElementByName(componentName); + pElementFound = pInheritedElement->getElementByName(elementName); if (pElementFound) { return pElementFound; } diff --git a/OMEdit/OMEditLIB/Element/Element.h b/OMEdit/OMEditLIB/Element/Element.h index 9bb74fc92f8..37ab94a4155 100644 --- a/OMEdit/OMEditLIB/Element/Element.h +++ b/OMEdit/OMEditLIB/Element/Element.h @@ -278,14 +278,11 @@ class Element : public QObject, public QGraphicsItem void removeInterfacePoint(QString interfaceName); void adjustInterfacePoints(); void updateElementTransformations(const Transformation &oldTransformation, const bool positionChanged); - void updateComponentTransformations(const Transformation &oldTransformation, const bool positionChanged) {updateElementTransformations(oldTransformation, positionChanged);} void handleOMSElementDoubleClick(); - void handleOMSComponentDoubleClick() {return handleOMSElementDoubleClick();} bool isInBus() {return mpBusComponent != 0;} void setBusComponent(Element *pBusComponent); Element* getBusComponent() {return mpBusComponent;} - Element* getComponentByName(const QString &componentName); - Element* getElementByName(const QString &componentName) {return getComponentByName(componentName);} + Element* getElementByName(const QString &componentName); Transformation mTransformation; Transformation mOldTransformation; diff --git a/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp b/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp index 57ed53b9f34..f966bfd4333 100644 --- a/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp +++ b/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp @@ -3441,7 +3441,7 @@ void GraphicsView::mouseReleaseEvent(QMouseEvent *event) Transformation oldTransformation = pElement->mTransformation; QPointF positionDifference = pElement->scenePos() - pElement->getOldScenePosition(); pElement->mTransformation.adjustPosition(positionDifference.x(), positionDifference.y()); - pElement->updateComponentTransformations(oldTransformation, true); + pElement->updateElementTransformations(oldTransformation, true); hasComponentMoved = true; } } @@ -3491,7 +3491,7 @@ bool GraphicsView::handleDoubleClickOnComponent(QMouseEvent *event) if (mpModelWidget->getLibraryTreeItem()->getLibraryType() == LibraryTreeItem::CompositeModel) { pRootComponent->showSubModelAttributes(); } else if (mpModelWidget->getLibraryTreeItem()->getLibraryType() == LibraryTreeItem::OMS) { - pRootComponent->handleOMSComponentDoubleClick(); + pRootComponent->handleOMSElementDoubleClick(); } else { removeCurrentTransition(); /* ticket:4401 Open component class with shift + double click */