在此部分,我们将创建一个包含场景的单独的类。然后将其关联到我们的 JPanel 。
创建一个名为 GraphSceneImpl.java 的新类。
使其扩展 GraphScene。
使用 IDE 一侧的灯泡图标添加 import 语句和抽象方法。现在,您应看到如下所示的内容:
package vislibdemo;
import org.netbeans.api.visual.graph.GraphScene;
import org.netbeans.api.visual.widget.Widget;
public class GraphSceneImpl extends GraphScene {
@Override
protected Widget attachNodeWidget(String arg0) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected Widget attachEdgeWidget(String arg0) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected void attachEdgeSourceAnchor(String arg0, String arg1, String arg2) {
throw new UnsupportedOperationException("Not supported yet.");
}<