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

Java Generalization类代码示例

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

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



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

示例1: selectionChanged

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
 *      org.eclipse.jface.viewers.ISelection)
 */
public void selectionChanged(IAction action, ISelection selection) {
    objList.clear();
    objList = ProjectUtil.getSelectedEObjects(selection);

    if (objList == null || objList.size() < 1) {
        return;
    }

    for (EObject eobject : objList) {
        if (eobject instanceof Lifeline || eobject instanceof Abstraction || eobject instanceof Association
            || eobject instanceof BehaviorExecutionSpecification || eobject instanceof CombinedFragment
            || eobject instanceof Comment || eobject instanceof Connector || eobject instanceof ControlFlow
            || eobject instanceof Dependency || eobject instanceof ExecutionEvent
            || eobject instanceof ExecutionOccurrenceSpecification || eobject instanceof Extend
            || eobject instanceof Generalization || eobject instanceof Include
            || eobject instanceof InteractionOperand || eobject instanceof InterfaceRealization
            || eobject instanceof Message || eobject instanceof MessageOccurrenceSpecification
            || eobject instanceof ObjectFlow || eobject instanceof Realization
            || eobject instanceof ReceiveOperationEvent || eobject instanceof SendOperationEvent
            || eobject instanceof Usage) {
            objList.clear();
            return;
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:30,代码来源:CopyAction.java


示例2: createClass

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
private Class createClass(Package pkg, FHIMInformationModel.Class classModel) {
    Class clazz = modelClassMap.get(classModel);

    LOG.debug("Class: " + clazz.getName());

    // Attributes.
    for (Attribute attributeModel : classModel.getAttributes()) {
        getProperty(clazz, attributeModel);
    }

    // Generalizations.
    for (FHIMInformationModel.Generalization generalizationModel : classModel.getGeneralizations()) {
        createGeneralization(clazz, generalizationModel);
    }

    return clazz;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:18,代码来源:Model2UMLConverter.java


示例3: createGeneralization

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
private Generalization createGeneralization(Class clazz,
        FHIMInformationModel.Generalization generalizationModel) {
    FHIMInformationModel.Type typeModel = generalizationModel.getTarget();
    Type type = getTypeForModel(typeModel);

    // Expect type to be an instance of Class.
    if (type instanceof Class) {
        Class general = (Class) type;

        LOG.debug("Generalization: " + general.getName());

        return clazz.createGeneralization(general);
    }

    // Something wrong!
    throw new IllegalArgumentException("Unexpected type: " + type);
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:18,代码来源:Model2UMLConverter.java


示例4: buildClassModel

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
private FHIMInformationModel.Class buildClassModel(Class clazz) {
    String name = clazz.getName();
    LOG.debug("Class: " + name);

    FHIMInformationModel.Class classModel = nameClassMap.get(name);

    // Generalizations.
    EList<Generalization> generalizations = clazz.getGeneralizations();
    for (Generalization generalization : generalizations) {
        FHIMInformationModel.Generalization generalizationModel = createGeneralizationModel(generalization);
        classModel.addGeneralization(generalizationModel);
    }

    // Attributes.
    EList<Property> attributes = clazz.getOwnedAttributes();
    for (Property attribute : attributes) {
        FHIMInformationModel.Attribute attributeModel = getAttributeModel(attribute);
        classModel.addAttribute(attributeModel);
    }

    return classModel;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:23,代码来源:UML2ModelConverter.java


示例5: basicRenderObject

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
@Override
protected boolean basicRenderObject(Generalization element, IndentedPrintWriter pw, IRenderingSession context) {
    if (!shouldRender(context, element.getSpecific(), element.getGeneral()))
        return true;
    context.render(element.getGeneral(), element.getGeneral().eResource() != element.eResource());
    pw.print("edge ");
    // if (element.getName() != null)
    // pw.print("\"" + element.getName() + "\" ");
    pw.println("[");
    pw.enterLevel();
    pw.println("arrowtail = \"empty\"");
    pw.println("arrowhead = \"none\"");
    pw.println("taillabel = \"\"");
    pw.println("headlabel = \"\"");
    DOTRenderingUtils.addAttribute(pw, "constraint", "true");
    DOTRenderingUtils.addAttribute(pw, "style", "none");
    pw.exitLevel();
    pw.println("]");
    pw.println("\"" + element.getGeneral().getName() + "\":port" + " -- \"" + element.getSpecific().getName()
            + "\":port");
    return true;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:23,代码来源:GeneralizationRenderer.java


示例6: renderObject

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
public boolean renderObject(DataType dataType, IndentedPrintWriter writer, IRenderingSession context) {
    RenderingUtils.renderAll(context, ElementUtils.getComments(dataType));
    TextUMLRenderingUtils.renderStereotypeApplications(writer, dataType);
    if (dataType.isAbstract())
        writer.print("abstract ");
    writer.print("datatype " + name(dataType));
    List<Generalization> generalizations = dataType.getGeneralizations();
    StringBuilder specializationList = new StringBuilder();
    for (Generalization generalization : generalizations)
        specializationList.append(TextUMLRenderingUtils.getQualifiedNameIfNeeded(generalization.getGeneral(),
                dataType.getNamespace()) + ", ");
    if (specializationList.length() > 0) {
        specializationList.delete(specializationList.length() - 2, specializationList.length());
        writer.print(" specializes ");
        writer.print(specializationList);
    }
    writer.println();
    writer.enterLevel();
    RenderingUtils.renderAll(context, dataType.getOwnedAttributes());
    RenderingUtils.renderAll(context, dataType.getOwnedOperations());
    writer.exitLevel();
    writer.println("end;");
    writer.println();
    return true;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:26,代码来源:DataTypeRenderer.java


示例7: renderObject

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
public boolean renderObject(Interface interface_, IndentedPrintWriter writer, IRenderingSession context) {
    RenderingUtils.renderAll(context, ElementUtils.getComments(interface_));
    TextUMLRenderingUtils.renderStereotypeApplications(writer, interface_);
    writer.print("interface " + name(interface_));
    List<Generalization> generalizations = interface_.getGeneralizations();
    StringBuilder specializationList = new StringBuilder();
    for (Generalization generalization : generalizations)
        specializationList.append(TextUMLRenderingUtils.getQualifiedNameIfNeeded(generalization.getGeneral(),
                interface_.getNamespace()) + ", ");
    if (specializationList.length() > 0) {
        specializationList.delete(specializationList.length() - 2, specializationList.length());
        writer.print(" specializes ");
        writer.print(specializationList);
    }
    writer.println();
    writer.enterLevel();
    RenderingUtils.renderAll(context, interface_.getOwnedAttributes());
    RenderingUtils.renderAll(context, interface_.getOwnedOperations());
    RenderingUtils.renderAll(context, interface_.getClientDependencies());
    writer.exitLevel();
    writer.println("end;");
    writer.println();
    return true;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:25,代码来源:InterfaceRenderer.java


示例8: findProperty

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
public static Property findProperty(Classifier classifier, String attributeIdentifier, boolean ignoreCase,
        boolean recurse, EClass propertyClass) {
    Property found = classifier.getAttribute(attributeIdentifier, null, ignoreCase, propertyClass);
    if (found != null || !recurse)
        return found;
    final EList<TemplateBinding> templateBindings = classifier.getTemplateBindings();
    if (!templateBindings.isEmpty()) {
        for (TemplateBinding templateBinding : templateBindings) {
            TemplateSignature signature = templateBinding.getSignature();
            found = findProperty((Classifier) signature.getTemplate(), attributeIdentifier, ignoreCase, true,
                    propertyClass);
            if (found != null)
                return found;
        }
    }
    for (Generalization generalization : classifier.getGeneralizations())
        if ((found = findProperty(generalization.getGeneral(), attributeIdentifier, ignoreCase, true, propertyClass)) != null)
            return found;
    return null;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:21,代码来源:FeatureUtils.java


示例9: createContentsIfNecessary

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
private void createContentsIfNecessary(final View theElementView) {
    final EObject theElement = theElementView.getElement();
    final EList<Property> ownedAttributes = asEList(getOwnedAttributes(theElement));
    if (!ownedAttributes.isEmpty()) {
        final View theOwnedAttributeCompartment = getTheAttributeCompartment(theElementView);
        for (final Property p : ownedAttributes) {
            getOrCreateTheView(p, theOwnedAttributeCompartment);
        }
        @SuppressWarnings("unchecked")
        final EList<View> attributeViews = theOwnedAttributeCompartment.getPersistedChildren();
        ECollections.sort(attributeViews, new Comparator<View>() {
            @Override
            public int compare(final View left, final View right) {
                return Integer.compare(indexOf(ownedAttributes, left.getElement(), 0),
                        indexOf(ownedAttributes, right.getElement(), 0));
            }
        });
    }
    for (final Generalization g : getGeneralizations(theElement)) {
        getOrCreateTheView(g, theElementView.getDiagram());
    }
}
 
开发者ID:GRA-UML,项目名称:tool,代码行数:23,代码来源:DiagramSynchronizer.java


示例10: longTest

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
@Test
public void longTest() {

	Model model = UMLFactory.eINSTANCE.createModel();
	model.setName("myUmlModel");

	Interface it1 = UMLFactory.eINSTANCE.createInterface();
	it1.setName("it1");
	model.getPackagedElements().add(it1);

	Interface it2 = UMLFactory.eINSTANCE.createInterface();
	it2.setName("it2");
	model.getPackagedElements().add(it2);

	Generalization gen = UMLFactory.eINSTANCE.createGeneralization();
	gen.setGeneral(it2);
	it2.getGeneralizations().add(gen);

	Interface it3 = UMLFactory.eINSTANCE.createInterface();
	it3.setName("it3");
	model.getPackagedElements().add(it3);
	gen.setGeneral(it3);

	Operation op = UMLFactory.eINSTANCE.createOperation();
	op.setName("op1");
	it3.getOwnedOperations().add(op);

	Parameter parameter = UMLFactory.eINSTANCE.createParameter();
	parameter.setName("par1");
	parameter.setDirection(ParameterDirectionKind.RETURN_LITERAL);
	parameter.setType(it1);
	op.getOwnedParameters().add(parameter);

	assertEquals(1, it2.getAllOperations().size());
}
 
开发者ID:i-BP,项目名称:boem,代码行数:36,代码来源:UMLJavaTest.java


示例11: checkRelationTarget

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * relation의 source와 target이 같은지 검사
 * 
 * @param relationship
 * @param sourceElement
 * @param targetElement
 * @return boolean
 */
private static boolean checkRelationTarget(Relationship relationship, NamedElement targetElement) {
    if (relationship instanceof Dependency) {
        Dependency dependency = (Dependency) relationship;
        EList<NamedElement> suppliers = dependency.getSuppliers();
        for (NamedElement element : suppliers) {
            if (targetElement.equals(element)) {
                return true;
            }
        }

    } else if (relationship instanceof Generalization) {
        Generalization generalization = (Generalization) relationship;
        if (targetElement.equals(generalization.getGeneral())) {
            return true;
        }

    } else if (relationship instanceof Association) {
        Association association = (Association) relationship;
        EList<Type> endTypes = association.getEndTypes();
        for (Type type : endTypes) {
            if (targetElement.equals(type)) {
                return true;
            }
        }

    }

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


示例12: deleteDirectedAttributes

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * @see nexcore.tool.uml.manager.command.DeleteUMLDirectedRelationshipCommand#deleteDirectedAttributes()
 */
@Override
protected void deleteDirectedAttributes() {
    Generalization generalization = (Generalization) this.targetElement;
    this.source = generalization.getSources().get(0);
    ((Classifier) this.source).getGeneralizations().remove(generalization);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:10,代码来源:DeleteUMLGeneralizationCommand.java


示例13: restoreDirectedAttributes

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * @see nexcore.tool.uml.manager.command.DeleteUMLDirectedRelationshipCommand#restoreDirectedAttributes()
 */
@Override
protected void restoreDirectedAttributes() {
    Generalization generalization = (Generalization) this.targetElement;
    this.source = generalization.getSources().get(0);
    ((Classifier) this.source).getGeneralizations().add(generalization);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:10,代码来源:DeleteUMLGeneralizationCommand.java


示例14: getCommand

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * getCommand
 *  
 * @param selectedElement
 * @return Command
 */
public static Command getCommand(Element selectedElement) {

    if (null == selectedElement.eContainer()) {
        return null;
    }
    Command deleteCommand = null;
    if (selectedElement instanceof Diagram) {
        deleteCommand = new DeleteUMLDiagramCommand((Diagram) selectedElement);
    } else if (selectedElement instanceof Association) {
        deleteCommand = new DeleteUMLAssociationCommand((Association) selectedElement);
    } else if (selectedElement instanceof Dependency) {
        deleteCommand = new DeleteUMLDependencyCommand(selectedElement);
    } else if (selectedElement instanceof Include) {
        deleteCommand = new DeleteUMLIncludeCommand(selectedElement);
    } else if (selectedElement instanceof Extend) {
        deleteCommand = new DeleteUMLExtendCommand(selectedElement);
    } else if (selectedElement instanceof Generalization) {
        deleteCommand = new DeleteUMLGeneralizationCommand(selectedElement);
    } else if (selectedElement instanceof InterfaceRealization) {
        deleteCommand = new DeleteUMLInterfaceRealizationCommand(selectedElement);
    } else if (selectedElement instanceof Realization) {
        deleteCommand = new DeleteUMLRealizationCommand(selectedElement);
    } else if (selectedElement instanceof Property) {
        deleteCommand = new DeleteUMLPropertyCommand((Property) selectedElement);
    } else if (selectedElement instanceof ActivityEdge) {
        deleteCommand = new DeleteUMLActivityEdgeCommand((ActivityEdge) selectedElement);
    } else if (selectedElement instanceof ActivityNode) {
        deleteCommand = new DeleteUMLActivityNodeCommand((ActivityNode) selectedElement);
    } else if ((selectedElement instanceof Lifeline) || (selectedElement instanceof Message)) {
        deleteCommand = new DeleteUMLSequenceElementCommand((NamedElement)selectedElement);
    } else if (selectedElement instanceof NamedElement) {
        deleteCommand = new DeleteUMLPackageableElementCommand((NamedElement) selectedElement);
    }//
    return deleteCommand;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:42,代码来源:DeleteUMLElementCommandFactory.java


示例15: getModelChildren

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
 */
@Override
public List<EObject> getModelChildren() {
    List<EObject> list = new ArrayList<EObject>();
    list.addAll(((Diagram) getModel()).getNodeList());

    List<AbstractConnection> connectionList = new ArrayList<AbstractConnection>();
    connectionList = ((Diagram) getModel()).getConnectionList();

    if (connectionList.size() != 0) {
        for (AbstractConnection connection : connectionList) {
            if ((connection).getUmlModel() instanceof Association) {
                list.addAll(connection.getLabels());
            }
            // else if( (connection).getUmlModel() instanceof Generalization
            // || (connection).getUmlModel() instanceof Message
            // || (connection).getUmlModel() instanceof ControlFlow ||
            // (connection).getUmlModel() instanceof ObjectFlow ||
            // connection instanceof Attachement){
            // continue;
            // }
            else if ((connection).getUmlModel() instanceof Generalization
                || (connection).getUmlModel() instanceof Message || connection instanceof Attachement) {
                continue;
            } else
                list.addAll(connection.getLabels());
        }
    }

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


示例16: handleNewTarget

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * 타켓의 변경 처리 void
 */
private void handleNewTarget() {

    oldTarget = (AbstractNode) connection.getTarget();

    diagram.getConnectionList().remove(connection);
    Dimension targetAnchor = connection.getTargetAnchor();
    if (targetAnchor != null) {
        targetAnchor.setWidth(targetAnchorPoint.x);
        targetAnchor.setHeight(targetAnchorPoint.y);
    }
    reconnectTarget(newTarget);
    diagram.getConnectionList().add(connection);

    if (this.connection.getUmlModel() instanceof Relationship) {
        Relationship relationship = (Relationship) this.connection.getUmlModel();
        if (relationship != null) {
            switch (relationship.eClass().getClassifierID()) {
                case UMLPackage.ASSOCIATION:
                    handleReconnectForAssociation((Association) relationship, this.oldTarget, this.newTarget);
                    break;
                case UMLPackage.EXTEND:
                    handlerNewTargetForExtend((Extend) relationship);
                    break;
                case UMLPackage.INCLUDE:
                    handlerNewTargetForInclude((Include) relationship);
                    break;
                case UMLPackage.GENERALIZATION:
                    handlerNewTargetForGeneralization((Generalization) relationship);
                    break;
                default:
                    if (relationship instanceof Dependency) {
                        handleNewTargetForDependency((Dependency) relationship);
                    }
                    return;
            }
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:42,代码来源:ReconnectConnectionCommand.java


示例17: handleNewSource

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * 소스의 변경 처리. void
 */
private void handleNewSource() {
    oldSource = (AbstractNode) connection.getSource();

    diagram.getConnectionList().remove(connection);
    Dimension sourceAnchor = connection.getSourceAnchor();
    if (sourceAnchor != null) {
        sourceAnchor.setWidth(sourceAnchorPoint.x);
        sourceAnchor.setHeight(sourceAnchorPoint.y);
    }
    reconnectSource(newSource);
    diagram.getConnectionList().add(connection);

    if (this.connection.getUmlModel() instanceof Relationship) {
        Relationship relationship = (Relationship) this.connection.getUmlModel();
        if (relationship != null) {
            switch (relationship.eClass().getClassifierID()) {
                case UMLPackage.ASSOCIATION:
                    handleReconnectForAssociation((Association) relationship, this.oldSource, this.newSource);
                    break;
                case UMLPackage.EXTEND:
                case UMLPackage.INCLUDE:
                    if (relationship instanceof Include) {
                        handlerNewSourceForInclude((Include) relationship);
                    } else {
                        handlerNewSourceForExtend((Extend) relationship);
                    }
                    break;
                case UMLPackage.GENERALIZATION:
                    handlerNewSourceForGeneralization((Generalization) relationship);
                    break;
                default:
                    if (relationship instanceof Dependency) {
                        handleNewSourceForDependency((Dependency) relationship);
                    }
                    return;
            }
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:43,代码来源:ReconnectConnectionCommand.java


示例18: undo

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * 
 * @see org.eclipse.gef.commands.Command#undo()
 */
public void undo() {
    NamedElement client = (NamedElement) sourceNode.getUmlModel();
    NamedElement supplier = (NamedElement) targetNode.getUmlModel();
    RelationType relationType = this.connection.getRelationType();

    if (RelationType.ABSTRACTION.equals(relationType) || RelationType.USAGE.equals(relationType)
        || RelationType.DEPENDENCY.equals(relationType)) {
        UMLManager.unsetDependency((Dependency) connection.getUmlModel());
    } else if (RelationType.EXTEND.equals(relationType)) {
        UMLManager.unsetExtendDependency((Extend) connection.getUmlModel());
    } else if (RelationType.INCLUDE.equals(relationType)) {
        UMLManager.unsetIncludeDependency((Include) connection.getUmlModel());
    } else if (RelationType.ASSOCIATION.equals(relationType) || RelationType.AGGREGATION.equals(relationType)
        || RelationType.COMPOSITION.equals(relationType) || RelationType.DIRECTED_AGGREGATION.equals(relationType)
        || RelationType.DIRECTED_ASSOCIATION.equals(relationType)
        || RelationType.DIRECTED_COMPOSITION.equals(relationType)) {
        UMLManager.unsetAssociation((Association) connection.getUmlModel());
    } else if (RelationType.GENERALIZATION.equals(relationType)) {
        UMLManager.unsetGeneralization((Generalization) connection.getUmlModel(), (Classifier) client);
    } else if (RelationType.REALIZATION.equals(relationType)
        || RelationType.INTERFACE_REALIZATION.equals(relationType)
        || RelationType.COMPONENT_REALIZATION.equals(relationType)) {
        UMLManager.unsetRealization((Realization) connection.getUmlModel(), supplier, client);
    } else if (RelationType.CONTROL_FLOW.equals(relationType)) {
        // UMLManager.setControlFlow((ControlFlow)connection.getUmlModel(),supplier,
        // client);
    } else if (RelationType.OBJECT_FLOW.equals(relationType)) {
        // UMLManager.setObjectFlow((ObjectFlow)connection.getUmlModel(),supplier,
        // client);
    }

    DiagramUtil.detachSourceOfConnection(connection);
    DiagramUtil.detachTargetOfConnection(connection);
    if (parent instanceof Diagram) {
        ((Diagram) parent).getConnectionList().remove(connection);
    } else if (parent instanceof ContainerNode) {
        ((ContainerNode) parent).getConnectionList().remove(connection);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:44,代码来源:CreateConnectionCommand.java


示例19: generateConnectorsToBeAdded

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * Returns the types of connectors that are to be added
 * @return Returns the types of connectors that are to be added 
 */
private List<java.lang.Class<? extends Element>> generateConnectorsToBeAdded() {
	List<java.lang.Class<? extends Element>> connectors = new LinkedList<>(Arrays.asList(
			Association.class,
			Generalization.class,
			InterfaceRealization.class,
			Realization.class
	));
	
	return connectors;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:15,代码来源:ClassDiagramElementsManager.java


示例20: findGeneralization

import org.eclipse.uml2.uml.Generalization; //导入依赖的package包/类
/**
 * Finds an {@link Generalization} that matches the given ID
 * @param from - Id of the starting object 
 * @param to - Id of the ending object
 * @return The Generalization model Element
 */
public Optional<Generalization> findGeneralization(String from, String to){
	Optional<Element> superclass = findElement(from);
	Optional<Element> subclass = findElement(to);
	
	if(superclass.isPresent() && subclass.isPresent() && subclass.get() instanceof Classifier){
		List<Generalization> gens = ((Classifier) subclass.get()).getGeneralizations();
		for(Generalization gen : gens){
			Classifier classif =  gen.getGeneral();
			if(classif.equals(superclass.get())) return Optional.of(gen);
		}
	}
	return Optional.empty();
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:20,代码来源:TxtUMLElementsRegistry.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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