本文整理汇总了C++中UMLClassifier::isInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ UMLClassifier::isInterface方法的具体用法?C++ UMLClassifier::isInterface怎么用?C++ UMLClassifier::isInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMLClassifier
的用法示例。
在下文中一共展示了UMLClassifier::isInterface方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveToXMI
/**
* Reimplemented from UMLWidget::saveToXMI to save
* classifierwidget data either to 'interfacewidget' or 'classwidget'
* XMI element.
*/
void ClassifierWidget::saveToXMI(QDomDocument & qDoc, QDomElement & qElement)
{
QDomElement conceptElement;
UMLClassifier *umlc = classifier();
QString tagName = umlc->isInterface() ?
"interfacewidget" : "classwidget";
conceptElement = qDoc.createElement(tagName);
UMLWidget::saveToXMI( qDoc, conceptElement );
conceptElement.setAttribute("showoperations", visualProperty(ShowOperations));
conceptElement.setAttribute("showpubliconly", visualProperty(ShowPublicOnly));
conceptElement.setAttribute("showopsigs", m_operationSignature);
conceptElement.setAttribute("showpackage", visualProperty(ShowPackage));
conceptElement.setAttribute("showscope", visualProperty(ShowVisibility));
if (! umlc->isInterface()) {
conceptElement.setAttribute("showattributes", visualProperty(ShowAttributes));
conceptElement.setAttribute("showattsigs", m_attributeSignature);
}
if (umlc->isInterface() || umlc->isAbstract()) {
conceptElement.setAttribute("drawascircle", visualProperty(DrawAsCircle));
}
qElement.appendChild(conceptElement);
}
示例2: writeOverridesRecursive
void CSharpWriter::writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs) {
// oplist for implemented abstract operations
UMLOperationList opabstract;
opabstract.setAutoDelete(false);
UMLClassifier *obj;
for (obj = superclasses->first(); obj; obj = superclasses->next()) {
if (!obj->isInterface() && obj->hasAbstractOps()) {
// collect abstract ops
UMLOperationList opl(obj->getOpList());
for (UMLOperation *op = opl.first(); op ; op = opl.next()) {
if (op->getAbstract()) {
opabstract.append(op);
}
}
// write abstract implementations
cs << m_endl << m_container_indent << m_indentation << "#region " << obj->getName() << " members" << m_endl << m_endl;
writeOperations(opabstract,cs,false,true,true);
cs << m_container_indent << m_indentation << "#endregion" << m_endl << m_endl;
opabstract.clear();
}
// Recurse to parent superclasses
UMLClassifierList superRecursive = obj->getSuperClasses();
UMLClassifierList *superRecursivePtr =& superRecursive;
if (superRecursivePtr->count() > 0) {
writeOverridesRecursive(superRecursivePtr, cs);
}
}
}
示例3: hoverLeaveEvent
/**
* Event handler for hover leave events.
*/
void ClassifierWidget::hoverLeaveEvent(UMLSceneHoverEvent * event)
{
Q_UNUSED(event);
if (!visualProperty(DrawAsCircle)) {
UMLClassifier* umlC = classifier();
if (umlC && !umlC->isInterface()) {
m_attributeExpanderBox->setVisible(false);
}
m_operationExpanderBox->setVisible(false);
}
}
示例4: findAttributeGroups
// these exist for abstract classes only (which become xs:group nodes)
QStringList XMLSchemaWriter::findAttributeGroups (UMLClassifier *c)
{
// we need to look for any class we inherit from. IF these
// have attributes, then we need to notice
QStringList list;
UMLClassifierList superclasses = c->findSuperClassConcepts(); // list of what inherits from us
for(UMLClassifier *classifier = superclasses.first(); classifier; classifier = superclasses.next())
{
if(classifier->getAbstract())
{
// only classes have attributes..
if (!classifier->isInterface()) {
UMLAttributeList attribs = c->getAttributeList();
if (attribs.count() > 0)
list.append(getElementName(classifier)+"AttribGroupType");
}
}
}
return list;
}
示例5: writeClass
void CSharpWriter::writeClass(UMLClassifier *c) {
if (!c) {
kDebug()<<"Cannot write class of NULL concept!" << endl;
return;
}
QString classname = cleanName(c->getName());
//find an appropriate name for our file
QString fileName = findFileName(c, ".cs");
if (fileName.isEmpty()) {
emit codeGenerated(c, false);
return;
}
QFile filecs;
if (!openFile(filecs, fileName)) {
emit codeGenerated(c, false);
return;
}
QTextStream cs(&filecs);
//////////////////////////////
//Start generating the code!!
/////////////////////////////
//try to find a heading file (license, coments, etc)
QString str;
str = getHeadingFile(".cs");
if (!str.isEmpty()) {
str.replace(QRegExp("%filename%"),fileName);
str.replace(QRegExp("%filepath%"),filecs.name());
cs<<str<<m_endl;
}
UMLDoc *umldoc = UMLApp::app()->getDocument();
UMLFolder *logicalView = umldoc->getRootFolder(Uml::mt_Logical);
// write generic includes
cs << "using System;" << m_endl;
cs << "using System.Text;" << m_endl;
cs << "using System.Collections;" << m_endl;
cs << "using System.Collections.Generic;" << m_endl << m_endl;
//write includes and namespace
UMLPackage *container = c->getUMLPackage();
if (container == logicalView)
container = NULL;
UMLPackageList includes;
findObjectsRelated(c, includes);
m_seenIncludes.clear();
//m_seenIncludes.append(logicalView);
if (includes.count()) {
UMLPackage *p;
for (UMLPackageListIt it(includes); (p = it.current()) != NULL; ++it) {
UMLClassifier *cl = dynamic_cast<UMLClassifier*>(p);
if (cl)
p = cl->getUMLPackage();
if (p != logicalView && m_seenIncludes.findRef(p) == -1 && p != container) {
cs << "using " << p->getFullyQualifiedName(".") << ";" << m_endl;
m_seenIncludes.append(p);
}
}
cs << m_endl;
}
m_container_indent = "";
if (container) {
cs << "namespace " << container->getFullyQualifiedName(".") << m_endl;
cs << "{" << m_endl << m_endl;
m_container_indent = m_indentation;
m_seenIncludes.append(container);
}
//Write class Documentation if there is somthing or if force option
if (forceDoc() || !c->getDoc().isEmpty()) {
cs << m_container_indent << "/// <summary>" << m_endl;
cs << formatDoc(c->getDoc(), m_container_indent + "/// " );
cs << m_container_indent << "/// </summary>" << m_endl ;
}
UMLClassifierList superclasses = c->getSuperClasses();
UMLAssociationList aggregations = c->getAggregations();
UMLAssociationList compositions = c->getCompositions();
UMLAssociationList realizations = c->getRealizations();
bool isInterface = c->isInterface();
m_unnamedRoles = 1;
cs << m_container_indent << "public ";
//check if it is an interface or regular class
if (isInterface) {
cs << "interface " << classname;
} else {
//check if class is abstract and / or has abstract methods
if (c->getAbstract() || c->hasAbstractOps())
cs << "abstract ";
//.........这里部分代码省略.........