• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Class类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Class类属于org.eclipse.uml2.uml包,在下文中一共展示了Class类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getContainedValidElementCount

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * 입력된 패키지의 하위패키지 중 의미있는 엘리먼트를 가지고 있는지 카운트를 반환한다. 몇개가 있는지가 중요한것이 아니라, 있는지
 * 없는지만 알면 되므로 cnt 가 0을 넘으면 더 이상 수행하지 않고 그냥 cnt 를 반환한다. 이 메소드는 전개 후 불필요하게
 * 생성된 빈 패키지를 없애기 위해 수행된다. 재귀 메소드 임. 의미있는 엘리먼트 : 더 필요하면 추가 할 것 - 클래스, 인터페이스,
 * Collaboration, Actor, Component, Interaction
 * 
 * @param targetPackage
 * @param cnt
 * @return int
 */
public static int getContainedValidElementCount(Package targetPackage, int cnt) {
    if (cnt > 0)
        return cnt;

    for (Package p : targetPackage.getNestedPackages()) {
        for (Element element : p.getOwnedElements()) {
            if (element instanceof Class || element instanceof Interface || element instanceof Collaboration
                || element instanceof Actor || element instanceof Component || element instanceof Interaction) {
                cnt++;
            }
        }

        cnt = getContainedValidElementCount(p, cnt);
    }

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


示例2: getHyperlinks

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * @see org.eclipse.papyrus.infra.hyperlink.service.HyperlinkContributor#getHyperlinks(java.lang.Object)
 *
 * @param object
 * @return
 */
@Override
public List<HyperLinkObject> getHyperlinks(Object object) {
	List<HyperLinkObject> hyperlinks = new ArrayList<>();
	if (object instanceof Class) {
		Class clazz = (Class) object;
		if (UMLUtil.getStereotypeApplication(clazz, Book.class) != null) {
			// TODO: extract a method to get the borrower from a book in the
			// java implementation of the profile
			EList<DirectedRelationship> targetDirectedRelationships = clazz.getTargetDirectedRelationships();
			for (DirectedRelationship dependency : targetDirectedRelationships) {
				if (UMLUtil.getStereotypeApplication(dependency, Borrows.class) != null) {
					EList<Element> targets = dependency.getSources();
					for (Element element : targets) {
						Set<View> crossReferencingViews = CrossReferencerUtil.getCrossReferencingViews(element,null);
						// we take the first available view
						Object firstView = crossReferencingViews.toArray()[0];
						HyperLinkSpecificObject hyperlink = new HyperLinkSpecificObject((EObject) firstView);
						hyperlinks.add(hyperlink);
					}
				}
			}
		}
	}
	return hyperlinks;
}
 
开发者ID:bmaggi,项目名称:library-training,代码行数:32,代码来源:BookToBorrowerHyperlinkContributor.java


示例3: getNavigableElements

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Override
public List<NavigableElement> getNavigableElements(Object fromElement) {
	List<NavigableElement> result = new LinkedList<>();
	Element element = org.eclipse.papyrus.uml.tools.utils.UMLUtil.resolveUMLElement(fromElement);
	if (element instanceof Class){
		final Book book = UMLUtil.getStereotypeApplication(element, Book.class);
		if (book != null) {
			final BookCategory category = book.getCategory();
			Resource eResource = book.eResource();
			EList<EObject> contents = eResource.getContents();
			result = 
					contents.stream()
					.filter(l -> !l.equals(book))		
					.filter(l -> l instanceof Book)
					.map(l -> (Book) l)
					.filter(l -> category.equals(l.getCategory()))
					.map(l -> l.getBase_Class())
					.map(clazz -> new SameCategoryNavigableElement(clazz))
					.collect(Collectors.toList());
		}
	}
	return result;
}
 
开发者ID:bmaggi,项目名称:library-training,代码行数:24,代码来源:SameCategoryNavigationContributor.java


示例4: getApplicableStereotypes

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * find applicable stereotypes for meta class
 * 
 * @param profile
 * @param metaClassName
 * @return
 */

public static List<Stereotype> getApplicableStereotypes(Profile profile, String metaClassName) {

    if (profile == null || metaClassName == null)
        return null;

    List<Stereotype> applicableStereotypes = new ArrayList<Stereotype>();

    for (Iterator<Stereotype> iter = profile.getOwnedStereotypes().iterator(); iter.hasNext();) {
        Stereotype stereotype = (Stereotype) iter.next();
        EList<Class> extendedMetaClasses = stereotype.getExtendedMetaclasses();
        for (int clazzCount = 0; clazzCount < extendedMetaClasses.size(); clazzCount++) {
            Class clazz = extendedMetaClasses.get(clazzCount);
            if (clazz.getName().equals(metaClassName))
                applicableStereotypes.add(stereotype);
        }

    }

    return applicableStereotypes;

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


示例5: getSameNameOperation

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * Checks if a class contains the same name operation
 * 
 * @param obj
 *            class or interface
 * @param op
 *            The operation
 * @return True if the class contains the operation.
 */
public static Operation getSameNameOperation(Object obj, String opName) {
    Operation foundOperation = null;
    if (opName == null || obj == null)
        return null;

    Iterator iter = null;
    if (obj instanceof Class) {
        Class cls = (Class) obj;
        iter = cls.getOperations().iterator();
    } else if (obj instanceof Interface) {
        Interface inter = (Interface) obj;
        iter = inter.getOperations().iterator();
    }

    while (foundOperation == null && iter.hasNext()) {
        Operation ownedOp = (Operation) iter.next();
        if (opName.equals(ownedOp.getName()))
            foundOperation = ownedOp;
    }
    return foundOperation;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:31,代码来源:ModelUtility.java


示例6: hasComponentChild

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * 
 * SelectedElement 하위에 컴포넌트가 있는지 검사.
 * 
 * @param parentElement
 * @return
 */
private boolean hasComponentChild(Element parentElement) {
    
    for( Element child : parentElement.getOwnedElements() ) {
        if( child instanceof org.eclipse.uml2.uml.Class ) {
            if( COMPONENT_STEREOTYPE.equals( ProjectUtil.getStereotypeLabel(child).trim() ) ) {
                return true;
            }
        }
        if (child instanceof PackageableElement) {
            if(hasComponentChild( child )){
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:24,代码来源:ComponentRefactorAction.java


示例7: createClassDataModelList

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * Class 데이터 모델 리스트를 생성합니다.
 * 
 * @param pkg
 * @return List<DataModel>
 */
private List<DataModel> createClassDataModelList(Package pkg) {
    List<DataModel> classModelList = new ArrayList<DataModel>();

    DataModel classModel;

    List<PackageableElement> list = pkg.getPackagedElements();
    List<Class> classes = new ArrayList<Class>();
    for (PackageableElement packageableElement : list) {
        if (packageableElement.eClass() == UMLPackage.Literals.CLASS) {
            classes.add((Class) packageableElement);
        }
    }

    ProjectUtil.getSortedList(classes);
    if (!classes.isEmpty()) {
        for (Class clazz : classes) {

            classModel = new DataModel();

            setDataModel(classModel, UICoreConstant.REPORT__CLASS_NAME, clazz.getName());
            setDataModel(classModel, UICoreConstant.REPORT__CLASS_STEREOTYPE, ProjectUtil.getStereotypeLabel(clazz));
            setDataModel(classModel,
                UICoreConstant.REPORT__CLASS_DOCUMENTATION,
                getCommentToString(clazz.getOwnedComments()));
            setDataModel(classModel, UICoreConstant.REPORT__ATTRIBUTE_LIST, createAttributeDataModelList(clazz));
            setDataModel(classModel, UICoreConstant.REPORT__OPERATION_LIST, createOperationDataModelList(clazz));

            classModelList.add(classModel);
        }

    }

    return classModelList;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:42,代码来源:CreateClassDefinitionToXMLFileJob.java


示例8: getTypeList

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * 
 * void
 */
private void getTypeList() {

    typeList.clear();
    typeList.add(pType);

    if (pType instanceof Class) {
        Class clazz = (Class) pType;
        List<Interface> interfaces = clazz.getAllImplementedInterfaces();
        typeList.addAll(interfaces);
    }

    typeCombo.removeAll();
    for (Type t : typeList) {
        typeCombo.add(t.getName());
    }
    typeCombo.select(0);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:CreateOperationDialog.java


示例9: createClass

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * Lifeline의 Type에 새 클래스 생성. (생성된 클래스를 Type에 붙이는 것은 transaction 때문에
 * execute()에서 처리) void
 * 
 * @param parentNodeModel
 */
public static org.eclipse.uml2.uml.Class createClass(AbstractNode parentNodeModel) {

    PackageableElement parentElement = UMLManager.getParentPackage(parentNodeModel);
    org.eclipse.uml2.uml.Class umlClass = null;
    CreateClassDialog dialog = new CreateClassDialog(RealizationPlugin.getShell());
    if (dialog.open() == Window.OK) {

        String className = dialog.getClassName();

        umlClass = UMLHelper.createClass();
        if (className.equals(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING)) {
            umlClass.setName(UMLManager.getPackagedUniqueName((Namespace) parentElement, umlClass.getName()));
        } else {
            umlClass.setName(className);
        }
    }
    return umlClass;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:SequenceUtil.java


示例10: generateConstants

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * Generate Enumeration constants.
 * 
 * @param clazz
 *            the UML class
 * @param ast
 *            the JDT Java AST
 * @param ed
 *            Enumeration declaration for Java JDT
 */
public void generateConstants(Classifier clazz, PrintWriter writer) {
	// Get all properties for this enumeration class
	Class enumerationClass = (Class) clazz;
	EList<Property> attributes = enumerationClass.getAttributes();
	int count=0;
	for (Property enumLiteral : attributes) {
	    count++;
	    String comments=andromdaHelper.concatComments(enumLiteral.getOwnedComments());
	    if(StringUtils.isNotEmpty(comments)){
	        generateSimpleComment(writer, comments.split("\n"));
	    }
           String literalName = nameMasker.mask(enumLiteral.getName(),NameMasker.UPPERUNDERSCORE);
	    writer.format("%s(%s)",literalName,resolveConstantValue(enumLiteral));
	    if(count < attributes.size()){
	        writer.println(",");
	    } else {
               writer.println(";");
	    }
	}
}
 
开发者ID:WalterMourao,项目名称:andromda,代码行数:31,代码来源:EnumClassGenerator.java


示例11: validateCooperateModel

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Override
public boolean validateCooperateModel(IValidationContext ctx, Association target) {
    Collection<java.lang.Class<?>> relevantEndTypes = Arrays.asList(Class.class, Interface.class);
    if (!target.getEndTypes().stream().allMatch(
            testType -> relevantEndTypes.stream().anyMatch(relevantType -> relevantType.isInstance(testType)))) {
        // The association is not in a class diagram and therefore not relevant for this constraint
        return true;
    }

    if (!StringUtils.isBlank(target.getName())) {
        return true;
    }

    Collection<Type> wantedTypes = getTypes(target);
    return target.getNearestPackage().getMembers().stream().filter(Association.class::isInstance)
            .map(Association.class::cast).filter(a -> a != target).allMatch(a -> !getTypes(a).equals(wantedTypes));
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:18,代码来源:ClassDiagramAssociationConstraint.java


示例12: testLink

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testLink() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.link_and_unlink");
	Class clsA = cls(model, "A");
	Property otherEnd = property(clsA, "OtherEnd", "B");
	Class clsB = cls(model, "B");
	Property thisEnd = property(clsB, "ThisEnd", "A");

	SequenceNode body = loadActionCode(model, "A", "testLink");
	SequenceNode linkStmt = node(body, 0, "link inst1 to inst2;", SequenceNode.class);
	node(linkStmt, 0, "inst1", ReadVariableAction.class);
	node(linkStmt, 1, "inst2", ReadVariableAction.class);
	CreateLinkAction linkNode = node(linkStmt, 2, "link inst1 to inst2", CreateLinkAction.class);
	assertEquals(thisEnd, linkNode.getEndData().get(0).getEnd());
	assertNotNull(linkNode.getEndData().get(0).getValue());
	assertEquals(otherEnd, linkNode.getEndData().get(1).getEnd());
	assertNotNull(linkNode.getEndData().get(1).getValue());
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:19,代码来源:TestActionCode.java


示例13: testUnlink

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testUnlink() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.link_and_unlink");
	Class clsA = cls(model, "A");
	Property otherEnd = property(clsA, "OtherEnd", "B");
	Class clsB = cls(model, "B");
	Property thisEnd = property(clsB, "ThisEnd", "A");

	SequenceNode body = loadActionCode(model, "A", "testUnlink");
	SequenceNode linkStmt = node(body, 0, "unlink inst1 from inst2;", SequenceNode.class);
	node(linkStmt, 0, "inst1", ReadVariableAction.class);
	node(linkStmt, 1, "inst2", ReadVariableAction.class);
	DestroyLinkAction linkNode = node(linkStmt, 2, "unlink inst1 from inst2", DestroyLinkAction.class);
	assertEquals(thisEnd, linkNode.getEndData().get(0).getEnd());
	assertNotNull(linkNode.getEndData().get(0).getValue());
	assertEquals(otherEnd, linkNode.getEndData().get(1).getEnd());
	assertNotNull(linkNode.getEndData().get(1).getValue());
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:19,代码来源:TestActionCode.java


示例14: testSMActions

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testSMActions() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.sm_actions");
	Class cls = cls(model, "TestClass");
	SignalEvent sig = signalEvent(model, "TestSignal");
	Region reg = region(cls);
	Pseudostate init = pseudoState(reg, "Init", PseudostateKind.INITIAL_LITERAL);
	State s1 = state(reg, "S1");
	SequenceNode entryBody = getActivityBody((Activity) s1.getEntry());
	node(entryBody, 0, "Action.log(\"entry S1\");", SequenceNode.class);
	SequenceNode exitBody = getActivityBody((Activity) s1.getExit());
	node(exitBody, 0, "Action.log(\"exit S1\");", SequenceNode.class);
	assertNotNull(s1.getEntry());
	Transition tr1 = transition(reg, init, s1, null);
	SequenceNode effectBody = getActivityBody((Activity) tr1.getEffect());
	node(effectBody, 0, "Action.log(\"Init -> S1\");", SequenceNode.class);
	Transition tr2 = transition(reg, s1, s1, sig);
	Activity guardActivity = getGuardActivity(tr2);
	node(guardActivity, 2, "return", ActivityParameterNode.class);
	SequenceNode guardBody = getActivityBody(guardActivity);
	node(guardBody, 0, "return false", SequenceNode.class);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:23,代码来源:TestActionCode.java


示例15: testGeneralization

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testGeneralization() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.generalization");
	Class abstractBase = cls(model, "AbstractBaseClass");
	Operation baseMethod = operation(abstractBase, "baseMethod");
	assertTrue(baseMethod.isAbstract());

	Class concreteBase = cls(model, "ConcreteBaseClass");
	checkSubclass(concreteBase, abstractBase);
	Operation baseMethodInConcBase = operation(concreteBase, "baseMethod");
	overrides(baseMethodInConcBase, baseMethod);
	assertFalse(baseMethodInConcBase.isAbstract());
	property(concreteBase, "baseField", "Integer");

	Class concreteSub = cls(model, "ConcreteSubclass");
	checkSubclass(concreteSub, concreteBase);

	Operation baseMethodInConcSub = operation(concreteSub, "baseMethod");
	Operation newMethod = operation(concreteSub, "newMethod");
	Activity activity = (Activity) newMethod.getMethods().get(0);
	SequenceNode actBody = (SequenceNode) activity.getNode("#body");
	SequenceNode callStmt = (SequenceNode) actBody.getNode("this.baseMethod();");
	CallOperationAction callExpr = (CallOperationAction) callStmt.getNode("this.baseMethod()");
	assertEquals(baseMethodInConcSub, callExpr.getOperation());
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:26,代码来源:TestStructure.java


示例16: testPorts

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testPorts() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.ports");
	Class cls = cls(model, "TestClass");
	Port behavPort = port(cls, "BehavPort");

	assertTrue(behavPort.isBehavior());
	assertEquals("Iface", getProvided(behavPort).getName());

	Port assemblyPort = port(cls, "AssemblyPort");
	assertFalse(assemblyPort.isBehavior());
	assertEquals("Iface", getProvided(assemblyPort).getName());

	// existance is checked
	port(cls, "MyInPort");
	port(cls, "MyOutPort");
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:18,代码来源:TestStructure.java


示例17: testSend

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testSend() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.send");
	Class clsA = cls(model, "A");
	Property otherEnd = property(clsA, "B_end", "B");
	Class clsB = cls(model, "B");
	Property thisEnd = property(clsB, "A_end", "A");

	SequenceNode body = loadActionCode(model, "A", "test");
	SequenceNode sendStmt = node(body, 0, "send create Sig to select(a -> B_end);", SequenceNode.class);
	node(sendStmt, 0, "create Sig", SequenceNode.class);
	node(sendStmt, 1, "a", ReadVariableAction.class);
	ReadLinkAction readLink = node(sendStmt, 2, "a -> B_end", ReadLinkAction.class);
	node(sendStmt, 3, "select(a -> B_end)", CallOperationAction.class);
	node(sendStmt, 4, "send create Sig to select(a -> B_end)", SendObjectAction.class);
	assertEquals(thisEnd, readLink.getEndData().get(0).getEnd());
	assertNotNull(readLink.getEndData().get(0).getValue());
	assertEquals(otherEnd, readLink.getEndData().get(1).getEnd());
	assertEquals(null, readLink.getEndData().get(1).getValue());
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:21,代码来源:TestStructure.java


示例18: testSignal

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
@Test
public void testSignal() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.signal");
	Signal sig = signal(model, "Sig");
	SignalEvent sigEvent = signalEvent(model, "Sig");
	assertEquals(sig, sigEvent.getSignal());
	Class sigFactory = cls(model, "#Sig_factory");
	Operation sigCtor = operation(sigFactory, "Sig");
	assertEquals(4, sigCtor.getOwnedParameters().size());

	SequenceNode body = loadActionCode(model, "A", "test");
	SequenceNode createNode = node(body, 0, "create Sig", SequenceNode.class);
	CreateObjectAction initiateNode = node(createNode, 0, "instantiate Sig", CreateObjectAction.class);
	assertEquals(sig, initiateNode.getClassifier());
	node(createNode, 1, "#temp=instantiate Sig", AddVariableValueAction.class);
	node(createNode, 2, "1", ValueSpecificationAction.class);
	node(createNode, 3, "true", ValueSpecificationAction.class);
	node(createNode, 4, "\"test\"", ValueSpecificationAction.class);
	node(createNode, 5, "#temp", ReadVariableAction.class);
	CallOperationAction ctorCall = node(createNode, 6, "Sig(Sig p0, Integer p1, Boolean p2, String p3)",
			CallOperationAction.class);
	assertEquals(sigCtor, ctorCall.getOperation());
	node(createNode, 7, "#temp", ReadVariableAction.class);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:25,代码来源:TestStructure.java


示例19: ClassAttributeLink

import org.eclipse.uml2.uml.Class; //导入依赖的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


示例20: generateElementsToBeAdded

import org.eclipse.uml2.uml.Class; //导入依赖的package包/类
/**
 * Returns the types of elements that are to be added
 * @return Returns the types of elements that are to be added
 */
private List<java.lang.Class<? extends Element>> generateElementsToBeAdded() {
	List<java.lang.Class<? extends Element>> nodes = new LinkedList<>(Arrays.asList(
			Class.class,
			Component.class,
			DataType.class,
			Enumeration.class,
			InformationItem.class,
			InstanceSpecification.class,
			Interface.class,
			Model.class,
			Package.class,
			PrimitiveType.class
	));
	
	if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_CONSTRAINT_PREF))
		nodes.add(Constraint.class);
	if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_COMMENT_PREF))
		nodes.add(Comment.class);
	if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_SIGNAL_PREF))
		nodes.add(Signal.class);
	
	return nodes;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:28,代码来源:ClassDiagramElementsManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Log类代码示例发布时间:2022-05-21
下一篇:
Java ITaintedMob类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap