當前位置: 首頁>>代碼示例>>Java>>正文


Java UmlUtils類代碼示例

本文整理匯總了Java中org.eclipse.papyrus.uml.tools.model.UmlUtils的典型用法代碼示例。如果您正苦於以下問題:Java UmlUtils類的具體用法?Java UmlUtils怎麽用?Java UmlUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UmlUtils類屬於org.eclipse.papyrus.uml.tools.model包,在下文中一共展示了UmlUtils類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.eclipse.papyrus.uml.tools.model.UmlUtils; //導入依賴的package包/類
@Override
public void execute() {

	// Get its resource
	Resource umlResource = UmlUtils.getUmlModel(modelSet).getResource();

	// Select the root element to add the wanted imports
	root = (org.eclipse.uml2.uml.Package) umlResource.getContents().get(0);
		
	URI templatelibraryURI = URI.createURI(EXAMPLE_PATH).appendFragment(EXAMPLE_ROOT_ID);
	libraryPackage = (org.eclipse.uml2.uml.Package) modelSet.getEObject(templatelibraryURI, true);

	// Creates the import packages at the root of the model (elements of type packageImport)
	this.getCommandStack(modelSet).execute(new RecordingCommand(modelSet.getTransactionalEditingDomain()) {

		@Override
		protected void doExecute() {
			PackageImport importPrimitivePack = root.createPackageImport(libraryPackage);
			if (!root.getPackageImports().contains(importPrimitivePack)) {
				root.getPackageImports().add(importPrimitivePack);
			}

			try {
				root.eResource().save(Collections.emptyMap());
			} catch (IOException e) {
				//TODO : log error
			}
		}
	});

}
 
開發者ID:bmaggi,項目名稱:library-training,代碼行數:32,代碼來源:ImportLibraryTemplateInModel.java

示例2: SetModelValuesCommand

import org.eclipse.papyrus.uml.tools.model.UmlUtils; //導入依賴的package包/類
public SetModelValuesCommand(final ModelSet modelSet, final BasicValues modelValues, final MPDValues modelMultiValues,
        final List<PointOfContact> pointsOfContact) {
    super(modelSet.getTransactionalEditingDomain());
    this.modelValues = modelValues;
    this.modelMultiValues = modelMultiValues;
    this.pointsOfContact = pointsOfContact;
    root = (Model) UmlUtils.getUmlResource(modelSet).getContents().get(0);
}
 
開發者ID:info-sharing-environment,項目名稱:NIEM-Modeling-Tool,代碼行數:9,代碼來源:SetModelValuesCommand.java

示例3: InitFromTemplateCommand

import org.eclipse.papyrus.uml.tools.model.UmlUtils; //導入依賴的package包/類
public InitFromTemplateCommand(final ModelSet modelSet) {
    super(modelSet.getTransactionalEditingDomain());
    uml = UmlUtils.getUmlResource(modelSet);
    diagram = DiModelUtils.getDiResource(modelSet);
    notation = NotationUtils.getNotationResource(modelSet);
}
 
開發者ID:info-sharing-environment,項目名稱:NIEM-Modeling-Tool,代碼行數:7,代碼來源:InitFromTemplateCommand.java


注:本文中的org.eclipse.papyrus.uml.tools.model.UmlUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。