dahen
发贴: 25
积分: 0
|
于 2005-06-02 16:33
非常感谢这位朋友的回复。
你说的没错。的确,在一个基于stand-alone SWT-Application的应用里面,用SWT_AWT 引入 JGraph是成功的。
但是,我现在是想将JGraph引入到基于RCP的应用中去。我上是这样做的,在ATestEditor extends EditorPart 的方法 createPartControl中,我的代码如下:
public void createPartControl(Composite parent) { Composite container = new Composite(parent, SWT.EMBEDDED); container.setLayout(new FillLayout(SWT.VERTICAL));
final Frame frame = SWT_AWT.new_Frame(container); frame.add(getScrollPane()); graph = new JGraph();//new DefaultGraphModel() scrollPane.add(graph);
// Control-drag should clone selection graph.setCloneable(true);
// Enable edit without final RETURN keystroke graph.setInvokesStopCellEditing(true);
// When over a cell, jump to its default port (we only have one, anyway) graph.setJumpToDefaultPort(true); }
但是,启动程序后,系统在打开一个editor实例时,提示如下错误信息:
Unhandled event loop exception Reason: org/jgraph/JGraph
这是为什么呢?
烦请楼上的朋友指教! 不胜感激。
|