本文整理汇总了Java中org.eclipse.gmf.runtime.notation.Diagram.setType方法的典型用法代码示例。如果您正苦于以下问题:Java Diagram.setType方法的具体用法?Java Diagram.setType怎么用?Java Diagram.setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.notation.Diagram
的用法示例。
在下文中一共展示了Diagram.setType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDiagram
import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
/**
* @generated
*/
public Diagram createDiagram(IAdaptable semanticAdapter,
String diagramKind, PreferencesHint preferencesHint) {
Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
diagram.setType(StatemachineEditPart.MODEL_ID);
diagram.setElement(getSemanticElement(semanticAdapter));
diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
return diagram;
}
示例2: createGraphicalModel
import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static CDOResource createGraphicalModel(CDOTransaction transaction, CDOResourceFolder folder,
String modelName, String diagramName, IDiagramType diagramType, CDOResource umlResource) {
getOrCreate(transaction, folder, modelName + ".di");
CDOResource notationResource = getOrCreate(transaction, folder, modelName + ".notation");
EObject umlRoot = umlResource.getContents().get(0);
Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
diagram.setType(diagramType.getPapyrusDiagramType());
diagram.setName(diagramName);
diagram.setElement(umlRoot);
StringValueStyle stringValueStyle = NotationFactory.eINSTANCE.createStringValueStyle();
stringValueStyle.setName("diagram_compatibility_version");
stringValueStyle.setStringValue("1.3.0");
diagram.getStyles().add(stringValueStyle);
diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
PapyrusDiagramStyle papyrusDiagramStyle = StyleFactory.eINSTANCE.createPapyrusDiagramStyle();
papyrusDiagramStyle.setOwner(umlRoot);
papyrusDiagramStyle.setDiagramKindId(diagramType.getPapyrusDiagramKindId());
diagram.getStyles().add(papyrusDiagramStyle);
notationResource.getContents().add(diagram);
ModelCreatorPostProcessorRegistry.getInstance().getPostProcessors()
.forEach(processor -> processor.postProcessModel(diagram));
return notationResource;
}