X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..718736f825077e345ad396f78735c10e21547982:/InterfaceItem.cpp?ds=sidebyside diff --git a/InterfaceItem.cpp b/InterfaceItem.cpp index 552e159..7c384d2 100644 --- a/InterfaceItem.cpp +++ b/InterfaceItem.cpp @@ -19,10 +19,9 @@ InterfaceItem::InterfaceItem(double _position, // CAUTION : the owner must add explicitely this item to its interface, calling addInterface() owner = _owner; params = _params; - selected = false; - name = refInter->getName(); + selected = false; QFontMetrics fmName(params->defaultIfaceFont); - nameWidth = fmName.width(name); + nameWidth = fmName.width(refInter->getName()); nameHeight = fmName.height(); // by default, only data interface are visible if (refInter->getPurpose() == AbstractInterface::Data) { @@ -42,6 +41,10 @@ InterfaceItem::InterfaceItem(){ this->id = counter++; } +QString InterfaceItem::getName() { + return refInter->getName(); +} + /* boundingRect() : give the bounding rect in the blockitem coord. system */ QRectF InterfaceItem::boundingRect() const { @@ -82,11 +85,8 @@ void InterfaceItem::paint(QPainter *painter) { if(selected) { painter->setPen(QPen(Qt::red,2)); - } - else if(refInter->getLevel() == AbstractInterface::Basic) { - painter->setPen(QPen(Qt::darkCyan,1)); - } - else if(refInter->getLevel() == AbstractInterface::Top) { + } + else { painter->setPen(QPen(Qt::black,1)); } @@ -364,11 +364,11 @@ void InterfaceItem::unconnectTo(InterfaceItem *iface) iface->refInter->connectFrom(NULL); } if(iface->refInter->getConnectedTo().contains(refInter)){ - cout << "abnormal case while removing iface conn from " << qPrintable(name) << " to " << qPrintable(iface->name) << endl; + cout << "abnormal case while removing iface conn from " << qPrintable(refInter->getName()) << " to " << qPrintable(iface->refInter->getName()) << endl; iface->refInter->removeConnectedTo(refInter); } if(refInter->getConnectedFrom() == iface->refInter) { - cout << "abnormal case while removing iface conn from " << qPrintable(name) << " to " << qPrintable(iface->name) << endl; + cout << "abnormal case while removing iface conn from " << qPrintable(refInter->getName()) << " to " << qPrintable(iface->refInter->getName()) << endl; refInter->connectFrom(NULL); } if(refInter->getConnectedTo().contains(iface->refInter)){