本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}