本文整理汇总了C++中UMLClassifier::getAttributeList方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifier::getAttributeList方法的具体用法?C++ UMLClassifier::getAttributeList怎么用?C++ UMLClassifier::getAttributeList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifier
的用法示例。
在下文中一共展示了UMLClassifier::getAttributeList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addClassifier
void RefactoringAssistant::addClassifier( UMLClassifier *classifier, QListViewItem *parent, bool addSuper, bool addSub, bool recurse)
{
QListViewItem *classifierItem, *item;
if( parent )
{
classifierItem = parent;
}
else
{
classifierItem= new KListViewItem( this, classifier->getName() );
m_umlObjectMap[classifierItem] = classifier;
}
connect( classifier, SIGNAL( modified() ), this, SLOT( umlObjectModified() ) );
UMLClassifier *klass = dynamic_cast<UMLClassifier*>(classifier);
if( klass )
{// only Classes have attributes...
connect( classifier, SIGNAL(attributeAdded(UMLClassifierListItem*)),
this, SLOT(attributeAdded(UMLClassifierListItem*)));
connect( classifier, SIGNAL(attributeRemoved(UMLClassifierListItem*)),
this, SLOT(attributeRemoved(UMLClassifierListItem*)));
QListViewItem *attsFolder = new KListViewItem( classifierItem, i18n("Attributes"), "attributes" );
attsFolder->setPixmap(0,SmallIcon("folder_green_open"));
attsFolder->setExpandable( true );
UMLAttributeList atts = klass->getAttributeList();
for( UMLAttribute *att = atts.first(); att; att = atts.next() )
{
attributeAdded( att );
}
}
// add operations
connect( classifier, SIGNAL(operationAdded(UMLClassifierListItem*)),
this, SLOT(operationAdded(UMLClassifierListItem*)));
connect( classifier, SIGNAL(operationRemoved(UMLClassifierListItem*)),
this, SLOT(operationRemoved(UMLClassifierListItem*)));
QListViewItem *opsFolder = new KListViewItem( classifierItem, i18n("Operations"), "operations" );
opsFolder->setPixmap(0,SmallIcon("folder_blue_open"));
opsFolder->setExpandable( true );
UMLOperationList ops(classifier->getOpList());
for( UMLOperation *op = ops.first(); op ; op = ops.next() )
{
operationAdded( op );
}
//if add parents
if(addSuper)
{
QListViewItem *superFolder = new KListViewItem( classifierItem, i18n("Base Classifiers") );
superFolder->setExpandable( true );
UMLClassifierList super = classifier->findSuperClassConcepts();
for( UMLClassifier *cl = super.first(); cl ; cl = super.next() )
{
item = new KListViewItem( superFolder, cl->getName() );
item->setPixmap(0,m_pixmaps.Generalization);
item->setExpandable( true );
m_umlObjectMap[item] = cl;
if( recurse )
{
addClassifier( cl, item, true, false, true);
}
}
}
if(addSub)
{
//add derived classifiers
QListViewItem *derivedFolder = new KListViewItem( classifierItem, i18n("Derived Classifiers") );
derivedFolder->setExpandable( true );
UMLClassifierList derived = classifier->findSubClassConcepts();
for( UMLClassifier *d = derived.first(); d ; d = derived.next() )
{
item = new KListViewItem( derivedFolder, d->getName() );
item->setPixmap(0,m_pixmaps.Subclass);
item->setExpandable( true );
m_umlObjectMap[item] = d;
if( recurse )
{
addClassifier( d, item, false, true, true);
}
}
}
}