// 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) {
this->id = counter++;
}
+QString InterfaceItem::getName() {
+ return refInter->getName();
+}
+
/* boundingRect() : give the bounding rect in the blockitem coord. system */
QRectF InterfaceItem::boundingRect() const {
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));
}
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)){