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


Java Element.equals方法代码示例

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


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

示例1: findResource

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * 다이어그램이 포함된 리소스 가져오는 메소드
 * 
 * @param diagram
 * @return Resource
 */
public static Resource findResource(Diagram diagram) {
    Element parent = (Element) diagram.getParent();
    EList<Resource> resourceList = null;
    Object obj = null;

    if (domainModelHandler != null) {
        resourceList = domainModelHandler.getResourceSet().getResources();
    } else {
        resourceList = getHandlerInstance().getResourceSet().getResources();
    }

    for (Resource resource : resourceList) {
        for (Iterator iter = EcoreUtil.getAllContents(resource, true); iter.hasNext();) {
            obj = iter.next();

            if (parent.equals(obj)) {
                return resource;
            }
        }
    }

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

示例2: findNotationNode

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * 
 * 
 * @param element
 * @return AbstractNode
 */
protected AbstractNode findNotationNode(Element element) {
    if (null == element) {
        return null;
    }
    Element target = null;
    if (element instanceof ExtensionPoint) {
        target = ((ExtensionPoint) element).getOwner();
    } else {
        target = element;
    }
    for (AbstractNode node : this.viewModelListInDiagram) {
        if (target.equals(node.getUmlModel())) {
            return node;
        }
    }
    return null;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:24,代码来源:DiagramDropTargetListener.java

示例3: findNotationNode

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * 
 * 
 * @param element
 * @return AbstractNode
 */
protected AbstractNode findNotationNode(Element element) {
    if (null == element) {
        return null;
    }
    element.getAppliedStereotypes();
    Element target = null;
    if (element instanceof ExtensionPoint) {
        target = ((ExtensionPoint) element).getOwner();
    } else {
        target = element;
    }
    for (AbstractNode node : this.viewModelListInDiagram) {
        if (target.equals(node.getUmlModel())) {
            return node;
        }
    }
    return null;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:DiagramRegerate.java

示例4: getEditPartOfModelElement

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
private EditPart getEditPartOfModelElement(Collection<? extends EditPart> editParts, Element element) {
	if(element == null) return null;
	for (EditPart ep : editParts) {
		Element actual = (Element) ((View) ep.getModel()).getElement();
		if(actual.equals(element))
			return ep;
	}
	return null;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:10,代码来源:AbstractDiagramElementsTxtUmlArranger.java

示例5: getConnectionCompleteCommand

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
     * @see org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getConnectionCompleteCommand(org.eclipse.gef.requests.CreateConnectionRequest)
     */
    @Override
    protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
        
        CreateConnectionCommand startCommand = (CreateConnectionCommand) request.getStartCommand();
        AbstractNode source;
        AbstractNode target;
        AbstractView objNode = (AbstractNode) (getHost().getModel());

        if (objNode instanceof AbstractConnection) {
            return null;
        }

        source = (AbstractNode) startCommand.getSource();
        target = (AbstractNode) objNode;

        if (!UMLPolicyManager.isConnectableToTarget(startCommand.getConnection().getRelationType(),
            source.getNodeType(),
            target.getNodeType())) {
            return null;
        }

        startCommand.setTarget(target);
        if (!(getHost().getParent().getModel() instanceof Diagram)
            && !(getHost().getParent().getModel() instanceof ContainerNode)) {
            startCommand.setParent((AbstractNode) getHost().getParent().getParent().getModel());
        } else {
            startCommand.setParent((AbstractNode) getHost().getParent().getModel());
        }

        ConnectionAnchor targetAnchor = ((NodeEditPart) getHost()).getTargetConnectionAnchor(request);
        startCommand.setTargetAnchorPoint(targetAnchor.getLocation(request.getLocation()));

//        Relation relation = null;
        Element sourceElement = ((AbstractNode) request.getSourceEditPart().getModel()).getUmlModel();
        Element targetElement = ((AbstractNode) request.getTargetEditPart().getModel()).getUmlModel();
        if (sourceElement instanceof Actor || sourceElement instanceof UseCase) {
            if (sourceElement.equals(targetElement)) {
                return null;
            }
        }

        if (startCommand.canExecute()) {
            return startCommand;
        }
        return null;

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


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