我目前正在开发一个显示DOT-Graphs的eclipse插件。为此,我使用了this插件。但是,我不知道如何实际显示我构建的图形。我想将它作为编辑器显示在eclipse窗口的中间。
为了完成这项工作,我创建了一个自定义的Editor类,它需要在其createPartControl(Composite)代码中使用一些代码才能使用插件提供的DotGraphView。
问题是,我该如何显示这个DotGraphView? 我的编辑器的代码如下所示:
@Override
public void createPartControl(Composite container) {
DotImport importer = new DotImport(TEST_GRAPH);
Graph graph = importer.newGraphInstance();
DotGraphView dotGraphView = new DotGraphView();
dotGraphView.setGraph(graph);
// add dotGraphView as a child to container and display it
// What todo here?
}
答案 0 :(得分:0)
要在您自己的自定义视图中使用图表,请查看ZestFxUiView
的超级类DotGraphView
的实现。您可以将ZestFxUiView
子类化,并使用图形对象调用setGraph
。