本文整理汇总了Java中org.eclipse.uml2.uml.PackageableElement类的典型用法代码示例。如果您正苦于以下问题:Java PackageableElement类的具体用法?Java PackageableElement怎么用?Java PackageableElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PackageableElement类属于org.eclipse.uml2.uml包,在下文中一共展示了PackageableElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCollaboration
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* Collaboration 생성
*
* @param realizePkg
* @param useCase
* @return Collaboration
*/
private Collaboration createCollaboration(Package realizePkg, UseCase useCase) {
Package ucPackage = realizePkg.getNestedPackage(useCase.getName());
if (ucPackage == null) {
ucPackage = realizePkg.createNestedPackage(useCase.getName());
}
PackageableElement packagedElement = ucPackage.getPackagedElement(useCase.getName());
Collaboration collabo = null;
if (packagedElement instanceof Collaboration) {
collabo = (Collaboration) packagedElement;
} else {
EClass eClass = UMLFactory.eINSTANCE.getUMLPackage().getCollaboration();
collabo = (Collaboration) ucPackage.createPackagedElement(useCase.getName(), eClass);
}
ModelUtility.copyDocumentation(collabo, useCase);
ModelUtility.copyKeywords(useCase, collabo);
return collabo;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:SemanticModelHandler.java
示例2: getSortedAllPackageChildrenList
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* getSortedAllPackageChildrenList
*
* @param parent
* @return List<T>
*/
@SuppressWarnings("unchecked")
public List<T> getSortedAllPackageChildrenList(Package parent) {
List<PackageableElement> packagedElements = parent.getPackagedElements();
List<T> list = new ArrayList<T>();
for (PackageableElement packagedElement : packagedElements) {
if (packagedElement.eClass().equals(UMLPackage.Literals.PACKAGE)) {
list.add((T) packagedElement);
}
}
sorting(list);
if (list.size() > 0) {
Object arrayList[] = list.toArray();
for (int i = 0; i < arrayList.length; i++) {
Package packageElement = (Package) arrayList[i];
List<T> childrenList = getSortedAllPackageChildrenList(packageElement);
if (childrenList.size() > 0) {
list.addAll(childrenList);
}
}
}
return list;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:31,代码来源:UMLEnumerator.java
示例3: redo
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* @see org.eclipse.gef.commands.Command#redo()
*/
@Override
public void redo() {
this.parentElement = (org.eclipse.uml2.uml.PackageableElement) this.targetElement.getOwner();
this.appliedStereotypeList = this.targetElement.getAppliedStereotypes();
this.compoundCommand = new ArrayList<DeleteUMLStereotypeCommand>();
this.init();
for (Iterator<DeleteUMLStereotypeCommand> iter = this.compoundCommand.iterator(); iter.hasNext();) {
iter.next().redo();
}
Stereotype stereotype;
for (Iterator<Stereotype> iter = appliedStereotypeList.iterator(); iter.hasNext();) {
stereotype = iter.next();
this.targetElement.unapplyStereotype(stereotype);
this.delete(stereotype);
}
this.redoOwnElement();
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:DeleteUMLStereotypeCommand.java
示例4: parentIsPackageAndDo
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* 상위 부모가 Package 요소이고 자식 요소가 PackageableElement라면
* 붙이기를 수행한다.
* @param parent UML 요소를 붙여 넣을 부모
* @param copied 복사된 UML 요소
* @param original 원본 UML 요소
* @param something 복사할 것인지 복사 가능여부만 체크할 것인지 결정하는 플래그
* @return boolean 부모로 복사 성공 여부
*/
private static boolean parentIsPackageAndDo(EObject parent, EObject copied, EObject original, int something) {
boolean result = false;
Package _package = (Package)parent;
if (copied instanceof Interaction) {
result = false;
} else if (copied instanceof PackageableElement) {
if (something == COPY) _package.getPackagedElements().add((PackageableElement) copied);
result = true;
} else if (copied instanceof Diagram && something == CHECK_COPYABLE) {
result = true;
}
if (result && something == COPY) applyStereotypes(parent, copied, original);
return result;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:29,代码来源:ElementCopier.java
示例5: redo
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* @see org.eclipse.gef.commands.Command#redo()
*/
@Override
public void redo() {
Element umlModel = notationNode.getUmlModel();
PackageableElement parentElement = null;
if (false == request.getNewObjectType().equals(NodeType.TEXT)
&& false == request.getNewObjectType().equals(NodeType.NOTE) && null != request.getNewObjectType()) {
parentElement = UMLManager.getParentPackage(this.parentNodeModel);
if (parentElement instanceof org.eclipse.uml2.uml.Component) {
((org.eclipse.uml2.uml.Component) parentElement).getPackagedElements()
.add((PackageableElement) umlModel);
} else {
((org.eclipse.uml2.uml.Package) parentElement).getPackagedElements().add((PackageableElement) umlModel);
}
}
if( parentElement != null ) {
notationNode.setParent(parentElement);
}
if (parentNodeModel instanceof Diagram) {
((Diagram) parentNodeModel).getNodeList().add(notationNode);
} else if (parentNodeModel instanceof ContainerNode) {
((ContainerNode) parentNodeModel).getNodeList().add(notationNode);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:29,代码来源:CreateNotationNodeCommand.java
示例6: undo
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* @see org.eclipse.gef.commands.Command#undo()
*/
@Override
public void undo() {
Element umlModel = notationNode.getUmlModel();
if (umlModel instanceof Lifeline) {
Interaction interaction = (Interaction) notationNode.getParent();
interaction.getLifelines().remove((Lifeline) umlModel);
} else if (false == request.getNewObjectType().equals(NodeType.TEXT)
&& false == request.getNewObjectType().equals(NodeType.NOTE) && null != request.getNewObjectType()) {
org.eclipse.uml2.uml.PackageableElement parentElement = (org.eclipse.uml2.uml.PackageableElement) notationNode.getParent();
if (parentElement instanceof org.eclipse.uml2.uml.Component) {
((org.eclipse.uml2.uml.Component) parentElement).getPackagedElements().remove(umlModel);
} else {
((org.eclipse.uml2.uml.Package) parentElement).getPackagedElements().remove(umlModel);
}
}
if (parentNodeModel instanceof Diagram) {
((Diagram) parentNodeModel).getNodeList().remove(notationNode);
} else if (parentNodeModel instanceof ContainerNode) {
((ContainerNode) parentNodeModel).getNodeList().remove(notationNode);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:27,代码来源:CreateNotationNodeCommand.java
示例7: equals
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* @see org.eclipse.emf.common.ui.URIEditorInput#equals(java.lang.Object)
*/
@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
}
Diagram selectedDiagram = ((DiagramEditorInput) o).getDiagram();
PackageableElement selectedParent = UMLManager.getParent(selectedDiagram);
PackageableElement parent = UMLManager.getParent(this.diagram);
if (selectedParent != null && parent != null) {
if (this.diagram.getId().equals(selectedDiagram.getId()) && parent.equals(selectedParent)) {
return true;
}
}
return false;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:DiagramEditorInput.java
示例8: hasComponentChild
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的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
示例9: createDiagramDataModelList
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* Diagram 데이터 모델 리스트를 생성합니다.
*
* @param pkg
* @return List<DataModel>
*/
private List<DataModel> createDiagramDataModelList(Package pack) throws Exception {
List<DataModel> diagramModelList = new ArrayList<DataModel>();
EAnnotation annotation = null;
Diagram diagram;
for (PackageableElement element : pack.getPackagedElements()) {
if (element.eClass() == UMLPackage.Literals.COLLABORATION) {
annotation = element.getEAnnotation(UICoreConstant.PROJECT_CONSTANTS__DIAGRAM);
if (annotation != null) {
for (EObject eobj : annotation.getContents()) {
if (eobj.eClass() == UMLDiagramPackage.Literals.DIAGRAM) {
diagram = (Diagram) eobj;
if (diagram.getType() == DiagramType.CLASS_DIAGRAM) {
diagramModelList.add(createDiagramModel(diagram));
}
}
}
}
}
}
// if (eObject.eClass() == UMLPackage.Literals.PACKAGE
// || eObject.eClass() == UMLPackage.Literals.MODEL) {
// Package pkg = (Package) eObject;
// for (PackageableElement element : pkg.getPackagedElements()) {
// diagramModelList.addAll(createDiagramDataModelList(element));
// }
// }
return diagramModelList;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:CreateClassDefinitionToXMLFileJob.java
示例10: createClassDataModelList
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的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
示例11: createClass
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的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
示例12: redo
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* @see org.eclipse.gef.commands.Command#redo()
*/
@Override
public void redo() {
// Element diagramModel = this.parentNodeModel.getUmlModel();
Element umlModel = notationNode.getUmlModel();
PackageableElement parentElement = null;
if (umlModel instanceof Lifeline) {
parentElement = UMLManager.getParent(this.parentNodeModel);
Interaction interaction = (Interaction) parentElement;
interaction.getLifelines().add((Lifeline) umlModel);
} else if (false == request.getNewObjectType().equals(NodeType.TEXT)
&& false == request.getNewObjectType().equals(NodeType.NOTE) && null != request.getNewObjectType()) {
parentElement = UMLManager.getParentPackage(this.parentNodeModel);
((org.eclipse.uml2.uml.Package) parentElement).getPackagedElements().add((PackageableElement) umlModel);
}
notationNode.setParent(parentElement);
if (parentNodeModel instanceof Diagram) {
((Diagram) parentNodeModel).getNodeList().add(notationNode);
} else if (parentNodeModel instanceof ContainerNode) {
((ContainerNode) parentNodeModel).getNodeList().add(notationNode);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:28,代码来源:CreateDestructionEventNodeCommand.java
示例13: findMPD
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
private static Element findMPD(final Package theParent) {
if (theParent == null) {
LOG.error("Failed to find PSM package");// tjd message
return null;
}
for (final Package p : theParent.getNestedPackages()) {
if (isMPD(p)) {
for (final PackageableElement e : p.getPackagedElements()) {
if (getAppliedMpdStereotype(e) != null) {
return e;
}
}
LOG.error("Failed to find MPD in package "+p.getQualifiedName());
}
}
LOG.error("Failed to find an MPD in subpackages of "+theParent.getQualifiedName());
return null;
}
开发者ID:GRA-UML,项目名称:tool,代码行数:19,代码来源:NIEMUmlExt.java
示例14: doExecute
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
@Override
protected void doExecute() {
final PackageableElement thePIM = root.getPackagedElements().get(0);
setTargetNamespace(thePIM.getOwnedElements().get(1), modelValues.extensionModelTargetNamespace);
setTargetNamespace(thePIM.getOwnedElements().get(2), modelValues.exchangeModelTargetNamespace);
final Element theMPD = root.getPackagedElements().get(1).getOwnedElements().get(0);
setMPDBaseURI(theMPD, modelValues.mpdBaseURI);
setMPDVersionID(theMPD, modelValues.mpdVersionID);
setMPDDescription(theMPD, modelValues.description);
setMPDPurpose(theMPD, modelValues.purpose);
setMPDSecurityMarking(theMPD, modelValues.securityMarking);
setMPDDomains(theMPD, modelMultiValues.domains);
setMPDKeywords(theMPD, modelMultiValues.keywords);
setMPDAuthoritativeSourceName(theMPD, modelMultiValues.authoritativeSourceName);
setMPDAuthoritativeSourceAddress(theMPD, modelMultiValues.authoritativeSourceAddress);
setMPDAuthoritativeSourceWebsiteURL(theMPD, modelMultiValues.authoritativeSourceWebsiteURL);
setMPDPointsOfContact(theMPD, toEObjects(pointsOfContact, theMPD));
setMPDCreationDate(theMPD, new Date());
}
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:20,代码来源:SetModelValuesCommand.java
示例15: validate
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
@Override
public boolean validate(Model model) {
BinaryModelRel deplRel = (BinaryModelRel) model;
org.eclipse.uml2.uml.Model srcUmlModel;
try {
srcUmlModel = (org.eclipse.uml2.uml.Model) deplRel.getSourceModel().getEMFInstanceRoot();
}
catch (MMINTException e) {
MMINTException.print(IStatus.ERROR, "Can't get model root, skipping validation", e);
return false;
}
for (PackageableElement umlModelObj : srcUmlModel.getPackagedElements()) {
if (!(umlModelObj instanceof Component)) {
continue;
}
ModelElementReference modelElemRef = MIDRegistry.getModelElementReference(deplRel.getModelEndpointRefs().get(0), umlModelObj);
if (modelElemRef == null || modelElemRef.getModelElemEndpointRefs().isEmpty()) {
return false;
}
}
return true;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:ComponentsDeployedConstraint.java
示例16: searchAllImportedComponents
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
public static List<Component> searchAllImportedComponents(Package pack) {
List<Component> components = new ArrayList<Component>();
List<PackageImport> packageImports = pack.getPackageImports();
for (PackageImport packageImport : packageImports) {
Package importedPackage = packageImport.getImportedPackage();
if (importedPackage != null) {
List<PackageableElement> packagedElements = importedPackage.getPackagedElements();
for (PackageableElement packageableElement : packagedElements) {
if (packageableElement instanceof Component) {
components.add((Component)packageableElement);
}
}
components.addAll(searchAllImportedComponents(importedPackage));
}
}
return components;
}
开发者ID:hmarchadour,项目名称:2uml,代码行数:18,代码来源:Utils.java
示例17: searchComponentInModels
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
public static Component searchComponentInModels(Namespace namespace, String componentName) {
Component result = null;
List<EObject> contents = namespace.eResource().getContents();
List<Component> components = new ArrayList<Component>();
for (EObject content : contents) {
if (content instanceof Package) {
Package rootPackage = (Package)content;
List<PackageableElement> packagedElements = rootPackage.getPackagedElements();
for (PackageableElement packageableElement : packagedElements) {
if (packageableElement instanceof Component) {
components.add((Component)packageableElement);
}
}
components.addAll(searchAllImportedComponents(rootPackage));
}
}
for (Component component : components) {
if (componentName.equals(component.getName())) {
result = component;
break;
}
}
return result;
}
开发者ID:hmarchadour,项目名称:2uml,代码行数:26,代码来源:Utils.java
示例18: getParentPackage
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* View model의 부모 반환
*
* @param element
* @return org.eclipse.uml2.uml.PackageableElement
*/
public static org.eclipse.uml2.uml.PackageableElement getParentPackage(AbstractView element) {
org.eclipse.uml2.uml.PackageableElement packageableElement = getParent(element);
if (null == packageableElement) {
return null;
}
if (packageableElement instanceof org.eclipse.uml2.uml.Package
|| packageableElement instanceof org.eclipse.uml2.uml.Component) {
return packageableElement;
} else {
return (org.eclipse.uml2.uml.PackageableElement) getParentPackage(packageableElement);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:UMLManager.java
示例19: getParent
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* getParent
*
* @param eAnnotation
* @return org.eclipse.uml2.uml.PackageableElement
*/
public static org.eclipse.uml2.uml.PackageableElement getParent(EAnnotation eAnnotation) {
if (null == eAnnotation) {
return null;
}
EObject parent = eAnnotation.eContainer();
if (parent instanceof PackageableElement) {
return (org.eclipse.uml2.uml.PackageableElement) parent;
}
return null;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:17,代码来源:UMLManager.java
示例20: setDependency
import org.eclipse.uml2.uml.PackageableElement; //导入依赖的package包/类
/**
* dependency 설정
*
* @param dependency
* @param supplier
* @param client
* void
*/
public static void setDependency(org.eclipse.uml2.uml.Dependency dependency, NamedElement supplier,
NamedElement client) {
dependency.getSuppliers().add(supplier);
dependency.getClients().add(client);
client.getClientDependencies().add(dependency);
org.eclipse.uml2.uml.Package packageElement = UMLManager.getParentPackage((PackageableElement) client);
packageElement.getPackagedElements().add(dependency);
if (client instanceof Component && supplier instanceof Interface) {
((Component) client).getClientDependencies().add(dependency);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:UMLManager.java
注:本文中的org.eclipse.uml2.uml.PackageableElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论