我正在使用graphstream和我的swing应用程序导致很多问题......
FragmentA - onActivityCreated
FragmentA - onLoadFinished
// Device rotation
FragmentA - onActivityCreated
// Device rotation again
FragmentA - onActivityCreated
FragmentA - onLoadFinished
上面给出的主要独立的类工作正常但是当我从按钮点击事件调用同一个类时,整个应用程序停止...这是按钮代码
public class Clicks implements ViewerListener{
protected boolean loop = true;
public Clicks() {
Graph graph = new SingleGraph("Clicks");
graph.addNode("A");
graph.addNode("ch");
graph.addNode("2");
Viewer viewer = graph.display();
viewer.setCloseFramePolicy(Viewer.CloseFramePolicy.EXIT);
ViewerPipe fromViewer = viewer.newViewerPipe();
fromViewer.addViewerListener(this);
fromViewer.addSink(graph);
while(loop) {
fromViewer.pump();
}
}
public void viewClosed(String id) {
loop = false;
}
public void buttonPushed(String id) {
System.out.println("Button pushed on node "+id);
}
public void buttonReleased(String id) {
System.out.println("Button released on node "+id);
}
}