本文整理汇总了Java中org.eclipse.uml2.uml.Usage类的典型用法代码示例。如果您正苦于以下问题:Java Usage类的具体用法?Java Usage怎么用?Java Usage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Usage类属于org.eclipse.uml2.uml包,在下文中一共展示了Usage类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectionChanged
import org.eclipse.uml2.uml.Usage; //导入依赖的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;
}
}
}
示例2: applyTyped
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
@Override
protected void applyTyped(Require object) {
if (object.eContainer() instanceof Classifier) {
Classifier classifier = (Classifier) object.eContainer();
if (classifier.getReferencedElement() != null && object.getInterface() != null
&& object.getInterface().getReferencedElement() != null) {
Element umlClassifier = classifier.getReferencedElement();
EList<DirectedRelationship> usages = umlClassifier
.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getUsage());
Optional<Usage> umlUsage = usages.stream().map(Usage.class::cast)
.filter(u -> u.getSuppliers().contains(object.getInterface().getReferencedElement()))
.filter(u -> object.getName() == null? true : u.getName().equals(object.getName()))
.findFirst();
if (umlUsage.isPresent()) {
object.setReferencedElement(umlUsage.get());
}
}
}
}
示例3: eSet
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CmpPackage.REQUIRE__REFERENCED_ELEMENT:
setReferencedElement((Usage)newValue);
return;
}
super.eSet(featureID, newValue);
}
示例4: eUnset
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CmpPackage.REQUIRE__REFERENCED_ELEMENT:
setReferencedElement((Usage)null);
return;
}
super.eUnset(featureID);
}
示例5: createUsage
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
/**
*
*
* @return org.eclipse.uml2.uml.Usage
*/
public static org.eclipse.uml2.uml.Usage createUsage() {
Usage usage = FACTORY.createUsage();
usage.addKeyword("usage");
return usage;
}
示例6: getReferencedElement
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Usage getReferencedElement() {
return (Usage)eDynamicGet(CmpPackage.REQUIRE__REFERENCED_ELEMENT, TextualCommonsPackage.Literals.UML_REFERENCING_ELEMENT__REFERENCED_ELEMENT, true, true);
}
示例7: basicGetReferencedElement
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Usage basicGetReferencedElement() {
return (Usage)eDynamicGet(CmpPackage.REQUIRE__REFERENCED_ELEMENT, TextualCommonsPackage.Literals.UML_REFERENCING_ELEMENT__REFERENCED_ELEMENT, false, true);
}
示例8: setReferencedElement
import org.eclipse.uml2.uml.Usage; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReferencedElement(Usage newReferencedElement) {
eDynamicSet(CmpPackage.REQUIRE__REFERENCED_ELEMENT, TextualCommonsPackage.Literals.UML_REFERENCING_ELEMENT__REFERENCED_ELEMENT, newReferencedElement);
}