• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RepresentationDescription类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.sirius.viewpoint.description.RepresentationDescription的典型用法代码示例。如果您正苦于以下问题:Java RepresentationDescription类的具体用法?Java RepresentationDescription怎么用?Java RepresentationDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RepresentationDescription类属于org.eclipse.sirius.viewpoint.description包,在下文中一共展示了RepresentationDescription类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getMappingByName

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**
 * @param targetDescription
 * @param targetMappingName
 * @return
 */
public DiagramElementMapping getMappingByName(RepresentationDescription targetDescription,
		String targetMappingName) {
	DiagramElementMapping mapping = null;

	if ((targetMappingName != null) && (targetDescription != null)
			&& (targetDescription instanceof DiagramDescription)) {
		mapping = DiagramServices.getDiagramServices()
				.getAbstractNodeMapping((DiagramDescription) targetDescription, targetMappingName);
		if (mapping == null) {
			mapping = DiagramServices.getDiagramServices().getEdgeMapping((DiagramDescription) targetDescription,
					targetMappingName);
		}
	}

	return mapping;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:22,代码来源:DiagramServices.java


示例2: getRepresentationsToRefresh

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**
 * Gets the {@link List} of {@link DRepresentation} to refresh in the given {@link IEditingSession}.
 * 
 * @param toRefresh
 *            the representation names and layers to refresh
 * @param session
 *            the {@link IEditingSession}
 * @return the {@link List} of {@link DRepresentation} to refresh in the given {@link IEditingSession}
 */
private List<DRepresentation> getRepresentationsToRefresh(Map<String, Set<String>> toRefresh,
		IEditingSession session) {
	final List<DRepresentation> representations = new ArrayList<DRepresentation>();
	for (DialectEditor editor : session.getEditors()) {
		final DRepresentation representation = editor.getRepresentation();
		if (representation == null) {
			System.out.println("Dammit");
		} else {
			final RepresentationDescription description = DialectManager.INSTANCE.getDescription(
					representation);
			if (description != null) {
				final String representationId = description.getName();
				final Set<String> layerIDs = toRefresh.get(representationId);
				if (layerIDs == ANY_LAYER) {
					representations.add(representation);
				} else if (layerIDs != null && representation instanceof DDiagram && isActiveLayer(
						(DDiagram)representation, layerIDs)) {
					representations.add(representation);
				}
			}
		}
	}
	return representations;
}
 
开发者ID:SiriusLab,项目名称:ModelDebugging,代码行数:34,代码来源:AbstractDSLDebuggerServices.java


示例3: getRepresentationsToRefresh

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**Gets the {@link List} of {@link DRepresentation} to refresh in the given {@link IEditingSession}.
 * @param toRefresh the representation names and layers to refresh
 * @param session the {@link IEditingSession}
 * @return the {@link List} of {@link DRepresentation} to refresh in the given {@link IEditingSession}
 */
private List<DRepresentation> getRepresentationsToRefresh(
		final Map<String, Set<String>> toRefresh,
		IEditingSession session) {
	final List<DRepresentation> representations = new ArrayList<DRepresentation>();
	for (DialectEditor editor : session.getEditors()) {
		final DRepresentation representation = editor
				.getRepresentation();
		if (representation != null) {
			final RepresentationDescription description = DialectManager.INSTANCE
					.getDescription(representation);
			if (description != null) {
				final String representationId = description.getName();
				final Set<String> layerIDs = toRefresh
						.get(representationId);
				if (layerIDs == ANY_LAYER) {
					representations.add(representation);
				} else if (layerIDs != null
						&& representation instanceof DDiagram
						&& isActiveLayer((DDiagram) representation,
								layerIDs)) {
					representations.add(representation);
				}
			}
		}
	}
	return representations;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:33,代码来源:AbstractGemocAnimatorServices.java


示例4: isA

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**
 * Returns whether the given diagram description is the given description
 * 
 * @param diagram_p
 *          current diagram
 * @param diagramDescriptionId
 *          a DiagramDescriptionConstants
 */
public boolean isA(RepresentationDescription description, String diagramDescriptionId) {
  if (description != null) {
    if (diagramDescriptionId == null) {
      return true;
    }
    return diagramDescriptionId.equals(description.getName());
  }
  return false;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:18,代码来源:DiagramHelper.java


示例5: hasKind

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
public boolean hasKind(DRepresentation diagram, String diagramDescriptionId) {
  if (diagram != null) {
    RepresentationDescription description = getDescription(diagram);
    return hasKind(description, diagramDescriptionId);
  }
  return false;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:8,代码来源:DiagramHelper.java


示例6: getDescription

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
public RepresentationDescription getDescription(Session session, String descriptionId) {
  Collection<Viewpoint> viewpoints = session.getSelectedViewpoints(true);
  for (Viewpoint viewpoint : viewpoints) {
    for (RepresentationDescription description : viewpoint.getOwnedRepresentations()) {
      if (descriptionId.equals(description.getName())) {
        return description;
      }
    }
  }
  return null;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:12,代码来源:DiagramHelper.java


示例7: getRepresentationDescription

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**
 * Get a representation description.
 *
 * @param eObject
 *            Semantic object
 * @param session
 *            Session
 * @param representationDescriptionId
 *            Representation description id
 * @return Representation description
 */
public static RepresentationDescription getRepresentationDescription(EObject eObject, Session session,
		String representationDescriptionId) {
	final Collection<RepresentationDescription> representationDescriptions = DialectManager.INSTANCE
			.getAvailableRepresentationDescriptions(session.getSelectedViewpoints(true), eObject);
	for (final RepresentationDescription representationDescription : representationDescriptions) {
		if (representationDescriptionId.equals(representationDescription.getName())) {
			return representationDescription;
		}
	}
	return null;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:23,代码来源:WizardUtils.java


示例8: openDiagram

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**
 * The current perspective must be modeling.
 */
public static void openDiagram(final IProgressMonitor monitor, IProject project, final String diagramName,
		final String diagramInstanceName, final EObject rootObject) {
	// Init the representation
	final Option<ModelingProject> optionalModelingProject = ModelingProject.asModelingProject(project);
	if (optionalModelingProject.some()) {
		final Session session = optionalModelingProject.get().getSession();

		final RepresentationDescription representationDescription = WizardUtils
				.getRepresentationDescription(rootObject, session, diagramName);

		RecordingCommand createcommand = new RecordingCommand(session.getTransactionalEditingDomain()) {

			@Override
			protected void doExecute() {
				DRepresentation representation = DialectManager.INSTANCE.createRepresentation(diagramInstanceName,
						rootObject, representationDescription, session, monitor);
				DialectUIManager.INSTANCE.openEditor(session, representation, monitor);
			}
		};
		try {
			session.getTransactionalEditingDomain().getCommandStack().execute(createcommand);
		} catch (Exception e) {
			Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
					Messages.NewExtensionWizard_RepresentationCreationError, e));
		}
	}
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:31,代码来源:WizardUtils.java


示例9: findDescription

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
/**
 * Gets the {@link RepresentationDescription} with the given {@link RepresentationDescription#getName() description name}.
 * 
 * @param session
 *            the {@link Session}
 * @param descriptionName
 *            the {@link RepresentationDescription#getName() description name}
 * @return the {@link RepresentationDescription} with the given {@link RepresentationDescription#getName() description name} if
 *         any found, <code>null</code> otherwise
 * @throws ProviderException
 *             if the specified representation doesn't exist.
 */
public static RepresentationDescription findDescription(Session session, String descriptionName) {
    Collection<Viewpoint> selectedViewpoints = session.getSelectedViewpoints(false);
    for (Viewpoint viewpoint : selectedViewpoints) {
        EList<RepresentationDescription> ownedRepresentations = viewpoint.getOwnedRepresentations();
        for (RepresentationDescription representationDescription : ownedRepresentations) {
            if (descriptionName.equals(representationDescription.getName())) {
                return representationDescription;
            }
        }
    }
    return null;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:25,代码来源:SiriusRepresentationUtils.java


示例10: createDRepresentation

import org.eclipse.sirius.viewpoint.description.RepresentationDescription; //导入依赖的package包/类
public DRepresentation createDRepresentation(String name, EObject semantic, RepresentationDescription description, Session session, IProgressMonitor monitor) {
  return DialectManager.INSTANCE.createRepresentation(name, semantic, description, session, monitor);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:4,代码来源:DiagramHelper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RefreshCallQueueResponseProto类代码示例发布时间:2022-05-23
下一篇:
Java NoteBlockEvent类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap