当前位置: 首页>>代码示例>>Java>>正文


Java Property.getName方法代码示例

本文整理汇总了Java中org.eclipse.uml2.uml.Property.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getName方法的具体用法?Java Property.getName怎么用?Java Property.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.uml2.uml.Property的用法示例。


在下文中一共展示了Property.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ClassAttributeLink

import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
 * Creates a ClassAttributeLink based on the EMF-UML model-elements and
 * layout information provided
 * 
 * @param layout
 *            the layout informations of this link
 * @param assoc
 *            the EMF-UML model-element which holds informations of this
 *            diagram element
 * @param fromClass
 *            the EMF-UML model Class belonging to the from end of this
 *            association
 * @param toClass
 *            the EMF-UML model Class belonging to the to end of this
 *            association
 * @throws UnexpectedEndException
 *             Exception is thrown if an association's end could not be
 *             linked to the EMF-UML model
 */
public ClassAttributeLink(LineAssociation layout, Association assoc, Classifier fromClass, Classifier toClass)
		throws UnexpectedEndException {
	super(layout);
	name = assoc.getLabel();
	from = null;
	to = null;
	for (Property end : assoc.getMemberEnds()) {
		Class endClass = (Class) end.getType();
		// when handling reflexive links then first add the to end's, then
		// the from end's model information (to match the Papyrus exporter
		// behavior)
		if (endClass == toClass && to == null) {
			to = new AssociationEnd(end);
		} else if (endClass == fromClass && from == null) {
			from = new AssociationEnd(end);
		} else {
			throw new UnexpectedEndException(end.getName());
		}
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:40,代码来源:ClassAttributeLink.java

示例2: applyStereotype

import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
 * 요소에 스테레오타입 이름에 해당하는 스테레오타입을 찾아 적용하는 메소드
 * 
 * @param source
 * @param target
 * @param stereotypeName
 * @return
 */
private static Stereotype applyStereotype(Element source, Element target, String stereotypeName) {
    // null 확인
    if (source == null || target == null || stereotypeName == null) {
        return null;
    }

    Stereotype stereotype = target.getAppliedStereotype(stereotypeName);
    if (stereotype == null) {
        stereotype = getApplicableStereotype(target, stereotypeName);

        if (stereotype != null) {
            if (!isAppliedStereotype(target, stereotypeName)) {
                target.applyStereotype(stereotype);
                
                // 소스와 타겟에 같은 스테레오타입이 적용되어 있을 때는 스테레오타입의 특성값도 함께 적용해준다.
                Stereotype sType = source.getAppliedStereotype(stereotype.getQualifiedName());
                if( null != sType) {
                    EList<Property> attributes = sType.getAllAttributes();
                    for (Property property : attributes) {
                        String propertyName = property.getName();
                        Object obj = source.getValue(sType, propertyName);
                        if( null != obj && !propertyName.startsWith(Extension.METACLASS_ROLE_PREFIX)) {
                            target.setValue(stereotype, propertyName, obj);
                        }
                    }
                }
            }
        }
    }

    return stereotype;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:41,代码来源:SemanticModelHandlerUtil.java

示例3: createFigure

import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    NotationNode propertyModel = (NotationNode) getModel();
    Property property = (Property) propertyModel.getUmlModel();
    Image image = UiCorePlugin.getDefault().getImageForUMLElement(property);
    label = new Label(property.getName(), image);
    label.setForegroundColor(ColorConstants.black);
    label.setBorder(new MarginBorders(0, 5, 0, 0));
    label.setToolTip(new Label(label.getText()));

    return label;
    
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:AttributeEditPart.java

示例4: refreshVisuals

import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
 */
@Override
protected void refreshVisuals() {
    try {
        NotationNode propertyModel = (NotationNode) getModel();
        Property property = (Property) propertyModel.getUmlModel();
        Image image = UiCorePlugin.getDefault().getImageForUMLElement(property);
        
        String propertyName = property.getName();

        
        String propertyType = UICoreConstant.EMPTY_STRING;
        if( PreferenceUtil.INSTANCE.getPreferenceStore().getBoolean(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_COMPARTMENT_VISIBILITY_SHOW_TYPE) ){
            if(null != property.getType()){
                propertyType = STRING_COLON + property.getType().getName();
                propertyName = propertyName + propertyType;
            }
        }
        
        if (property.getAssociation() == null) {
            Label label = (Label) getFigure();
            label.setIcon(image);
            label.setText(propertyName);
        }
        label.setToolTip(new Label(propertyName));

    } catch (Exception e) {
        Log.error("AttributeEditPart refreshVisuals() Error " + e);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:33,代码来源:AttributeEditPart.java

示例5: createAssociationsSources

import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
private void createAssociationsSources(String outputDirectory)
		throws FileNotFoundException, UnsupportedEncodingException {

	Set<String> associatedClasses = new HashSet<String>();
	StringBuilder includes = new StringBuilder(
			PrivateFunctionalTemplates.include(LinkTemplates.AssociationsStructuresHreaderName));
	StringBuilder preDeclerations = new StringBuilder("");
	StringBuilder structures = new StringBuilder("");
	StringBuilder functions = new StringBuilder("");

	List<Association> associationList = new ArrayList<Association>();
	CppExporterUtils.getTypedElements(associationList, UMLPackage.Literals.ASSOCIATION, modelRoot);
	for (Association assoc : associationList) {
		Property e1End = assoc.getMemberEnds().get(0);
		Property e2End = assoc.getMemberEnds().get(1);
		String e1 = e1End.getType().getName();
		String e1Name = e1End.getName();
		String e2 = e2End.getType().getName();
		String e2Name = e2End.getName();
		associatedClasses.add(e1);
		associatedClasses.add(e2);
		structures.append(LinkTemplates.createAssociationStructure(assoc.getName(), e1, e2, e1Name, e2Name));

		functions.append(LinkTemplates.linkTemplateSpecializationDef(e1, e2, assoc.getName(), e2Name,
				e2End.isNavigable(), LinkTemplates.LinkFunctionType.Link));
		functions.append(LinkTemplates.linkTemplateSpecializationDef(e2, e1, assoc.getName(), e1Name,
				e1End.isNavigable(), LinkTemplates.LinkFunctionType.Link));

		functions.append(LinkTemplates.linkTemplateSpecializationDef(e2, e1, assoc.getName(), e1Name,
				e1End.isNavigable(), LinkTemplates.LinkFunctionType.Unlink));
		functions.append(LinkTemplates.linkTemplateSpecializationDef(e1, e2, assoc.getName(), e2Name,
				e2End.isNavigable(), LinkTemplates.LinkFunctionType.Unlink));

	}

	for (String className : associatedClasses) {
		includes.append(PrivateFunctionalTemplates.include(className));
		preDeclerations.append(GenerationTemplates.forwardDeclaration(className));
	}
	String headerSource = HeaderTemplates.headerGuard(
			PrivateFunctionalTemplates.include(RuntimeTemplates.RTPath + LinkTemplates.AssocationHeader)
					+ GenerationTemplates.putNamespace(preDeclerations.toString() + structures.toString(),
							GenerationNames.Namespaces.ModelNamespace),
			LinkTemplates.AssociationsStructuresHreaderName);

	CppExporterUtils.writeOutSource(outputDirectory, (LinkTemplates.AssociationStructuresHeader),
			CppExporterUtils.format(headerSource));

	String cppSource = includes.toString()
			+ GenerationTemplates.putNamespace(functions.toString(), GenerationNames.Namespaces.ModelNamespace);
	CppExporterUtils.writeOutSource(outputDirectory, (LinkTemplates.AssociationStructuresSource),
			CppExporterUtils.format(cppSource));

}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:55,代码来源:Uml2ToCppExporter.java

示例6: Attribute

import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
 * Creates an Attribute based on the EMF-UML model-element provided
 * 
 * @param attr
 *            the EMF-UML model-element which holds informations of this
 *            diagram element
 */
public Attribute(Property attr) {
	super(attr.getName(), attr.getVisibility());
	type = attr.getType().getName();
	isStatic = attr.isStatic();
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:13,代码来源:Attribute.java


注:本文中的org.eclipse.uml2.uml.Property.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。