本文整理汇总了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);
}
示例2: getStyleHelper
import org.eclipse.sirius.viewpoint.SiriusPlugin; //导入依赖的package包/类
private static StyleHelper getStyleHelper(DSemanticDecorator semanticDecorator) {
return new StyleHelper(SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(semanticDecorator.getTarget()));
}
示例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);
}
示例4: getMappingHelper
import org.eclipse.sirius.viewpoint.SiriusPlugin; //导入依赖的package包/类
public MappingHelper getMappingHelper(DSemanticDecorator semanticDecorator) {
return new MappingHelper(SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(semanticDecorator.getTarget()));
}