当前位置: 首页>>代码示例>>Java>>正文


Java SiriusPlugin类代码示例

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


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

示例1: createNode

import org.eclipse.sirius.viewpoint.SiriusPlugin; //导入依赖的package包/类
public AbstractDNode createNode(AbstractNodeMapping mapping, EObject modelElement, DragAndDropTarget container,
		DDiagram diagram) {
	final DDiagram diag = diagram;

	ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(modelElement);
	IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(modelElement);
	final DDiagramSynchronizer diagramSync = new DDiagramSynchronizer(interpreter, diag.getDescription(), accessor);
	diagramSync.setDiagram((DSemanticDiagram) diagram);
	final DDiagramElementSynchronizer elementSync = diagramSync.getElementSynchronizer();
	RefreshIdsHolder rId = RefreshIdsHolder.getOrCreateHolder(diagram);

	AbstractDNodeCandidate nodeCandidate = new AbstractDNodeCandidate(mapping, modelElement, container, rId);
	return (AbstractDNode) elementSync.createNewNode(getMappingManager((DSemanticDiagram) diag), nodeCandidate,
			false);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:16,代码来源:DiagramServices.java

示例2: getStyleHelper

import org.eclipse.sirius.viewpoint.SiriusPlugin; //导入依赖的package包/类
private static StyleHelper getStyleHelper(DSemanticDecorator semanticDecorator) {
  return new StyleHelper(SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(semanticDecorator.getTarget()));
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:4,代码来源:ShapeUtil.java

示例3: createEdge

import org.eclipse.sirius.viewpoint.SiriusPlugin; //导入依赖的package包/类
public DEdge createEdge(EdgeMapping mapping, EdgeTarget sourceView, EdgeTarget targetView, EObject semanticObject) {
	ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(semanticObject);
	IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(semanticObject);

	if (mapping == null) {
		return null;
	}

	if ((sourceView == null) || (targetView == null)) {
		return null;
	}

	final DDiagram diagram = DiagramHelper.getService().getDiagramContainer(sourceView);
	RefreshIdsHolder rId = RefreshIdsHolder.getOrCreateHolder(diagram);
	DEdgeCandidate edgeCandidate = new DEdgeCandidate(mapping, semanticObject, sourceView, targetView, rId);

	final DDiagramSynchronizer diagramSync = new DDiagramSynchronizer(interpreter, diagram.getDescription(),
			accessor);
	diagramSync.setDiagram((DSemanticDiagram) diagram);
	final DDiagramElementSynchronizer elementSync = diagramSync.getElementSynchronizer();
	/* maps for decorations */
	final Map<EdgeMapping, Collection<MappingBasedDecoration>> edgeToMappingBasedDecoration = new HashMap<EdgeMapping, Collection<MappingBasedDecoration>>();
	final Map<String, Collection<SemanticBasedDecoration>> edgeToSemanticBasedDecoration = new HashMap<String, Collection<SemanticBasedDecoration>>();

	/* create the mapping to edge targets map */
	final Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets = new HashMap<DiagramElementMapping, Collection<EdgeTarget>>();

	DDiagramElement sourceElement = null;
	DDiagramElement targetElement = null;
	DiagramElementMapping sourceMapping = null;
	DiagramElementMapping targetMapping = null;

	if (sourceView instanceof DDiagramElement) {
		sourceElement = (DDiagramElement) sourceView;
		sourceMapping = sourceElement.getDiagramElementMapping();
	}

	if (targetView instanceof DDiagramElement) {
		targetElement = (DDiagramElement) targetView;
		targetMapping = targetElement.getDiagramElementMapping();
	}

	if (sourceMapping != null) {
		mappingsToEdgeTargets.put(sourceMapping, new ArrayList<EdgeTarget>());
	}
	if ((targetMapping != null) && !targetMapping.equals(sourceMapping)) {
		mappingsToEdgeTargets.put(targetMapping, new ArrayList<EdgeTarget>());
	}

	if (sourceMapping != null) {
		mappingsToEdgeTargets.get(sourceMapping).add(sourceView);
	}
	if ((targetMapping != null) && !sourceView.equals(targetView)) {
		mappingsToEdgeTargets.get(targetMapping).add(targetView);
	}

	diagramSync.computeDecorations(mappingsToEdgeTargets, edgeToSemanticBasedDecoration,
			edgeToMappingBasedDecoration);
	return elementSync.createNewEdge(getMappingManager((DSemanticDiagram) diagram), edgeCandidate,
			mappingsToEdgeTargets, edgeToMappingBasedDecoration, edgeToSemanticBasedDecoration);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:62,代码来源:DiagramServices.java

示例4: getMappingHelper

import org.eclipse.sirius.viewpoint.SiriusPlugin; //导入依赖的package包/类
public MappingHelper getMappingHelper(DSemanticDecorator semanticDecorator) {
 return new MappingHelper(SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(semanticDecorator.getTarget()));
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:4,代码来源:BehaviorScenarioServices.java


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