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


Java Diagram.getElement方法代码示例

本文整理汇总了Java中org.eclipse.gmf.runtime.notation.Diagram.getElement方法的典型用法代码示例。如果您正苦于以下问题:Java Diagram.getElement方法的具体用法?Java Diagram.getElement怎么用?Java Diagram.getElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gmf.runtime.notation.Diagram的用法示例。


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

示例1: openEditor

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
/**
 * Opens a subdiagram for a given {@link Diagram}
 */
public static IEditorPart openEditor(Diagram diagramToOpen) {
	IFile file = WorkspaceSynchronizer.getFile(diagramToOpen.eResource());
	try {
		IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName());
		final IWorkbenchPage wbPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
		if (diagramToOpen.getElement() instanceof Statechart) {
			return wbPage.openEditor(new FileEditorInput(file), desc.getId());
		} else if (diagramToOpen.getElement() instanceof State) {
			return wbPage.openEditor(new DiagramEditorInput(diagramToOpen), desc.getId());
		}
	} catch (PartInitException e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:DiagramPartitioningUtil.java

示例2: getDiagramContainerHierachy

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
public static List<Diagram> getDiagramContainerHierachy(Diagram diagram) {
	Assert.isNotNull(diagram);
	List<Diagram> result = new ArrayList<Diagram>();
	result.add(diagram);
	while (diagram.getElement() instanceof State) {
		diagram = DiagramPartitioningUtil.getDiagramContaining((State) diagram.getElement());
		result.add(diagram);
	}
	Collections.reverse(result);
	return result;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:12,代码来源:DiagramPartitioningUtil.java

示例3: getSubDiagramHierachy

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
public static List<Diagram> getSubDiagramHierachy(Diagram diagram) {
	Assert.isNotNull(diagram);
	List<Diagram> result = new ArrayList<Diagram>();
	result.add(diagram);
	while (diagram.getElement() instanceof State) {
		diagram = DiagramPartitioningUtil.getSubDiagram((CompositeElement) diagram.getElement());
		result.add(diagram);
	}
	Collections.reverse(result);
	return result;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:12,代码来源:DiagramPartitioningUtil.java

示例4: createDiagramViewer

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
protected TreeViewer createDiagramViewer(final Composite composite, Diagram diagram) {
	TreeViewer viewer = new TreeViewer(composite);
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory()));
	viewer.setContentProvider(new AdapterFactoryContentProvider(new BreadcrumbItemProviderAdapterFactory()));
	EObject element = diagram.getElement();
	viewer.setInput(element);
	viewer.addSelectionChangedListener(this);
	return viewer;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:10,代码来源:DiagramPartitioningBreadcrumbViewer.java

示例5: initializeTitle

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
protected void initializeTitle(Diagram diagram) {
	EObject element = diagram.getElement();
	AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(
			new SGraphItemProviderAdapterFactory());
	setTitleImage(labelProvider.getImage(element));
	setPartName(labelProvider.getText(element));
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:8,代码来源:DiagramPartitioningEditor.java

示例6: updateLabel

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
public void updateLabel(ViewerLabel label, TreePath elementPath) {
	Diagram lastSegment = (Diagram) elementPath.getLastSegment();
	NamedElement element = (NamedElement) lastSegment.getElement();
	AdapterFactoryLabelProvider provider = new AdapterFactoryLabelProvider(
			new SGraphItemProviderAdapterFactory());
	label.setText(provider.getText(element));
	if (element instanceof Statechart)
		label.setImage(StatechartImages.LOGO.image());
	else
		label.setImage(provider.getImage(element));

}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:13,代码来源:DiagramPartitioningEditor.java

示例7: getDiagramContainer

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
/**
 * Gets the {@link Element} that is the container of the diagram
 * @param diagram - The Diagram
 * @return Container of the diagram
 */
public Element getDiagramContainer(Diagram diagram){
	return (Element) diagram.getElement();
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:9,代码来源:DiagramManager.java


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